##// END OF EJS Templates
discovery: run discovery on filtered repository...
Pierre-Yves David -
r23848:c5456b64 default
parent child Browse files
Show More
@@ -271,12 +271,11 b' def _pushdiscovery(pushop):'
271 271 @pushdiscovery('changeset')
272 272 def _pushdiscoverychangeset(pushop):
273 273 """discover the changeset that need to be pushed"""
274 unfi = pushop.repo.unfiltered()
275 274 fci = discovery.findcommonincoming
276 commoninc = fci(unfi, pushop.remote, force=pushop.force)
275 commoninc = fci(pushop.repo, pushop.remote, force=pushop.force)
277 276 common, inc, remoteheads = commoninc
278 277 fco = discovery.findcommonoutgoing
279 outgoing = fco(unfi, pushop.remote, onlyheads=pushop.revs,
278 outgoing = fco(pushop.repo, pushop.remote, onlyheads=pushop.revs,
280 279 commoninc=commoninc, force=pushop.force)
281 280 pushop.outgoing = outgoing
282 281 pushop.remoteheads = remoteheads
@@ -927,11 +926,36 b' def _pulldiscoverychangegroup(pullop):'
927 926
928 927 Current handle changeset discovery only, will change handle all discovery
929 928 at some point."""
930 tmp = discovery.findcommonincoming(pullop.repo.unfiltered(),
929 tmp = discovery.findcommonincoming(pullop.repo,
931 930 pullop.remote,
932 931 heads=pullop.heads,
933 932 force=pullop.force)
934 pullop.common, pullop.fetch, pullop.rheads = tmp
933 common, fetch, rheads = tmp
934 nm = pullop.repo.unfiltered().changelog.nodemap
935 if fetch and rheads:
936 # If a remote heads in filtered locally, lets drop it from the unknown
937 # remote heads and put in back in common.
938 #
939 # This is a hackish solution to catch most of "common but locally
940 # hidden situation". We do not performs discovery on unfiltered
941 # repository because it end up doing a pathological amount of round
942 # trip for w huge amount of changeset we do not care about.
943 #
944 # If a set of such "common but filtered" changeset exist on the server
945 # but are not including a remote heads, we'll not be able to detect it,
946 scommon = set(common)
947 filteredrheads = []
948 for n in rheads:
949 if n in nm and n not in scommon:
950 common.append(n)
951 else:
952 filteredrheads.append(n)
953 if not filteredrheads:
954 fetch = []
955 rheads = filteredrheads
956 pullop.common = common
957 pullop.fetch = fetch
958 pullop.rheads = rheads
935 959
936 960 def _pullbundle2(pullop):
937 961 """pull data using bundle2
@@ -172,7 +172,11 b" def decodelist(l, sep=' '):"
172 172 return []
173 173
174 174 def encodelist(l, sep=' '):
175 return sep.join(map(hex, l))
175 try:
176 return sep.join(map(hex, l))
177 except TypeError:
178 print l
179 raise
176 180
177 181 # batched call argument encoding
178 182
General Comments 0
You need to be logged in to leave comments. Login now