Patchwork [2,of,6] debugrevspec: add option to suppress list of computed revisions

login
register
mail settings
Submitter Yuya Nishihara
Date June 11, 2017, 5:36 a.m.
Message ID <cddc126a257e5e8bf5bd.1497159372@mimosa>
Download mbox | patch
Permalink /patch/21325/
State Accepted
Headers show

Comments

Yuya Nishihara - June 11, 2017, 5:36 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1497093263 -32400
#      Sat Jun 10 20:14:23 2017 +0900
# Node ID cddc126a257e5e8bf5bdd919012f36c05d6963dd
# Parent  cd79482b7c41c3e0bc92a4a5c8d3393f6bad7e3d
debugrevspec: add option to suppress list of computed revisions

Test will be added later.

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -1901,6 +1901,7 @@  def debugrevlog(ui, repo, file_=None, **
 @command('debugrevspec',
     [('', 'optimize', None,
       _('print parsed tree after optimizing (DEPRECATED)')),
+     ('', 'show-revs', True, _('print list of result revisions (default)')),
      ('s', 'show-set', None, _('print internal representation of result set')),
      ('p', 'show-stage', [],
       _('print parsed tree at the given stage'), _('NAME')),
@@ -1914,6 +1915,9 @@  def debugrevspec(ui, repo, expr, **opts)
     Use -p/--show-stage option to print the parsed tree at the given stages.
     Use -p all to print tree at every stage.
 
+    Use --no-show-revs option with -s or -p to print only the set
+    representation or the parsed tree respectively.
+
     Use --verify-optimized to compare the optimized result with the unoptimized
     one. Returns 1 if the optimized result differs.
     """
@@ -1989,6 +1993,8 @@  def debugrevspec(ui, repo, expr, **opts)
     revs = func(repo)
     if opts['show_set'] or (opts['show_set'] is None and ui.verbose):
         ui.write(("* set:\n"), smartset.prettyformat(revs), "\n")
+    if not opts['show_revs']:
+        return
     for c in revs:
         ui.write("%s\n" % c)
 
diff --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -281,7 +281,7 @@  Show all commands + options
   debugrebuildfncache: 
   debugrename: rev
   debugrevlog: changelog, manifest, dir, dump
-  debugrevspec: optimize, show-set, show-stage, no-optimized, verify-optimized
+  debugrevspec: optimize, show-revs, show-set, show-stage, no-optimized, verify-optimized
   debugsetparents: 
   debugsub: rev
   debugsuccessorssets: