How do I view list of commit messages between two branches

140 views Asked by At

There is a repository located at:

http://hg.tryton.org/trytond

How do I view list of changes (as commits and messages) between branches 2.8 and 3.0?

I tried

$ hg log -r "2.8:3.0" --template '{node|short} {desc|strip|firstline}\n' 
e1e5cf5700d0 Increase version number
faa26bc2e908 Added tag 2.8.12 for changeset a81a53304344
a81a53304344 Prepare release 2.8.12
b57e24462eb1 Increase version number

But it lists not all changes made between 2.8 and 3.0

2

There are 2 answers

4
Lazy Badger On

Log of changes between branches?! How you'll imagine this? Branches are independent (mutable) trees with (possible) common ancestor in the past

Revset with ":" range produced, as expected

All changesets with revision numbers between x and y, both inclusive.

hg glog -r "2.8:3.0" -T "{branch} {rev} {tags}\n{node|short} {desc|strip|firstline}\n\n"
o  2.8 4801
|  e1e5cf5700d0 Increase version number
|
o  2.8 4800
|  faa26bc2e908 Added tag 2.8.12 for changeset a81a53304344
|
o  2.8 4799 2.8.12
|  a81a53304344 Prepare release 2.8.12
|
| o  3.0 4798
| |  b57e24462eb1 Increase version number
| |

When you use branch-name as revision-id, branch's tip used as node, and before any commits into any of affected by revset branches, you'll get only this result

While I can't find any reasonable backend in you query, I have to ask "Which was your real business-task?"

Add-on

Log with hardcoded revset for "revisions between two last tags in branches 2.8 and 3.0" will be

hg log -r "last(tag('re:^2.8')):last(tag('re:^3.0'))"

and revset can be easy converted into the parametrized [revsetalias] like

cbt($1, $2) = last(tag('re:^$1')):last(tag('re:^$2'))

and log can be shortened to

hg log -r "cbt(2.8, 3.0)"

2.8 4799 2.8.12
a81a53304344 Prepare release 2.8.12

3.0 4798
b57e24462eb1 Increase version number

3.0 4797
a1dc5578784d Added tag 3.0.8 for changeset ff943130c7c4

3.0 4796 3.0.8
ff943130c7c4 Prepare release 3.0.8

and used for any pair of branches

3
ced On
hg log -r "(ancestors(2.8) or ancestors(3.0)) and not (ancestors(2.8) and ancestors(3.0))"