Patchwork fix a regression with null revision

login
register
mail settings
Submitter Alexander Plavin
Date April 18, 2013, 12:46 p.m.
Message ID <0959221525692f44a70a.1366289219@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/1409/
State Changes Requested, archived
Headers show

Comments

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

It started in 19035:c1af1fb314bc, which fixes issue3497
Augie Fackler - April 18, 2013, 3:06 p.m.
On Thu, Apr 18, 2013 at 04:46:59PM +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 0959221525692f44a70a39ed77fb3c9f050fd126
> # Parent  7d31f2e42a8afb54c8fae87e8e3e29a63578aea4
> fix a regression with null revision

Slightly-wrong summary format. Probably wants to be "log: fix a..."

>
> It started in 19035:c1af1fb314bc, which fixes issue3497
>
> diff -r 7d31f2e42a8a -r 095922152569 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 095922152569 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'!

If we're fixing a regression, why does this touch a test?

>    $ echo a > a
>    $ echo aa > aa
>    $ echo f > f
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Bryan O'Sullivan - April 18, 2013, 4:26 p.m.
On Thu, Apr 18, 2013 at 8:06 AM, Augie Fackler <raf@durin42.com> wrote:

> Slightly-wrong summary format. Probably wants to be "log: fix a..."
>
> >
> > It started in 19035:c1af1fb314bc, which fixes issue3497
>

Also, there's zero to negative value in mentioning a rev number in a commit
description, since they're local identifiers.
Alexander Plavin - April 18, 2013, 9:41 p.m.
2013/4/18 Augie Fackler <raf@durin42.com>

> On Thu, Apr 18, 2013 at 04:46:59PM +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 0959221525692f44a70a39ed77fb3c9f050fd126
> > # Parent  7d31f2e42a8afb54c8fae87e8e3e29a63578aea4
> > fix a regression with null revision
>
> Slightly-wrong summary format. Probably wants to be "log: fix a..."
>
> >
> > It started in 19035:c1af1fb314bc, which fixes issue3497
> >
> > diff -r 7d31f2e42a8a -r 095922152569 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 095922152569 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'!
>
> If we're fixing a regression, why does this touch a test?
>

In the previous patch this test was wrongly changed due to my incorrect
understanding of --follow.

>
> >    $ echo a > a
> >    $ echo aa > aa
> >    $ echo f > f
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel@selenic.com
> > http://selenic.com/mailman/listinfo/mercurial-devel
>

Patch

diff -r 7d31f2e42a8a -r 095922152569 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 095922152569 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