Mercurial > public > mercurial-scm > hg
comparison mercurial/debugcommands.py @ 41690:ea72da71ad69
debugrename: don't require at least one path
I don't see a reason that it needs to require a path. Most commands
match everything when no paths are given, but here you have to do
something like `hg debugrename -r . .` (from the repo root) to match
everything.
Differential Revision: https://phab.mercurial-scm.org/D5948
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 12 Feb 2019 13:42:42 -0800 |
parents | 34ae00a14783 |
children | 09814946cc6a |
comparison
equal
deleted
inserted
replaced
41689:f63ba0b9d06f | 41690:ea72da71ad69 |
---|---|
2008 """rebuild the fncache file""" | 2008 """rebuild the fncache file""" |
2009 repair.rebuildfncache(ui, repo) | 2009 repair.rebuildfncache(ui, repo) |
2010 | 2010 |
2011 @command('debugrename', | 2011 @command('debugrename', |
2012 [('r', 'rev', '', _('revision to debug'), _('REV'))], | 2012 [('r', 'rev', '', _('revision to debug'), _('REV'))], |
2013 _('[-r REV] FILE')) | 2013 _('[-r REV] [FILE]...')) |
2014 def debugrename(ui, repo, file1, *pats, **opts): | 2014 def debugrename(ui, repo, *pats, **opts): |
2015 """dump rename information""" | 2015 """dump rename information""" |
2016 | 2016 |
2017 opts = pycompat.byteskwargs(opts) | 2017 opts = pycompat.byteskwargs(opts) |
2018 ctx = scmutil.revsingle(repo, opts.get('rev')) | 2018 ctx = scmutil.revsingle(repo, opts.get('rev')) |
2019 m = scmutil.match(ctx, (file1,) + pats, opts) | 2019 m = scmutil.match(ctx, pats, opts) |
2020 for abs in ctx.walk(m): | 2020 for abs in ctx.walk(m): |
2021 fctx = ctx[abs] | 2021 fctx = ctx[abs] |
2022 o = fctx.filelog().renamed(fctx.filenode()) | 2022 o = fctx.filelog().renamed(fctx.filenode()) |
2023 rel = repo.pathto(abs) | 2023 rel = repo.pathto(abs) |
2024 if o: | 2024 if o: |