comparison mercurial/commands.py @ 29427:33a6b750b5b9

debug: make debug{revlog,index,data} --dir not just a flag The directory argument (for tree manifests) should belong to to the --dir argument. I had mistakenly made --dir a flag. One effect of this was that I had meant for "-m" to be optional, but instead it changed the behavior of --dir, so with "hg debugdata -m --dir dir1 0", the -m took over and the "dir1" got treated as a revision in the root manifest log.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 24 Jun 2016 11:12:41 -0700
parents 26ac04a39e11
children 9c3786713926
comparison
equal deleted inserted replaced
29426:26ac04a39e11 29427:33a6b750b5b9
214 ] 214 ]
215 215
216 debugrevlogopts = [ 216 debugrevlogopts = [
217 ('c', 'changelog', False, _('open changelog')), 217 ('c', 'changelog', False, _('open changelog')),
218 ('m', 'manifest', False, _('open manifest')), 218 ('m', 'manifest', False, _('open manifest')),
219 ('', 'dir', False, _('open directory manifest')), 219 ('', 'dir', '', _('open directory manifest')),
220 ] 220 ]
221 221
222 # Commands start here, listed alphabetically 222 # Commands start here, listed alphabetically
223 223
224 @command('^add', 224 @command('^add',
2297 ui.write("\n") 2297 ui.write("\n")
2298 2298
2299 @command('debugdata', debugrevlogopts, _('-c|-m|FILE REV')) 2299 @command('debugdata', debugrevlogopts, _('-c|-m|FILE REV'))
2300 def debugdata(ui, repo, file_, rev=None, **opts): 2300 def debugdata(ui, repo, file_, rev=None, **opts):
2301 """dump the contents of a data file revision""" 2301 """dump the contents of a data file revision"""
2302 if opts.get('changelog') or opts.get('manifest'): 2302 if opts.get('changelog') or opts.get('manifest') or opts.get('dir'):
2303 if rev is not None: 2303 if rev is not None:
2304 raise error.CommandError('debugdata', _('invalid arguments')) 2304 raise error.CommandError('debugdata', _('invalid arguments'))
2305 file_, rev = None, file_ 2305 file_, rev = None, file_
2306 elif rev is None: 2306 elif rev is None:
2307 raise error.CommandError('debugdata', _('invalid arguments')) 2307 raise error.CommandError('debugdata', _('invalid arguments'))