Patchwork solved bug4039

login
register
mail settings
Submitter Cristian Zamfir
Date March 12, 2014, 8:40 a.m.
Message ID <1394613650.87252.YahooMailNeo@web161302.mail.bf1.yahoo.com>
Download mbox | patch
Permalink /patch/3912/
State Accepted
Headers show

Comments

Cristian Zamfir - March 12, 2014, 8:40 a.m.
This is my second try at submitting a patch for Mercurial because my first submit did not have proper form.
I would like to thank David Soria Parra and Stephen Lee for pointing the flaws in my first submit. I hope this time the patch has proper form.

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

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

This patches solves the problem and makes 'hg log -r 0:null' show the correct information.(bug4039)

Patch

diff -r 19e9478c1a22 -r 4a5cf6b98ede mercurial/scmutil.py
--- a/mercurial/scmutil.pyThu Mar 06 17:26:49 2014 -0600
+++ b/mercurial/scmutil.pyWed 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 4a5cf6b98ede tests/test-glog.t
--- a/tests/test-glog.tThu Mar 06 17:26:49 2014 -0600
+++ b/tests/test-glog.tWed 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 4a5cf6b98ede tests/test-log.t
--- a/tests/test-log.tThu Mar 06 17:26:49 2014 -0600
+++ b/tests/test-log.tWed 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