Let´s say I have two branches, default and mybranch, I would like to write a small script to see:
- How often mybranch merges with default (changes goes from mybranch to default)
- How often mybranch merges from default (changes goes from default into mybranch)
Some pseudocode for #1:
m_lastmergetime = 0
for each m in [all merges with default from mybranch]
m_mergetime = m.date_in_hours
m_timebetweenmerges = m_mergetime - m_lastmergetime
if m_lastmergetime > 0
print m_timebetweenmerges
Sub.steps:
- A Mercurial query which matches all merges with default from mybranch
- A style for Mercurial which shows the date in hours
- Calculate the time between merges as in the above pseudocode using Bash or Python
Case #2 will be pretty similar. I only need:
- A Mercurial query which matches all merges with mybranch from default
To find all the changesets on branch X that was merged in from branch Y you would issue the following Mercurial command:
To find everything on branch Y that was merged in from branch X (ie. the opposite direction), simply change the last branch name there to Y:
Basically the query says that you want all changesets that: