[PATCH V2] hg log: solves bug regarding hg log -r 0:null (issue4039)

cristi_zmf at yahoo.com cristi_zmf at yahoo.com
Wed Mar 12 13:50:13 CDT 2014


# HG changeset patch
# User Cristian Zamfir <cristi_zmf at yahoo.com>
# Date 1394612808 -7200
#      Wed Mar 12 10:26:48 2014 +0200
# Node ID 63cdb561517221c9f69c3dbccf34bcbd1006aec6
# Parent  19e9478c1a2245b6b5b4b2882efee5261d7df963
hg log: solves bug regarding hg log -r 0:null (issue4039)

'hg log -r 0:null' was showing only one changeset(the '-1' one) instead of the first two changesets.

diff -r 19e9478c1a22 -r 63cdb5615172 mercurial/scmutil.py
--- a/mercurial/scmutil.py	Thu Mar 06 17:26:49 2014 -0600
+++ b/mercurial/scmutil.py	Wed Mar 12 10:26:48 2014 +0200
@@ -506,7 +506,7 @@
                 start, end = spec.split(_revrangesep, 1)
                 start = revfix(repo, start, 0)
                 end = revfix(repo, end, len(repo) - 1)
-                if end == nullrev and start <= 0:
+                if end == nullrev and start < 0:
                     start = nullrev
                 rangeiter = repo.changelog.revs(start, end)
                 if not seen and not l:
diff -r 19e9478c1a22 -r 63cdb5615172 tests/test-glog.t
--- a/tests/test-glog.t	Thu Mar 06 17:26:49 2014 -0600
+++ b/tests/test-glog.t	Wed Mar 12 10:26:48 2014 +0200
@@ -2111,6 +2111,11 @@
 issue3772
 
   $ hg log -G -r :null
+  o  changeset:   0:f8035bb17114
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     add a
+  |
   o  changeset:   -1:000000000000
      user:
      date:        Thu Jan 01 00:00:00 1970 +0000
diff -r 19e9478c1a22 -r 63cdb5615172 tests/test-log.t
--- a/tests/test-log.t	Thu Mar 06 17:26:49 2014 -0600
+++ b/tests/test-log.t	Wed Mar 12 10:26:48 2014 +0200
@@ -1356,6 +1356,12 @@
 issue3772: hg log -r :null showing revision 0 as well
 
   $ hg log -r :null
+  changeset:   0:65624cd9070a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     a bunch of weird directories
+  
   changeset:   -1:000000000000
   user:        
   date:        Thu Jan 01 00:00:00 1970 +0000


More information about the Mercurial-devel mailing list