Patchwork [2,of,2] debug: remove debugwhyunstable command

login
register
mail settings
Submitter Anton Shestakov
Date March 26, 2018, 11:55 a.m.
Message ID <cc4c495dc38d5cf3a1b7.1522065321@neuro>
Download mbox | patch
Permalink /patch/29861/
State Superseded
Headers show

Comments

Anton Shestakov - March 26, 2018, 11:55 a.m.
# HG changeset patch
# User Anton Shestakov <av6@dwimlabs.net>
# Date 1522062197 -28800
#      Mon Mar 26 19:03:17 2018 +0800
# Node ID cc4c495dc38d5cf3a1b7e1162f1c745c1440de01
# Parent  123d9e4d706909c8912f11acee292735c0fb283c
debug: remove debugwhyunstable command

It was introduced in efc4fb344c05 to test obsutil.whyunstable(), but now we
have a better alternative: whyunstable template keyword.

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -2536,17 +2536,6 @@  def debugwalk(ui, repo, *pats, **opts):
         line = fmt % (abs, f(m.rel(abs)), m.exact(abs) and 'exact' or '')
         ui.write("%s\n" % line.rstrip())
 
-@command('debugwhyunstable', [], _('REV'))
-def debugwhyunstable(ui, repo, rev):
-    """explain instabilities of a changeset"""
-    for entry in obsutil.whyunstable(repo, repo[rev]):
-        dnodes = ''
-        if entry.get('divergentnodes'):
-            dnodes = ' '.join('%s (%s)' % (ctx.hex(), ctx.phasestr())
-                              for ctx in entry['divergentnodes']) + ' '
-        ui.write('%s: %s%s %s\n' % (entry['instability'], dnodes,
-                                    entry['reason'], entry['node']))
-
 @command('debugwireargs',
     [('', 'three', '', 'three'),
     ('', 'four', '', 'four'),
diff --git a/tests/test-completion.t b/tests/test-completion.t
--- a/tests/test-completion.t
+++ b/tests/test-completion.t
@@ -122,7 +122,6 @@  Show debug commands if there are no othe
   debugupdatecaches
   debugupgraderepo
   debugwalk
-  debugwhyunstable
   debugwireargs
   debugwireproto
 
@@ -307,7 +306,6 @@  Show all commands + options
   debugupdatecaches: 
   debugupgraderepo: optimize, run
   debugwalk: include, exclude
-  debugwhyunstable: 
   debugwireargs: three, four, five, ssh, remotecmd, insecure
   debugwireproto: localssh, peer, noreadstderr, ssh, remotecmd, insecure
   files: rev, print0, include, exclude, template, subrepos
diff --git a/tests/test-help.t b/tests/test-help.t
--- a/tests/test-help.t
+++ b/tests/test-help.t
@@ -997,8 +997,6 @@  Test list of internal help commands
    debugupgraderepo
                  upgrade a repository to use different features
    debugwalk     show how files match on given patterns
-   debugwhyunstable
-                 explain instabilities of a changeset
    debugwireargs
                  (no help text available)
    debugwireproto
diff --git a/tests/test-obsolete-divergent.t b/tests/test-obsolete-divergent.t
--- a/tests/test-obsolete-divergent.t
+++ b/tests/test-obsolete-divergent.t
@@ -718,9 +718,6 @@  Use scmutil.cleanupnodes API to create d
   a178212c3433c4e77b573f6011e29affb8aefa33 ad6478fb94ecec98b86daae98722865d494ac561 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'test', 'user': 'test'}
   ad6478fb94ecec98b86daae98722865d494ac561 70d5a63ca112acb3764bc1d7320ca90ea688d671 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'test', 'user': 'test'}
 
-  $ hg debugwhyunstable 1a2a9b5b0030
-  content-divergent: 70d5a63ca112acb3764bc1d7320ca90ea688d671 (draft) predecessor a178212c3433c4e77b573f6011e29affb8aefa33
-
   $ hg log -r 1a2a9b5b0030 --hidden -T '{whyunstable}\n'
   content-divergent: 4:70d5a63ca112 (draft) predecessor 2:a178212c3433
   $ hg log -r 1a2a9b5b0030 --hidden -T '{whyunstable%"{instability}: {divergentnodes} {reason} {node}\n"}'
diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
--- a/tests/test-obsolete.t
+++ b/tests/test-obsolete.t
@@ -1033,12 +1033,6 @@  test summary output
   orphan: 2 changesets
   phase-divergent: 1 changesets
 
-test debugwhyunstable output
-
-  $ hg debugwhyunstable 50c51b361e60
-  orphan: obsolete parent 3de5eca88c00aa039da7399a220f4a5221faa585
-  phase-divergent: immutable predecessor 245bde4270cd1072a27757984f9cda8ba26f08ca
-
 test whyunstable template keyword
 
   $ hg log -r 50c51b361e60 -T '{whyunstable}\n'