##// END OF EJS Templates
debugbundle: display the content of obsmarkers parts...
marmoute -
r32517:b62b2b37 default
parent child Browse files
Show More
@@ -288,6 +288,27 b' def _debugchangegroup(ui, gen, all=None,'
288 ui.write("%s%s\n" % (indent_string, hex(node)))
288 ui.write("%s%s\n" % (indent_string, hex(node)))
289 chain = node
289 chain = node
290
290
291 def _debugobsmarkers(ui, data, all=None, indent=0, **opts):
292 """display version and markers contained in 'data'"""
293 indent_string = ' ' * indent
294 try:
295 version, markers = obsolete._readmarkers(data)
296 except error.UnknownVersion as exc:
297 msg = "%sunsupported version: %s (%d bytes)\n"
298 msg %= indent_string, exc.version, len(data)
299 ui.write(msg)
300 else:
301 msg = "%sversion: %s (%d bytes)\n"
302 msg %= indent_string, version, len(data)
303 ui.write(msg)
304 fm = ui.formatter('debugobsolete', opts)
305 for rawmarker in sorted(markers):
306 m = obsolete.marker(None, rawmarker)
307 fm.startitem()
308 fm.plain(indent_string)
309 cmdutil.showmarker(fm, m)
310 fm.end()
311
291 def _debugbundle2(ui, gen, all=None, **opts):
312 def _debugbundle2(ui, gen, all=None, **opts):
292 """lists the contents of a bundle2"""
313 """lists the contents of a bundle2"""
293 if not isinstance(gen, bundle2.unbundle20):
314 if not isinstance(gen, bundle2.unbundle20):
@@ -299,6 +320,8 b' def _debugbundle2(ui, gen, all=None, **o'
299 version = part.params.get('version', '01')
320 version = part.params.get('version', '01')
300 cg = changegroup.getunbundler(version, part, 'UN')
321 cg = changegroup.getunbundler(version, part, 'UN')
301 _debugchangegroup(ui, cg, all=all, indent=4, **opts)
322 _debugchangegroup(ui, cg, all=all, indent=4, **opts)
323 if part.type == 'obsmarkers':
324 _debugobsmarkers(ui, part.read(), all=all, indent=4, **opts)
302
325
303 @command('debugbundle',
326 @command('debugbundle',
304 [('a', 'all', None, _('show all details')),
327 [('a', 'all', None, _('show all details')),
@@ -97,6 +97,8 b' check-that bundle can contain markers:'
97 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
97 changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])"
98 f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
98 f89bcc95eba5174b1ccc3e33a82e84c96e8338ee
99 obsmarkers -- 'sortdict()'
99 obsmarkers -- 'sortdict()'
100 version: 1 (70 bytes)
101 9d73aac1b2ed7d53835eaeec212ed41ea47da53a f89bcc95eba5174b1ccc3e33a82e84c96e8338ee 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
100
102
101 $ cd ..
103 $ cd ..
102
104
General Comments 0
You need to be logged in to leave comments. Login now