Patchwork [1,of,5] grep: clarify that --all works exactly the same way as --diff

login
register
mail settings
Submitter Gregory Szorc
Date Sept. 18, 2020, 1:35 a.m.
Message ID <CAKQoGa=5suP8DEhK1yn+jOq-XWqV0Vk_do+eYjbCy9Dg7fxTuw@mail.gmail.com>
Download mbox | patch
Permalink /patch/47202/
State New
Headers show

Comments

Gregory Szorc - Sept. 18, 2020, 1:35 a.m.
This series appears to have introduced a Python 3 test failure:

+      listcache.append(func())
+    File "/home/gps/src/hg-committed/mercurial/commands.py", line 3472, in
binary
+      return stringutil.binary(flog.read(ctx.filenode(fn)))
+    File "/home/gps/src/hg-committed/mercurial/context.py", line 293, in
filenode
+      return self._fileinfo(path)[0]
+    File "/home/gps/src/hg-committed/mercurial/context.py", line 1583, in
_fileinfo
+      return super(workingctx, self)._fileinfo(path)
+    File "/home/gps/src/hg-committed/mercurial/context.py", line 273, in
_fileinfo
+      raise error.ManifestLookupError(
+    File "/home/gps/src/hg-committed/mercurial/error.py", line 76, in
__init__
+      RevlogError.__init__(self, b'%s@%s: %s' % (index, name, message))
+  TypeError: %b requires a bytes-like object, or an object that implements
__bytes__, not 'NoneType'
+  [1]

Unfortunately, I didn't notice this until I already accepted the patches.
So this will need a follow-up commit to fix.

On Thu, Sep 17, 2020 at 8:32 AM Augie Fackler <raf@durin42.com> wrote:

> queued these, thanks
>
> > On Sep 17, 2020, at 08:42, Yuya Nishihara <yuya@tcha.org> wrote:
> >
> > # HG changeset patch
> > # User Yuya Nishihara <yuya@tcha.org>
> > # Date 1599711053 -32400
> > #      Thu Sep 10 13:10:53 2020 +0900
> > # Node ID a4ddce2205693eb3bfafff9a3f9ffe7c4d8e45f9
> > # Parent  6916e6b81fef2158afbdf235acc826c81649d149
> > grep: clarify that --all works exactly the same way as --diff
> >
> > 7fbb5d76c555 "grep: add --diff flag" says as such, but the help strings
> > have diverged since, and it's getting fuzzier what this --all will do.
> >
> > diff --git a/mercurial/commands.py b/mercurial/commands.py
> > --- a/mercurial/commands.py
> > +++ b/mercurial/commands.py
> > @@ -3252,7 +3252,7 @@ statemod.addunfinished(
> >     b'grep',
> >     [
> >         (b'0', b'print0', None, _(b'end fields with NUL')),
> > -        (b'', b'all', None, _(b'print all revisions that match
> (DEPRECATED) ')),
> > +        (b'', b'all', None, _(b'an alias to --diff (DEPRECATED)')),
> >         (
> >             b'',
> >             b'diff',
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel@mercurial-scm.org
> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Gregory Szorc - Sept. 18, 2020, 2:13 a.m.
Nevermind: looks like https://phab.mercurial-scm.org/D9030 fixes this. I
have this in my local queue and will push shortly.

On Thu, Sep 17, 2020 at 6:35 PM Gregory Szorc <gregory.szorc@gmail.com>
wrote:

> This series appears to have introduced a Python 3 test failure:
>
> --- /home/gps/src/hg-committed/tests/test-grep.t
> +++ /home/gps/src/hg-committed/tests/test-grep.t.err
> @@ -995,8 +995,63 @@
>    $ hg grep --diff -fr'wdir()' data
>    add0-cp4-mod4:2147483647:+:data4
>    add0-mod4:2147483647:+:data4
> -  add0-rm4:2147483647:-:abort: add0-rm4@None: not found in manifest!
> -  [255]
> +  add0-rm4:2147483647:-:** unknown exception encountered, please report
> by visiting
> +  ** https://mercurial-scm.org/wiki/BugTracker
> +  ** Python 3.8.5 (default, Aug  2 2020, 08:56:32) [GCC 9.3.0]
> +  ** Mercurial Distributed SCM (version 5.5.1+276-63eb1b5c580d)
> +  ** Extensions loaded:
> +  Traceback (most recent call last):
> +    File "/home/gps/src/hg-committed/mercurial/context.py", line 271, in
> _fileinfo
> +      return self._manifest.find(path)
> +    File "/home/gps/src/hg-committed/mercurial/manifest.py", line 480, in
> find
> +      return self._lm[key]
> +  KeyError: 'No such manifest entry.'
> +
> +  During handling of the above exception, another exception occurred:
> +
> +  Traceback (most recent call last):
> +    File "/home/gps/src/hg-committed/hg", line 43, in <module>
> +      dispatch.run()
> +    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 113, in
> run
> +      status = dispatch(req)
> +    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 303, in
> dispatch
> +      ret = _runcatch(req) or 0
> +    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 479, in
> _runcatch
> +      return _callcatch(ui, _runcatchfunc)
> +    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 488, in
> _callcatch
> +      return scmutil.callcatch(ui, func)
> +    File "/home/gps/src/hg-committed/mercurial/scmutil.py", line 153, in
> callcatch
> +      return func()
> +    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 469, in
> _runcatchfunc
> +      return _dispatch(req)
> +    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 1232,
> in _dispatch
> +      return runcommand(
> +    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 917, in
> runcommand
> +      ret = _runcommand(ui, options, cmd, d)
> +    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 1244,
> in _runcommand
> +      return cmdfunc()
> +    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 1230,
> in <lambda>
> +      d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
> +    File "/home/gps/src/hg-committed/mercurial/util.py", line 1867, in
> check
> +      return func(*args, **kwargs)
> +    File "/home/gps/src/hg-committed/mercurial/commands.py", line 3647,
> in grep
> +      r = display(fm, fn, ctx, pstates, states)
> +    File "/home/gps/src/hg-committed/mercurial/commands.py", line 3535,
> in display
> +      if not opts.get(b'text') and binary():
> +    File "/home/gps/src/hg-committed/mercurial/util.py", line 1224, in f
> +      listcache.append(func())
> +    File "/home/gps/src/hg-committed/mercurial/commands.py", line 3472,
> in binary
> +      return stringutil.binary(flog.read(ctx.filenode(fn)))
> +    File "/home/gps/src/hg-committed/mercurial/context.py", line 293, in
> filenode
> +      return self._fileinfo(path)[0]
> +    File "/home/gps/src/hg-committed/mercurial/context.py", line 1583, in
> _fileinfo
> +      return super(workingctx, self)._fileinfo(path)
> +    File "/home/gps/src/hg-committed/mercurial/context.py", line 273, in
> _fileinfo
> +      raise error.ManifestLookupError(
> +    File "/home/gps/src/hg-committed/mercurial/error.py", line 76, in
> __init__
> +      RevlogError.__init__(self, b'%s@%s: %s' % (index, name, message))
> +  TypeError: %b requires a bytes-like object, or an object that
> implements __bytes__, not 'NoneType'
> +  [1]
>
> Unfortunately, I didn't notice this until I already accepted the patches.
> So this will need a follow-up commit to fix.
>
> On Thu, Sep 17, 2020 at 8:32 AM Augie Fackler <raf@durin42.com> wrote:
>
>> queued these, thanks
>>
>> > On Sep 17, 2020, at 08:42, Yuya Nishihara <yuya@tcha.org> wrote:
>> >
>> > # HG changeset patch
>> > # User Yuya Nishihara <yuya@tcha.org>
>> > # Date 1599711053 -32400
>> > #      Thu Sep 10 13:10:53 2020 +0900
>> > # Node ID a4ddce2205693eb3bfafff9a3f9ffe7c4d8e45f9
>> > # Parent  6916e6b81fef2158afbdf235acc826c81649d149
>> > grep: clarify that --all works exactly the same way as --diff
>> >
>> > 7fbb5d76c555 "grep: add --diff flag" says as such, but the help strings
>> > have diverged since, and it's getting fuzzier what this --all will do.
>> >
>> > diff --git a/mercurial/commands.py b/mercurial/commands.py
>> > --- a/mercurial/commands.py
>> > +++ b/mercurial/commands.py
>> > @@ -3252,7 +3252,7 @@ statemod.addunfinished(
>> >     b'grep',
>> >     [
>> >         (b'0', b'print0', None, _(b'end fields with NUL')),
>> > -        (b'', b'all', None, _(b'print all revisions that match
>> (DEPRECATED) ')),
>> > +        (b'', b'all', None, _(b'an alias to --diff (DEPRECATED)')),
>> >         (
>> >             b'',
>> >             b'diff',
>> > _______________________________________________
>> > Mercurial-devel mailing list
>> > Mercurial-devel@mercurial-scm.org
>> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>>
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel@mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>>
>
Yuya Nishihara - Sept. 18, 2020, 10 a.m.
On Thu, 17 Sep 2020 19:13:19 -0700, Gregory Szorc wrote:
> Nevermind: looks like https://phab.mercurial-scm.org/D9030 fixes this. I
> have this in my local queue and will push shortly.

Apparently my stable patch wasn't queued yet. Pulkit?

https://patchwork.mercurial-scm.org/patch/47148/

I'm not against D9030, but b'None' instead of binary node id feels a bit
weird.
Pulkit Goyal - Sept. 18, 2020, 11:05 a.m.
On Fri, Sep 18, 2020 at 3:30 PM Yuya Nishihara <yuya@tcha.org> wrote:
>
> On Thu, 17 Sep 2020 19:13:19 -0700, Gregory Szorc wrote:
> > Nevermind: looks like https://phab.mercurial-scm.org/D9030 fixes this. I
> > have this in my local queue and will push shortly.
>
> Apparently my stable patch wasn't queued yet. Pulkit?

Oops, looks like somehow I missed queuing it. Pushed now. Sorry about that.
>
> https://patchwork.mercurial-scm.org/patch/47148/
>
> I'm not against D9030, but b'None' instead of binary node id feels a bit
> weird.

Patch

--- /home/gps/src/hg-committed/tests/test-grep.t
+++ /home/gps/src/hg-committed/tests/test-grep.t.err
@@ -995,8 +995,63 @@ 
   $ hg grep --diff -fr'wdir()' data
   add0-cp4-mod4:2147483647:+:data4
   add0-mod4:2147483647:+:data4
-  add0-rm4:2147483647:-:abort: add0-rm4@None: not found in manifest!
-  [255]
+  add0-rm4:2147483647:-:** unknown exception encountered, please report by
visiting
+  ** https://mercurial-scm.org/wiki/BugTracker
+  ** Python 3.8.5 (default, Aug  2 2020, 08:56:32) [GCC 9.3.0]
+  ** Mercurial Distributed SCM (version 5.5.1+276-63eb1b5c580d)
+  ** Extensions loaded:
+  Traceback (most recent call last):
+    File "/home/gps/src/hg-committed/mercurial/context.py", line 271, in
_fileinfo
+      return self._manifest.find(path)
+    File "/home/gps/src/hg-committed/mercurial/manifest.py", line 480, in
find
+      return self._lm[key]
+  KeyError: 'No such manifest entry.'
+
+  During handling of the above exception, another exception occurred:
+
+  Traceback (most recent call last):
+    File "/home/gps/src/hg-committed/hg", line 43, in <module>
+      dispatch.run()
+    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 113, in
run
+      status = dispatch(req)
+    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 303, in
dispatch
+      ret = _runcatch(req) or 0
+    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 479, in
_runcatch
+      return _callcatch(ui, _runcatchfunc)
+    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 488, in
_callcatch
+      return scmutil.callcatch(ui, func)
+    File "/home/gps/src/hg-committed/mercurial/scmutil.py", line 153, in
callcatch
+      return func()
+    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 469, in
_runcatchfunc
+      return _dispatch(req)
+    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 1232, in
_dispatch
+      return runcommand(
+    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 917, in
runcommand
+      ret = _runcommand(ui, options, cmd, d)
+    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 1244, in
_runcommand
+      return cmdfunc()
+    File "/home/gps/src/hg-committed/mercurial/dispatch.py", line 1230, in
<lambda>
+      d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
+    File "/home/gps/src/hg-committed/mercurial/util.py", line 1867, in
check
+      return func(*args, **kwargs)
+    File "/home/gps/src/hg-committed/mercurial/commands.py", line 3647, in
grep
+      r = display(fm, fn, ctx, pstates, states)
+    File "/home/gps/src/hg-committed/mercurial/commands.py", line 3535, in
display
+      if not opts.get(b'text') and binary():
+    File "/home/gps/src/hg-committed/mercurial/util.py", line 1224, in f