Order of commits from hg log?

Matt Mackall mpm at selenic.com
Mon Jun 23 18:09:16 UTC 2014


On Mon, 2014-06-23 at 16:04 +0100, Peter Hull wrote:
> I noticed something odd when trying to get a change log for a subset
> of my repository (which contains merge commits)
> I was typing
> hg log -M -r x:y --style changelog
> and I noticed that -r x:y and -r y:x both gave the same order of
> commits (tip last) whereas without the -r flag it was tip first (as
> expected)
> The --style is irrelevant but if -M is not specified it again behaves
> as expected. I made a script to test this (see below) and it doesn't
> matter if the repository actually has merge commits or not.
> 
> I am using Mercurial Distributed SCM (version 3.0.1) on Cygwin
> 
> Can anyone clarify this - this may be the designed behavour or I might
> have got it all mixed up?

Looks like a regression, please file a bug report.

# Old Mercurial
$ hg29 log -q -M -r 10:9
10:e76ed1e480ef
9:b4d0c3786ad3

# New Mercurial without -M
$ hg log -q -r 10:9
10:e76ed1e480ef
9:b4d0c3786ad3

# New Mercurial
$ hg log -M -q -r 10:9
9:b4d0c3786ad3
10:e76ed1e480ef

# New Mercurial with a revset
$ hg log -M -q -r "(10:9)"
10:e76ed1e480ef
9:b4d0c3786ad3

# New Mercurial with -M in revset
$ hg log -q -r 'not merge() and 10:9'
10:e76ed1e480ef
9:b4d0c3786ad3

Seems to be an interaction between our new convert-arguments-to-revsets
code and non-revset ranges. Weird.

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list