Comments
Patch
@@ -1736,7 +1736,7 @@
# returns the revision matching A then the revision matching B. Sort
# again to fix that.
revs = matcher(repo, revs)
- if not opts.get('rev'):
+ if not opts.get('rev') or expr == "(not merge())":
revs.sort(reverse=True)
if limit is not None:
count = 0
@@ -1375,3 +1375,39 @@
$ cd ..
+
+issue4289: if -M flag and an explicit revision range is given to hg log, the order
+should not be reversed.
+
+Create a new repo
+ $ hg init issue4289
+ $ cd issue4289
+Initial commit to the repo
+ $ echo "hello" > a.txt
+ $ hg add
+ adding a.txt
+ $ hg ci -m "initial commit"
+
+Make another commit to the repo
+ $ echo "world" >> a.txt
+ $ hg ci -m "Another commit"
+
+Create another head
+ $ hg up -r 0
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ $ echo "hello world" > b.txt
+ $ hg add
+ adding b.txt
+ $ hg ci -m "added a new file"
+ created new head
+
+Merge the two heads
+ $ hg merge
+ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+ (branch merge, don't forget to commit)
+ $ hg ci -m "merged"
+
+Run log command
+ $ hg log -M -q -r 2:1
+ 2:b0b1beee06eb
+ 1:4e6686af661c