mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 16:31:02 +03:00
debugcommands: move 'debugrevlogopts' into the new module
This move contains the first reference to debugrevlogopts in debugcommands.py. We'll eventually want to move that over. We hold off for now because it would introduce a module import cycle.
This commit is contained in:
parent
2ba0f93ffa
commit
cf8519801e
@ -1865,21 +1865,6 @@ def copy(ui, repo, *pats, **opts):
|
||||
with repo.wlock(False):
|
||||
return cmdutil.copy(ui, repo, pats, opts)
|
||||
|
||||
@command('debugdata', debugrevlogopts, _('-c|-m|FILE REV'))
|
||||
def debugdata(ui, repo, file_, rev=None, **opts):
|
||||
"""dump the contents of a data file revision"""
|
||||
if opts.get('changelog') or opts.get('manifest') or opts.get('dir'):
|
||||
if rev is not None:
|
||||
raise error.CommandError('debugdata', _('invalid arguments'))
|
||||
file_, rev = None, file_
|
||||
elif rev is None:
|
||||
raise error.CommandError('debugdata', _('invalid arguments'))
|
||||
r = cmdutil.openrevlog(repo, 'debugdata', file_, opts)
|
||||
try:
|
||||
ui.write(r.revision(r.lookup(rev)))
|
||||
except KeyError:
|
||||
raise error.Abort(_('invalid revision identifier %s') % rev)
|
||||
|
||||
@command('debugdate',
|
||||
[('e', 'extended', None, _('try extended date formats'))],
|
||||
_('[-e] DATE [RANGE]'),
|
||||
|
@ -419,3 +419,18 @@ def debugdag(ui, repo, file_=None, *revs, **opts):
|
||||
maxlinewidth=70):
|
||||
ui.write(line)
|
||||
ui.write("\n")
|
||||
|
||||
@command('debugdata', commands.debugrevlogopts, _('-c|-m|FILE REV'))
|
||||
def debugdata(ui, repo, file_, rev=None, **opts):
|
||||
"""dump the contents of a data file revision"""
|
||||
if opts.get('changelog') or opts.get('manifest') or opts.get('dir'):
|
||||
if rev is not None:
|
||||
raise error.CommandError('debugdata', _('invalid arguments'))
|
||||
file_, rev = None, file_
|
||||
elif rev is None:
|
||||
raise error.CommandError('debugdata', _('invalid arguments'))
|
||||
r = cmdutil.openrevlog(repo, 'debugdata', file_, opts)
|
||||
try:
|
||||
ui.write(r.revision(r.lookup(rev)))
|
||||
except KeyError:
|
||||
raise error.Abort(_('invalid revision identifier %s') % rev)
|
||||
|
Loading…
Reference in New Issue
Block a user