##// END OF EJS Templates
exchange: add a `buildobsmarkerpart` function...
Pierre-Yves David -
r22346:a76660f8 default
parent child Browse files
Show More
@@ -37,6 +37,20 b' def readbundle(ui, fh, fname, vfs=None):'
37 else:
37 else:
38 raise util.Abort(_('%s: unknown bundle version %s') % (fname, version))
38 raise util.Abort(_('%s: unknown bundle version %s') % (fname, version))
39
39
40 def buildobsmarkerspart(bundler, markers):
41 """add an obsmarker part to the bundler with <markers>
42
43 No part is created if markers is empty.
44 Raises ValueError if the bundler doesn't support any known obsmarker format.
45 """
46 if markers:
47 remoteversions = bundle2.obsmarkersversion(bundler.capabilities)
48 version = obsolete.commonversion(remoteversions)
49 if version is None:
50 raise ValueError('bundler do not support common obsmarker format')
51 stream = obsolete.encodemarkers(markers, True, version=version)
52 return bundler.newpart('B2X:OBSMARKERS', data=stream)
53 return None
40
54
41 class pushoperation(object):
55 class pushoperation(object):
42 """A object that represent a single push operation
56 """A object that represent a single push operation
General Comments 0
You need to be logged in to leave comments. Login now