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

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 14, 2017, 6:36 p.m.
Message ID <63c9196e60144b261dec.1487097382@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/18484/
State Accepted
Headers show

Comments

Pierre-Yves David - Feb. 14, 2017, 6:36 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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

Patch

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)
 
-@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)
 
+@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')),