mercurial/debugcommands.py
changeset 50943 4135e7271b9e
parent 50942 ad9b7017ca22
child 50944 32fe4af9971d
equal deleted inserted replaced
50942:ad9b7017ca22 50943:4135e7271b9e
   707 
   707 
   708 
   708 
   709 @command(b'debugdata', cmdutil.debugrevlogopts, _(b'-c|-m|FILE REV'))
   709 @command(b'debugdata', cmdutil.debugrevlogopts, _(b'-c|-m|FILE REV'))
   710 def debugdata(ui, repo, file_, rev=None, **opts):
   710 def debugdata(ui, repo, file_, rev=None, **opts):
   711     """dump the contents of a data file revision"""
   711     """dump the contents of a data file revision"""
   712     opts = pycompat.byteskwargs(opts)
   712     if opts.get('changelog') or opts.get('manifest') or opts.get('dir'):
   713     if opts.get(b'changelog') or opts.get(b'manifest') or opts.get(b'dir'):
       
   714         if rev is not None:
   713         if rev is not None:
   715             raise error.InputError(
   714             raise error.InputError(
   716                 _(b'cannot specify a revision with other arguments')
   715                 _(b'cannot specify a revision with other arguments')
   717             )
   716             )
   718         file_, rev = None, file_
   717         file_, rev = None, file_
   719     elif rev is None:
   718     elif rev is None:
   720         raise error.InputError(_(b'please specify a revision'))
   719         raise error.InputError(_(b'please specify a revision'))
   721     r = cmdutil.openstorage(repo, b'debugdata', file_, opts)
   720     r = cmdutil.openstorage(
       
   721         repo, b'debugdata', file_, pycompat.byteskwargs(opts)
       
   722     )
   722     try:
   723     try:
   723         ui.write(r.rawdata(r.lookup(rev)))
   724         ui.write(r.rawdata(r.lookup(rev)))
   724     except KeyError:
   725     except KeyError:
   725         raise error.Abort(_(b'invalid revision identifier %s') % rev)
   726         raise error.Abort(_(b'invalid revision identifier %s') % rev)
   726 
   727