##// END OF EJS Templates
debugobsolete: add an option to show marker index...
Kostia Balytskyi -
r28613:6433da9c default
parent child Browse files
Show More
@@ -1597,10 +1597,12 b' def show_changeset(ui, repo, opts, buffe'
1597 raise error.Abort(inst.args[0])
1597 raise error.Abort(inst.args[0])
1598 return t
1598 return t
1599
1599
1600 def showmarker(ui, marker):
1600 def showmarker(ui, marker, index=None):
1601 """utility function to display obsolescence marker in a readable way
1601 """utility function to display obsolescence marker in a readable way
1602
1602
1603 To be used by debug function."""
1603 To be used by debug function."""
1604 if index is not None:
1605 ui.write("%i " % index)
1604 ui.write(hex(marker.precnode()))
1606 ui.write(hex(marker.precnode()))
1605 for repl in marker.succnodes():
1607 for repl in marker.succnodes():
1606 ui.write(' ')
1608 ui.write(' ')
@@ -3029,6 +3029,7 b' def debuglocks(ui, repo, **opts):'
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):
@@ -3091,8 +3092,9 b' def debugobsolete(ui, repo, precursor=No'
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')),
@@ -261,7 +261,7 b' Show all commands + options'
261 debuglocks: force-lock, force-wlock
261 debuglocks: force-lock, force-wlock
262 debugmergestate:
262 debugmergestate:
263 debugnamecomplete:
263 debugnamecomplete:
264 debugobsolete: flags, record-parents, rev, date, user
264 debugobsolete: flags, record-parents, rev, index, date, user
265 debugpathcomplete: full, normal, added, removed
265 debugpathcomplete: full, normal, added, removed
266 debugpushkey:
266 debugpushkey:
267 debugpvec:
267 debugpvec:
@@ -129,6 +129,13 b' Register two markers with a missing node'
129 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
129 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
130 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
130 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
131
131
132 Test the --index option of debugobsolete command
133 $ hg debugobsolete --index
134 0 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
135 1 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
136 2 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
137 3 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
138
132 Refuse pathological nullid successors
139 Refuse pathological nullid successors
133 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
140 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
134 transaction abort!
141 transaction abort!
General Comments 0
You need to be logged in to leave comments. Login now