Patchwork [V2] revlog: fix a regression with null revision

login
register
mail settings
Submitter Alexander Plavin
Date April 18, 2013, 10:23 p.m.
Message ID <0617a9c3b314de0ab511.1366323815@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/1446/
State Accepted, archived
Headers show

Comments

Alexander Plavin - April 18, 2013, 10:23 p.m.
# HG changeset patch
# User Alexander Plavin <me@aplavin.ru>
# Date 1366289169 -14400
#      Thu Apr 18 16:46:09 2013 +0400
# Node ID 0617a9c3b314de0ab511a8b8d16dac0dc9074ad1
# Parent  7d31f2e42a8afb54c8fae87e8e3e29a63578aea4
revlog: fix a regression with null revision

Introduced in the patch which fixes issue3497
Part of that patch was erroneously submitted and it shouldn't be in the code
Matt Mackall - April 18, 2013, 10:35 p.m.
On Fri, 2013-04-19 at 02:23 +0400, Alexander Plavin wrote:
> # HG changeset patch
> # User Alexander Plavin <me@aplavin.ru>
> # Date 1366289169 -14400
> #      Thu Apr 18 16:46:09 2013 +0400
> # Node ID 0617a9c3b314de0ab511a8b8d16dac0dc9074ad1
> # Parent  7d31f2e42a8afb54c8fae87e8e3e29a63578aea4
> revlog: fix a regression with null revision

Queued for default, thanks.

Patch

diff -r 7d31f2e42a8a -r 0617a9c3b314 mercurial/revlog.py
--- a/mercurial/revlog.py	Mon Apr 15 18:57:04 2013 -0300
+++ b/mercurial/revlog.py	Thu Apr 18 16:46:09 2013 +0400
@@ -771,10 +771,6 @@ 
                 nl = [n for n in nl if hex(n).startswith(id)]
                 if len(nl) > 0:
                     if len(nl) == 1:
-                        if nl[0] == nullid:
-                            # dummy null revision always exists,
-                            # it shouldn't be returned here
-                            return None
                         self._pcache[id] = nl[0]
                         return nl[0]
                     raise LookupError(id, self.indexfile,
diff -r 7d31f2e42a8a -r 0617a9c3b314 tests/test-glog.t
--- a/tests/test-glog.t	Mon Apr 15 18:57:04 2013 -0300
+++ b/tests/test-glog.t	Thu Apr 18 16:46:09 2013 +0400
@@ -1542,7 +1542,6 @@ 
   $ testlog --follow
   []
   []
-  abort: unknown revision '0'!
   $ echo a > a
   $ echo aa > aa
   $ echo f > f