Patchwork [5,of,8,STABLE] debugrevlog: fix commandline argument handling

login
register
mail settings
Submitter timeless@mozdev.org
Date Feb. 1, 2016, 7:29 a.m.
Message ID <c73d43cffa2887c9f0d3.1454311756@waste.org>
Download mbox | patch
Permalink /patch/12918/
State Changes Requested
Headers show

Comments

timeless@mozdev.org - Feb. 1, 2016, 7:29 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1454273522 0
#      Sun Jan 31 20:52:02 2016 +0000
# Branch stable
# Node ID c73d43cffa2887c9f0d3e6f3572f833626a92d68
# Parent  cf775b5fa387784ad4468a9bb1fb60a554a7977e
debugrevlog: fix commandline argument handling
Pierre-Yves David - Feb. 1, 2016, 12:20 p.m.
On 02/01/2016 07:29 AM, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1454273522 0
> #      Sun Jan 31 20:52:02 2016 +0000
> # Branch stable
> # Node ID c73d43cffa2887c9f0d3e6f3572f833626a92d68
> # Parent  cf775b5fa387784ad4468a9bb1fb60a554a7977e
> debugrevlog: fix commandline argument handling

What was broken ?

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -507,8 +507,8 @@ 
             filelog = repo.file(file_)
             if len(filelog):
                 r = filelog
-    if not r:
-        if not file_:
+    if r is None:
+        if not any([cl, mf, file_]):
             raise error.CommandError(cmd, _('invalid arguments'))
         if not os.path.isfile(file_):
             raise error.Abort(_("revlog '%s' not found") % file_)
diff --git a/tests/test-debugcommands.t b/tests/test-debugcommands.t
--- a/tests/test-debugcommands.t
+++ b/tests/test-debugcommands.t
@@ -20,7 +20,13 @@ 
   
   (use "hg debugrevlog -h" to show more help)
   [255]
+  $ hg debugrevlog -c -d
+  # rev p1rev p2rev start   end deltastart base   p1   p2 rawsize totalsize compression heads chainlen
+  $ hg debugrevlog -m -d
+  # rev p1rev p2rev start   end deltastart base   p1   p2 rawsize totalsize compression heads chainlen
   $ hg commit --config ui.allowemptycommit=True -m 'empty'
+  $ hg debugrevlog -m -d
+  # rev p1rev p2rev start   end deltastart base   p1   p2 rawsize totalsize compression heads chainlen
   $ hg debugrevlog -c -d
   # rev p1rev p2rev start   end deltastart base   p1   p2 rawsize totalsize compression heads chainlen
       0    -1    -1     0    28          0    0    0    0      56        56           2     1        0