##// END OF EJS Templates
bundlerepo: improve performance for bundle() revset expression...
Mads Kiilerich -
r18411:8b0f0dd5 default
parent child Browse files
Show More
@@ -25,8 +25,7 class bundlerevlog(revlog.revlog):
25 25 # (start).
26 26 #
27 27 # basemap is indexed with revisions coming from the bundle, and it
28 # maps to the corresponding node that is the base of the corresponding
29 # delta.
28 # maps to the node that is the base of the corresponding delta.
30 29 #
31 30 # To differentiate a rev in the bundle from a rev in the revlog, we
32 31 # check revision against basemap.
@@ -37,7 +36,7 class bundlerevlog(revlog.revlog):
37 36 n = len(self)
38 37 self.disktiprev = n - 1
39 38 chain = None
40 self.bundlenodes = []
39 self.bundlerevs = set() # used by 'bundle()' revset expression
41 40 while True:
42 41 chunkdata = bundle.deltachunk(chain)
43 42 if not chunkdata:
@@ -53,10 +52,10 class bundlerevlog(revlog.revlog):
53 52 start = bundle.tell() - size
54 53
55 54 link = linkmapper(cs)
56 self.bundlenodes.append(node)
57 55 if node in self.nodemap:
58 56 # this can happen if two branches make the same change
59 57 chain = node
58 self.bundlerevs.add(self.nodemap[node])
60 59 continue
61 60
62 61 for p in (p1, p2):
@@ -69,6 +68,7 class bundlerevlog(revlog.revlog):
69 68 self.basemap[n] = deltabase
70 69 self.index.insert(-1, e)
71 70 self.nodemap[node] = n
71 self.bundlerevs.add(n)
72 72 chain = node
73 73 n += 1
74 74
@@ -450,11 +450,10 def bundle(repo, subset, x):
450 450 Bundle must be specified by the -R option."""
451 451
452 452 try:
453 bundlenodes = repo.changelog.bundlenodes
453 bundlerevs = repo.changelog.bundlerevs
454 454 except AttributeError:
455 455 raise util.Abort(_("no bundle provided - specify with -R"))
456 revs = set(repo[n].rev() for n in bundlenodes)
457 return [r for r in subset if r in revs]
456 return [r for r in subset if r in bundlerevs]
458 457
459 458 def checkstatus(repo, subset, pat, field):
460 459 m = None
General Comments 0
You need to be logged in to leave comments. Login now