##// END OF EJS Templates
changegroupsubset: simplify knownheads/has_cl_set computation
Benoit Boissinot -
r11662:a3bfdf21 default
parent child Browse files
Show More
@@ -1305,26 +1305,8 b' class localrepository(repo.repository):'
1305
1305
1306 self.changegroupinfo(msng_cl_lst, source)
1306 self.changegroupinfo(msng_cl_lst, source)
1307
1307
1308 # Known heads are the list of heads that it is assumed the recipient
1308 # We assume that all ancestors of bases are known
1309 # of this changegroup will know about.
1309 commonrevs = set(cl.ancestors(*[cl.rev(n) for n in bases]))
1310 knownheads = set()
1311 # We assume that all parents of bases are known heads.
1312 for n in bases:
1313 knownheads.update(cl.parents(n))
1314 knownheads.discard(nullid)
1315 if knownheads:
1316 # Now that we know what heads are known, we can compute which
1317 # changesets are known. The recipient must know about all
1318 # changesets required to reach the known heads from the null
1319 # changeset.
1320 has_cl_set, junk, junk = cl.nodesbetween(None, knownheads)
1321 junk = None
1322 # Transform the list into a set.
1323 has_cl_set = set(has_cl_set)
1324 else:
1325 # If there were no known heads, the recipient cannot be assumed to
1326 # know about any changesets.
1327 has_cl_set = set()
1328
1310
1329 # Make it easy to refer to self.manifest
1311 # Make it easy to refer to self.manifest
1330 mnfst = self.manifest
1312 mnfst = self.manifest
@@ -1395,8 +1377,8 b' class localrepository(repo.repository):'
1395 # assume the recipient must have, then the recipient must have
1377 # assume the recipient must have, then the recipient must have
1396 # that filenode.
1378 # that filenode.
1397 for n in missingnodes:
1379 for n in missingnodes:
1398 clnode = cl.node(revlog.linkrev(revlog.rev(n)))
1380 clrev = revlog.linkrev(revlog.rev(n))
1399 if clnode in has_cl_set:
1381 if clrev in commonrevs:
1400 hasset.add(n)
1382 hasset.add(n)
1401 for n in hasset:
1383 for n in hasset:
1402 missingnodes.pop(n, None)
1384 missingnodes.pop(n, None)
General Comments 0
You need to be logged in to leave comments. Login now