##// END OF EJS Templates
revlog: add revmap back to revlog.addgroup...
Durham Goode -
r34292:1db9abf4 default
parent child Browse files
Show More
@@ -245,8 +245,8 b' class cg1unpacker(object):'
245 245 # no new manifest will be created and the manifest group will
246 246 # be empty during the pull
247 247 self.manifestheader()
248 deltas = self.deltaiter(revmap)
249 repo.manifestlog._revlog.addgroup(deltas, trp)
248 deltas = self.deltaiter()
249 repo.manifestlog._revlog.addgroup(deltas, revmap, trp)
250 250 repo.ui.progress(_('manifests'), None)
251 251 self.callback = None
252 252
@@ -308,8 +308,8 b' class cg1unpacker(object):'
308 308 efiles.update(cl.readfiles(node))
309 309
310 310 self.changelogheader()
311 deltas = self.deltaiter(csmap)
312 cgnodes = cl.addgroup(deltas, trp, addrevisioncb=onchangelog)
311 deltas = self.deltaiter()
312 cgnodes = cl.addgroup(deltas, csmap, trp, addrevisioncb=onchangelog)
313 313 efiles = len(efiles)
314 314
315 315 if not cgnodes:
@@ -430,7 +430,7 b' class cg1unpacker(object):'
430 430 ret = deltaheads + 1
431 431 return ret
432 432
433 def deltaiter(self, linkmapper):
433 def deltaiter(self):
434 434 """
435 435 returns an iterator of the deltas in this changegroup
436 436
@@ -446,10 +446,9 b' class cg1unpacker(object):'
446 446 delta = chunkdata['delta']
447 447 flags = chunkdata['flags']
448 448
449 link = linkmapper(cs)
450 449 chain = node
451 450
452 yield (node, p1, p2, link, deltabase, delta, flags)
451 yield (node, p1, p2, cs, deltabase, delta, flags)
453 452
454 453 class cg2unpacker(cg1unpacker):
455 454 """Unpacker for cg2 streams.
@@ -491,8 +490,8 b' class cg3unpacker(cg2unpacker):'
491 490 d = chunkdata["filename"]
492 491 repo.ui.debug("adding %s revisions\n" % d)
493 492 dirlog = repo.manifestlog._revlog.dirlog(d)
494 deltas = self.deltaiter(revmap)
495 if not dirlog.addgroup(deltas, trp):
493 deltas = self.deltaiter()
494 if not dirlog.addgroup(deltas, revmap, trp):
496 495 raise error.Abort(_("received dir revlog group is empty"))
497 496
498 497 class headerlessfixup(object):
@@ -983,8 +982,8 b' def _addchangegroupfiles(repo, source, r'
983 982 fl = repo.file(f)
984 983 o = len(fl)
985 984 try:
986 deltas = source.deltaiter(revmap)
987 if not fl.addgroup(deltas, trp):
985 deltas = source.deltaiter()
986 if not fl.addgroup(deltas, revmap, trp):
988 987 raise error.Abort(_("received file revlog group is empty"))
989 988 except error.CensoredBaseError as e:
990 989 raise error.Abort(_("received delta base is censored: %s") % e)
@@ -1910,7 +1910,7 b' class revlog(object):'
1910 1910 ifh.write(data[1])
1911 1911 self.checkinlinesize(transaction, ifh)
1912 1912
1913 def addgroup(self, deltas, transaction, addrevisioncb=None):
1913 def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None):
1914 1914 """
1915 1915 add a delta group
1916 1916
@@ -1944,7 +1944,8 b' class revlog(object):'
1944 1944 try:
1945 1945 # loop through our set of deltas
1946 1946 for data in deltas:
1947 node, p1, p2, link, deltabase, delta, flags = data
1947 node, p1, p2, linknode, deltabase, delta, flags = data
1948 link = linkmapper(linknode)
1948 1949 flags = flags or REVIDX_DEFAULT_FLAGS
1949 1950
1950 1951 nodes.append(node)
@@ -119,7 +119,7 b" def addgroupcopy(rlog, tr, destname=b'_d"
119 119 'deltabase': rlog.node(deltaparent),
120 120 'delta': rlog.revdiff(deltaparent, r)}
121 121
122 def deltaiter(self, linkmapper):
122 def deltaiter(self):
123 123 chain = None
124 124 for chunkdata in iter(lambda: self.deltachunk(chain), {}):
125 125 node = chunkdata['node']
@@ -130,17 +130,16 b" def addgroupcopy(rlog, tr, destname=b'_d"
130 130 delta = chunkdata['delta']
131 131 flags = chunkdata['flags']
132 132
133 link = linkmapper(cs)
134 133 chain = node
135 134
136 yield (node, p1, p2, link, deltabase, delta, flags)
135 yield (node, p1, p2, cs, deltabase, delta, flags)
137 136
138 137 def linkmap(lnode):
139 138 return rlog.rev(lnode)
140 139
141 140 dlog = newrevlog(destname, recreate=True)
142 dummydeltas = dummychangegroup().deltaiter(linkmap)
143 dlog.addgroup(dummydeltas, tr)
141 dummydeltas = dummychangegroup().deltaiter()
142 dlog.addgroup(dummydeltas, linkmap, tr)
144 143 return dlog
145 144
146 145 def lowlevelcopy(rlog, tr, destname=b'_destrevlog.i'):
General Comments 0
You need to be logged in to leave comments. Login now