[PATCH 5 of 6] debugcommands: move 'debugrename' in the new module

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Feb 14 13:36:22 EST 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1486026114 -3600
#      Thu Feb 02 10:01:54 2017 +0100
# Node ID 63c9196e60144b261decc768ad13958dfd15fd4e
# Parent  025413c767a6f1b396820be4eaebf85823b97dda
# EXP-Topic debugcommands
debugcommands: move 'debugrename' in the new module

diff -r 025413c767a6 -r 63c9196e6014 mercurial/commands.py
--- a/mercurial/commands.py	Thu Feb 02 10:01:00 2017 +0100
+++ b/mercurial/commands.py	Thu Feb 02 10:01:54 2017 +0100
@@ -1858,23 +1858,6 @@ def copy(ui, repo, *pats, **opts):
     with repo.wlock(False):
         return cmdutil.copy(ui, repo, pats, opts)
 
- at command('debugrename',
-    [('r', 'rev', '', _('revision to debug'), _('REV'))],
-    _('[-r REV] FILE'))
-def debugrename(ui, repo, file1, *pats, **opts):
-    """dump rename information"""
-
-    ctx = scmutil.revsingle(repo, opts.get('rev'))
-    m = scmutil.match(ctx, (file1,) + pats, opts)
-    for abs in ctx.walk(m):
-        fctx = ctx[abs]
-        o = fctx.filelog().renamed(fctx.filenode())
-        rel = m.rel(abs)
-        if o:
-            ui.write(_("%s renamed from %s:%s\n") % (rel, o[0], hex(o[1])))
-        else:
-            ui.write(_("%s not renamed\n") % rel)
-
 @command('debugrevlog', debugrevlogopts +
     [('d', 'dump', False, _('dump index data'))],
     _('-c|-m|FILE'),
diff -r 025413c767a6 -r 63c9196e6014 mercurial/debugcommands.py
--- a/mercurial/debugcommands.py	Thu Feb 02 10:01:00 2017 +0100
+++ b/mercurial/debugcommands.py	Thu Feb 02 10:01:54 2017 +0100
@@ -1500,6 +1500,23 @@ def debugrebuildfncache(ui, repo):
     """rebuild the fncache file"""
     repair.rebuildfncache(ui, repo)
 
+ at command('debugrename',
+    [('r', 'rev', '', _('revision to debug'), _('REV'))],
+    _('[-r REV] FILE'))
+def debugrename(ui, repo, file1, *pats, **opts):
+    """dump rename information"""
+
+    ctx = scmutil.revsingle(repo, opts.get('rev'))
+    m = scmutil.match(ctx, (file1,) + pats, opts)
+    for abs in ctx.walk(m):
+        fctx = ctx[abs]
+        o = fctx.filelog().renamed(fctx.filenode())
+        rel = m.rel(abs)
+        if o:
+            ui.write(_("%s renamed from %s:%s\n") % (rel, o[0], hex(o[1])))
+        else:
+            ui.write(_("%s not renamed\n") % rel)
+
 @command('debugupgraderepo', [
     ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')),
     ('', 'run', False, _('performs an upgrade')),


More information about the Mercurial-devel mailing list