##// END OF EJS Templates
exchange: extract bundle specification components into own attributes...
Gregory Szorc -
r26647:62b0fa0d default
parent child Browse files
Show More
@@ -1603,7 +1603,7 b' def _maybeapplyclonebundle(pullop):'
1603 return
1603 return
1604
1604
1605 res = remote._call('clonebundles')
1605 res = remote._call('clonebundles')
1606 entries = parseclonebundlesmanifest(res)
1606 entries = parseclonebundlesmanifest(repo, res)
1607 if not entries:
1607 if not entries:
1608 repo.ui.note(_('no clone bundles available on remote; '
1608 repo.ui.note(_('no clone bundles available on remote; '
1609 'falling back to regular clone\n'))
1609 'falling back to regular clone\n'))
@@ -1640,7 +1640,7 b' def _maybeapplyclonebundle(pullop):'
1640 hint=_('consider contacting the server '
1640 hint=_('consider contacting the server '
1641 'operator if this error persists'))
1641 'operator if this error persists'))
1642
1642
1643 def parseclonebundlesmanifest(s):
1643 def parseclonebundlesmanifest(repo, s):
1644 """Parses the raw text of a clone bundles manifest.
1644 """Parses the raw text of a clone bundles manifest.
1645
1645
1646 Returns a list of dicts. The dicts have a ``URL`` key corresponding
1646 Returns a list of dicts. The dicts have a ``URL`` key corresponding
@@ -1654,7 +1654,23 b' def parseclonebundlesmanifest(s):'
1654 attrs = {'URL': fields[0]}
1654 attrs = {'URL': fields[0]}
1655 for rawattr in fields[1:]:
1655 for rawattr in fields[1:]:
1656 key, value = rawattr.split('=', 1)
1656 key, value = rawattr.split('=', 1)
1657 attrs[urllib.unquote(key)] = urllib.unquote(value)
1657 key = urllib.unquote(key)
1658 value = urllib.unquote(value)
1659 attrs[key] = value
1660
1661 # Parse BUNDLESPEC into components. This makes client-side
1662 # preferences easier to specify since you can prefer a single
1663 # component of the BUNDLESPEC.
1664 if key == 'BUNDLESPEC':
1665 try:
1666 comp, version = parsebundlespec(repo, value,
1667 externalnames=True)
1668 attrs['COMPRESSION'] = comp
1669 attrs['VERSION'] = version
1670 except error.InvalidBundleSpecification:
1671 pass
1672 except error.UnsupportedBundleSpecification:
1673 pass
1658
1674
1659 m.append(attrs)
1675 m.append(attrs)
1660
1676
General Comments 0
You need to be logged in to leave comments. Login now