# HG changeset patch # User Gregory Szorc # Date 1471491785 25200 # Node ID cdd1885d0f2ff43e948f4a64935e1cb3d50c8220 # Parent 625ccc95fa96b2583aa62c2942ec0a7befc4f57c 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. diff -r 625ccc95fa96 -r cdd1885d0f2f mercurial/commands.py --- a/mercurial/commands.py Wed Aug 17 20:41:54 2016 -0700 +++ b/mercurial/commands.py Wed Aug 17 20:43:05 2016 -0700 @@ -1865,21 +1865,6 @@ 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]'), diff -r 625ccc95fa96 -r cdd1885d0f2f mercurial/debugcommands.py --- a/mercurial/debugcommands.py Wed Aug 17 20:41:54 2016 -0700 +++ b/mercurial/debugcommands.py Wed Aug 17 20:43:05 2016 -0700 @@ -419,3 +419,18 @@ 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)