comparison mercurial/debugcommands.py @ 30524:cdd1885d0f2f

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.
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 17 Aug 2016 20:43:05 -0700
parents 625ccc95fa96
children ef1353c283e3
comparison
equal deleted inserted replaced
30523:625ccc95fa96 30524:cdd1885d0f2f
417 wrapnonlinear=dots, 417 wrapnonlinear=dots,
418 usedots=dots, 418 usedots=dots,
419 maxlinewidth=70): 419 maxlinewidth=70):
420 ui.write(line) 420 ui.write(line)
421 ui.write("\n") 421 ui.write("\n")
422
423 @command('debugdata', commands.debugrevlogopts, _('-c|-m|FILE REV'))
424 def debugdata(ui, repo, file_, rev=None, **opts):
425 """dump the contents of a data file revision"""
426 if opts.get('changelog') or opts.get('manifest') or opts.get('dir'):
427 if rev is not None:
428 raise error.CommandError('debugdata', _('invalid arguments'))
429 file_, rev = None, file_
430 elif rev is None:
431 raise error.CommandError('debugdata', _('invalid arguments'))
432 r = cmdutil.openrevlog(repo, 'debugdata', file_, opts)
433 try:
434 ui.write(r.revision(r.lookup(rev)))
435 except KeyError:
436 raise error.Abort(_('invalid revision identifier %s') % rev)