changeset 30950:7236f949ce3f

debugcommands: move 'debugrename' in the new module
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Thu, 02 Feb 2017 10:01:54 +0100
parents e7d7335819f4
children f44b96aef81b
files mercurial/commands.py mercurial/debugcommands.py
diffstat 2 files changed, 17 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
     with repo.wlock(False):
         return cmdutil.copy(ui, repo, pats, opts)
 
-@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'),
--- 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 @@
     """rebuild the fncache file"""
     repair.rebuildfncache(ui, repo)
 
+@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')),