mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
bundle2: add a obsmarkersversion
function to extract supported version
Right next to the function that encodes the supported versions in capabilities we add a function that decodes the versions out of capabilities. This is going to be useful to know what formats can be used for exchange.
This commit is contained in:
parent
661ba0c427
commit
e2072df9be
@ -146,6 +146,7 @@ import util
|
||||
import struct
|
||||
import urllib
|
||||
import string
|
||||
import obsolete
|
||||
import pushkey
|
||||
|
||||
import changegroup, error
|
||||
@ -800,6 +801,12 @@ def bundle2caps(remote):
|
||||
capsblob = urllib.unquote(remote.capable('bundle2-exp'))
|
||||
return decodecaps(capsblob)
|
||||
|
||||
def obsmarkersversion(caps):
|
||||
"""extract the list of supported obsmarkers versions from a bundle2caps dict
|
||||
"""
|
||||
obscaps = caps.get('b2x:obsmarkers', ())
|
||||
return [int(c[1:]) for c in obscaps if c.startswith('V')]
|
||||
|
||||
@parthandler('b2x:changegroup')
|
||||
def handlechangegroup(op, inpart):
|
||||
"""apply a changegroup part on the repo
|
||||
|
Loading…
Reference in New Issue
Block a user