##// END OF EJS Templates
exchange: expose bundle2 capabilities on pulloperation...
Gregory Szorc -
r26464:9a7fc6d4 default
parent child Browse files
Show More
@@ -893,6 +893,10 b' class pulloperation(object):'
893 # sync on this subset
893 # sync on this subset
894 return self.heads
894 return self.heads
895
895
896 @util.propertycache
897 def remotebundle2caps(self):
898 return bundle2.bundle2caps(self.remote)
899
896 def gettransaction(self):
900 def gettransaction(self):
897 # deprecated; talk to trmanager directly
901 # deprecated; talk to trmanager directly
898 return self.trmanager.transaction()
902 return self.trmanager.transaction()
@@ -1017,8 +1021,7 b' def _pullbookmarkbundle1(pullop):'
1017 discovery to reduce the chance and impact of race conditions."""
1021 discovery to reduce the chance and impact of race conditions."""
1018 if pullop.remotebookmarks is not None:
1022 if pullop.remotebookmarks is not None:
1019 return
1023 return
1020 if (_canusebundle2(pullop)
1024 if _canusebundle2(pullop) and 'listkeys' in pullop.remotebundle2caps:
1021 and 'listkeys' in bundle2.bundle2caps(pullop.remote)):
1022 # all known bundle2 servers now support listkeys, but lets be nice with
1025 # all known bundle2 servers now support listkeys, but lets be nice with
1023 # new implementation.
1026 # new implementation.
1024 return
1027 return
@@ -1067,7 +1070,6 b' def _pullbundle2(pullop):'
1067 """pull data using bundle2
1070 """pull data using bundle2
1068
1071
1069 For now, the only supported data are changegroup."""
1072 For now, the only supported data are changegroup."""
1070 remotecaps = bundle2.bundle2caps(pullop.remote)
1071 kwargs = {'bundlecaps': caps20to10(pullop.repo)}
1073 kwargs = {'bundlecaps': caps20to10(pullop.repo)}
1072 # pulling changegroup
1074 # pulling changegroup
1073 pullop.stepsdone.add('changegroup')
1075 pullop.stepsdone.add('changegroup')
@@ -1075,7 +1077,7 b' def _pullbundle2(pullop):'
1075 kwargs['common'] = pullop.common
1077 kwargs['common'] = pullop.common
1076 kwargs['heads'] = pullop.heads or pullop.rheads
1078 kwargs['heads'] = pullop.heads or pullop.rheads
1077 kwargs['cg'] = pullop.fetch
1079 kwargs['cg'] = pullop.fetch
1078 if 'listkeys' in remotecaps:
1080 if 'listkeys' in pullop.remotebundle2caps:
1079 kwargs['listkeys'] = ['phase']
1081 kwargs['listkeys'] = ['phase']
1080 if pullop.remotebookmarks is None:
1082 if pullop.remotebookmarks is None:
1081 # make sure to always includes bookmark data when migrating
1083 # make sure to always includes bookmark data when migrating
@@ -1088,7 +1090,7 b' def _pullbundle2(pullop):'
1088 if pullop.heads is None and list(pullop.common) == [nullid]:
1090 if pullop.heads is None and list(pullop.common) == [nullid]:
1089 pullop.repo.ui.status(_("requesting all changes\n"))
1091 pullop.repo.ui.status(_("requesting all changes\n"))
1090 if obsolete.isenabled(pullop.repo, obsolete.exchangeopt):
1092 if obsolete.isenabled(pullop.repo, obsolete.exchangeopt):
1091 remoteversions = bundle2.obsmarkersversion(remotecaps)
1093 remoteversions = bundle2.obsmarkersversion(pullop.remotebundle2caps)
1092 if obsolete.commonversion(remoteversions) is not None:
1094 if obsolete.commonversion(remoteversions) is not None:
1093 kwargs['obsmarkers'] = True
1095 kwargs['obsmarkers'] = True
1094 pullop.stepsdone.add('obsmarkers')
1096 pullop.stepsdone.add('obsmarkers')
General Comments 0
You need to be logged in to leave comments. Login now