diff -r 6fb1d3c936d2 -r 6433da9c96a9 mercurial/commands.py --- a/mercurial/commands.py Tue Mar 15 09:51:42 2016 +0000 +++ b/mercurial/commands.py Wed Mar 23 10:50:24 2016 -0700 @@ -3029,6 +3029,7 @@ ('', 'record-parents', False, _('record parent information for the precursor')), ('r', 'rev', [], _('display markers relevant to REV')), + ('', 'index', False, _('display index of the marker')), ] + commitopts2, _('[OBSOLETED [REPLACEMENT ...]]')) def debugobsolete(ui, repo, precursor=None, *successors, **opts): @@ -3091,8 +3092,9 @@ else: markers = obsolete.getmarkers(repo) - for m in markers: - cmdutil.showmarker(ui, m) + for i, m in enumerate(markers): + ind = i if opts.get('index') else None + cmdutil.showmarker(ui, m, index=ind) @command('debugpathcomplete', [('f', 'full', None, _('complete an entire path')),