Mercurial > hg
comparison mercurial/debugcommands.py @ 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 |
comparison
equal
deleted
inserted
replaced
30949:e7d7335819f4 | 30950:7236f949ce3f |
---|---|
1498 @command('debugrebuildfncache', [], '') | 1498 @command('debugrebuildfncache', [], '') |
1499 def debugrebuildfncache(ui, repo): | 1499 def debugrebuildfncache(ui, repo): |
1500 """rebuild the fncache file""" | 1500 """rebuild the fncache file""" |
1501 repair.rebuildfncache(ui, repo) | 1501 repair.rebuildfncache(ui, repo) |
1502 | 1502 |
1503 @command('debugrename', | |
1504 [('r', 'rev', '', _('revision to debug'), _('REV'))], | |
1505 _('[-r REV] FILE')) | |
1506 def debugrename(ui, repo, file1, *pats, **opts): | |
1507 """dump rename information""" | |
1508 | |
1509 ctx = scmutil.revsingle(repo, opts.get('rev')) | |
1510 m = scmutil.match(ctx, (file1,) + pats, opts) | |
1511 for abs in ctx.walk(m): | |
1512 fctx = ctx[abs] | |
1513 o = fctx.filelog().renamed(fctx.filenode()) | |
1514 rel = m.rel(abs) | |
1515 if o: | |
1516 ui.write(_("%s renamed from %s:%s\n") % (rel, o[0], hex(o[1]))) | |
1517 else: | |
1518 ui.write(_("%s not renamed\n") % rel) | |
1519 | |
1503 @command('debugupgraderepo', [ | 1520 @command('debugupgraderepo', [ |
1504 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')), | 1521 ('o', 'optimize', [], _('extra optimization to perform'), _('NAME')), |
1505 ('', 'run', False, _('performs an upgrade')), | 1522 ('', 'run', False, _('performs an upgrade')), |
1506 ]) | 1523 ]) |
1507 def debugupgraderepo(ui, repo, run=False, optimize=None): | 1524 def debugupgraderepo(ui, repo, run=False, optimize=None): |