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

login
register
mail settings
Submitter Cristian Zamfir
Date March 12, 2014, 6:50 p.m.
Message ID <63cdb561517221c9f69c.1394650213@cristizmf-Lenovo-G500>
Download mbox | patch
Permalink /patch/3931/
State Accepted
Commit 58c32a9c8e7be52b5c820be502340cdaf98dfa4c
Headers show

Comments

Cristian Zamfir - March 12, 2014, 6:50 p.m.
# HG changeset patch
# User Cristian Zamfir <cristi_zmf@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.
David Soria Parra - March 12, 2014, 9:12 p.m.
cristi_zmf@yahoo.com writes:

> # HG changeset patch
> # User Cristian Zamfir <cristi_zmf@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.
>

looks good to me.
Matt Mackall - March 13, 2014, 4:31 a.m.
On Wed, 2014-03-12 at 20:50 +0200, cristi_zmf@yahoo.com wrote:
> # HG changeset patch
> # User Cristian Zamfir <cristi_zmf@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)

Queued for stable, thanks.

Patch

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