comparison mercurial/commands.py @ 28613:6433da9c96a9

debugobsolete: add an option to show marker index A bigger picture is the ability to be delete an arbitrary marker form the repo's obsstore. This is a useful debug ability and it needs a way to indentify the marker one wants to delete. Having a marker's index provides such an ability.
author Kostia Balytskyi <ikostia@fb.com>
date Wed, 23 Mar 2016 10:50:24 -0700
parents b7a31068cc80
children d6f8a1535224
comparison
equal deleted inserted replaced
28612:6fb1d3c936d2 28613:6433da9c96a9
3027 @command('debugobsolete', 3027 @command('debugobsolete',
3028 [('', 'flags', 0, _('markers flag')), 3028 [('', 'flags', 0, _('markers flag')),
3029 ('', 'record-parents', False, 3029 ('', 'record-parents', False,
3030 _('record parent information for the precursor')), 3030 _('record parent information for the precursor')),
3031 ('r', 'rev', [], _('display markers relevant to REV')), 3031 ('r', 'rev', [], _('display markers relevant to REV')),
3032 ('', 'index', False, _('display index of the marker')),
3032 ] + commitopts2, 3033 ] + commitopts2,
3033 _('[OBSOLETED [REPLACEMENT ...]]')) 3034 _('[OBSOLETED [REPLACEMENT ...]]'))
3034 def debugobsolete(ui, repo, precursor=None, *successors, **opts): 3035 def debugobsolete(ui, repo, precursor=None, *successors, **opts):
3035 """create arbitrary obsolete marker 3036 """create arbitrary obsolete marker
3036 3037
3089 markers = list(obsolete.getmarkers(repo, nodes=nodes)) 3090 markers = list(obsolete.getmarkers(repo, nodes=nodes))
3090 markers.sort(key=lambda x: x._data) 3091 markers.sort(key=lambda x: x._data)
3091 else: 3092 else:
3092 markers = obsolete.getmarkers(repo) 3093 markers = obsolete.getmarkers(repo)
3093 3094
3094 for m in markers: 3095 for i, m in enumerate(markers):
3095 cmdutil.showmarker(ui, m) 3096 ind = i if opts.get('index') else None
3097 cmdutil.showmarker(ui, m, index=ind)
3096 3098
3097 @command('debugpathcomplete', 3099 @command('debugpathcomplete',
3098 [('f', 'full', None, _('complete an entire path')), 3100 [('f', 'full', None, _('complete an entire path')),
3099 ('n', 'normal', None, _('show only normal files')), 3101 ('n', 'normal', None, _('show only normal files')),
3100 ('a', 'added', None, _('show only added files')), 3102 ('a', 'added', None, _('show only added files')),