Show More
@@ -743,7 +743,7 b' class sqlitefilestore(object):' | |||
|
743 | 743 | ) |
|
744 | 744 | |
|
745 | 745 | if duplicaterevisioncb: |
|
746 | duplicaterevisioncb(self, node) | |
|
746 | duplicaterevisioncb(self, self.rev(node)) | |
|
747 | 747 | empty = False |
|
748 | 748 | continue |
|
749 | 749 | |
@@ -754,7 +754,7 b' class sqlitefilestore(object):' | |||
|
754 | 754 | text = None |
|
755 | 755 | storedelta = (deltabase, delta) |
|
756 | 756 | |
|
757 | self._addrawrevision( | |
|
757 | rev = self._addrawrevision( | |
|
758 | 758 | node, |
|
759 | 759 | text, |
|
760 | 760 | transaction, |
@@ -766,7 +766,7 b' class sqlitefilestore(object):' | |||
|
766 | 766 | ) |
|
767 | 767 | |
|
768 | 768 | if addrevisioncb: |
|
769 |
addrevisioncb(self, |
|
|
769 | addrevisioncb(self, rev) | |
|
770 | 770 | empty = False |
|
771 | 771 | |
|
772 | 772 | return not empty |
@@ -318,12 +318,11 b' class cg1unpacker(object):' | |||
|
318 | 318 | efilesset = set() |
|
319 | 319 | cgnodes = [] |
|
320 | 320 | |
|
321 |
def ondupchangelog(cl, |
|
|
322 |
if |
|
|
323 | cgnodes.append(node) | |
|
321 | def ondupchangelog(cl, rev): | |
|
322 | if rev < clstart: | |
|
323 | cgnodes.append(cl.node(rev)) | |
|
324 | 324 | |
|
325 |
def onchangelog(cl, |
|
|
326 | rev = cl.rev(node) | |
|
325 | def onchangelog(cl, rev): | |
|
327 | 326 | ctx = cl.changelogrevision(rev) |
|
328 | 327 | efilesset.update(ctx.files) |
|
329 | 328 | repo.register_changeset(rev, ctx) |
@@ -610,9 +610,9 b' class changelog(revlog.revlog):' | |||
|
610 | 610 | just to access this is costly.""" |
|
611 | 611 | return self.changelogrevision(rev).branchinfo |
|
612 | 612 | |
|
613 |
def _nodeduplicatecallback(self, transaction, |
|
|
613 | def _nodeduplicatecallback(self, transaction, rev): | |
|
614 | 614 | # keep track of revisions that got "re-added", eg: unbunde of know rev. |
|
615 | 615 | # |
|
616 | 616 | # We track them in a list to preserve their order from the source bundle |
|
617 | 617 | duplicates = transaction.changes.setdefault(b'revduplicates', []) |
|
618 |
duplicates.append( |
|
|
618 | duplicates.append(rev) |
@@ -358,15 +358,14 b' def _processchangesetdata(repo, tr, objs' | |||
|
358 | 358 | # Linkrev for changelog is always self. |
|
359 | 359 | return len(cl) |
|
360 | 360 | |
|
361 |
def ondupchangeset(cl, |
|
|
362 | added.append(node) | |
|
361 | def ondupchangeset(cl, rev): | |
|
362 | added.append(cl.node(rev)) | |
|
363 | 363 | |
|
364 |
def onchangeset(cl, |
|
|
364 | def onchangeset(cl, rev): | |
|
365 | 365 | progress.increment() |
|
366 | 366 | |
|
367 | rev = cl.rev(node) | |
|
368 | 367 | revision = cl.changelogrevision(rev) |
|
369 | added.append(node) | |
|
368 | added.append(cl.node(rev)) | |
|
370 | 369 | |
|
371 | 370 | # We need to preserve the mapping of changelog revision to node |
|
372 | 371 | # so we can set the linkrev accordingly when manifests are added. |
@@ -537,8 +536,8 b' def _fetchmanifests(repo, tr, remote, ma' | |||
|
537 | 536 | # Chomp off header object. |
|
538 | 537 | next(objs) |
|
539 | 538 | |
|
540 |
def onchangeset(cl, |
|
|
541 | added.append(node) | |
|
539 | def onchangeset(cl, rev): | |
|
540 | added.append(cl.node(rev)) | |
|
542 | 541 | |
|
543 | 542 | rootmanifest.addgroup( |
|
544 | 543 | iterrevisions(objs, progress), |
@@ -774,8 +774,9 b' class ifilemutation(interfaceutil.Interf' | |||
|
774 | 774 | This used to be the default when ``addrevisioncb`` was provided up to |
|
775 | 775 | Mercurial 5.8. |
|
776 | 776 | |
|
777 |
``addrevisioncb`` should be called for each n |
|
|
778 |
``duplicaterevisioncb`` should be called for |
|
|
777 | ``addrevisioncb`` should be called for each new rev as it is committed. | |
|
778 | ``duplicaterevisioncb`` should be called for all revs with a | |
|
779 | pre-existing node. | |
|
779 | 780 | |
|
780 | 781 | ``maybemissingparents`` is a bool indicating whether the incoming |
|
781 | 782 | data may reference parents/ancestor revisions that aren't present. |
@@ -2419,11 +2419,12 b' class revlog(object):' | |||
|
2419 | 2419 | link = linkmapper(linknode) |
|
2420 | 2420 | flags = flags or REVIDX_DEFAULT_FLAGS |
|
2421 | 2421 | |
|
2422 |
|
|
|
2422 | rev = self.index.get_rev(node) | |
|
2423 | if rev is not None: | |
|
2423 | 2424 | # this can happen if two branches make the same change |
|
2424 |
self._nodeduplicatecallback(transaction, |
|
|
2425 | self._nodeduplicatecallback(transaction, rev) | |
|
2425 | 2426 | if duplicaterevisioncb: |
|
2426 |
duplicaterevisioncb(self, |
|
|
2427 | duplicaterevisioncb(self, rev) | |
|
2427 | 2428 | empty = False |
|
2428 | 2429 | continue |
|
2429 | 2430 | |
@@ -2461,7 +2462,7 b' class revlog(object):' | |||
|
2461 | 2462 | # We're only using addgroup() in the context of changegroup |
|
2462 | 2463 | # generation so the revision data can always be handled as raw |
|
2463 | 2464 | # by the flagprocessor. |
|
2464 | self._addrevision( | |
|
2465 | rev = self._addrevision( | |
|
2465 | 2466 | node, |
|
2466 | 2467 | None, |
|
2467 | 2468 | transaction, |
@@ -2477,7 +2478,7 b' class revlog(object):' | |||
|
2477 | 2478 | ) |
|
2478 | 2479 | |
|
2479 | 2480 | if addrevisioncb: |
|
2480 |
addrevisioncb(self, |
|
|
2481 | addrevisioncb(self, rev) | |
|
2481 | 2482 | empty = False |
|
2482 | 2483 | |
|
2483 | 2484 | if not dfh and not self._inline: |
@@ -1129,12 +1129,13 b' class ifilemutationtests(basetestcase):' | |||
|
1129 | 1129 | with self._maketransactionfn() as tr: |
|
1130 | 1130 | nodes = [] |
|
1131 | 1131 | |
|
1132 |
def onchangeset(cl, |
|
|
1132 | def onchangeset(cl, rev): | |
|
1133 | node = cl.node(rev) | |
|
1133 | 1134 | nodes.append(node) |
|
1134 | 1135 | cb(cl, node) |
|
1135 | 1136 | |
|
1136 |
def ondupchangeset(cl, |
|
|
1137 | nodes.append(node) | |
|
1137 | def ondupchangeset(cl, rev): | |
|
1138 | nodes.append(cl.node(rev)) | |
|
1138 | 1139 | |
|
1139 | 1140 | f.addgroup( |
|
1140 | 1141 | [], |
@@ -1163,12 +1164,13 b' class ifilemutationtests(basetestcase):' | |||
|
1163 | 1164 | with self._maketransactionfn() as tr: |
|
1164 | 1165 | nodes = [] |
|
1165 | 1166 | |
|
1166 |
def onchangeset(cl, |
|
|
1167 | def onchangeset(cl, rev): | |
|
1168 | node = cl.node(rev) | |
|
1167 | 1169 | nodes.append(node) |
|
1168 | 1170 | cb(cl, node) |
|
1169 | 1171 | |
|
1170 |
def ondupchangeset(cl, |
|
|
1171 | nodes.append(node) | |
|
1172 | def ondupchangeset(cl, rev): | |
|
1173 | nodes.append(cl.node(rev)) | |
|
1172 | 1174 | |
|
1173 | 1175 | f.addgroup( |
|
1174 | 1176 | deltas, |
@@ -1217,8 +1219,8 b' class ifilemutationtests(basetestcase):' | |||
|
1217 | 1219 | with self._maketransactionfn() as tr: |
|
1218 | 1220 | newnodes = [] |
|
1219 | 1221 | |
|
1220 |
def onchangeset(cl, |
|
|
1221 | newnodes.append(node) | |
|
1222 | def onchangeset(cl, rev): | |
|
1223 | newnodes.append(cl.node(rev)) | |
|
1222 | 1224 | |
|
1223 | 1225 | f.addgroup( |
|
1224 | 1226 | deltas, |
@@ -550,7 +550,7 b' class filestorage(object):' | |||
|
550 | 550 | |
|
551 | 551 | if node in self._indexbynode: |
|
552 | 552 | if duplicaterevisioncb: |
|
553 | duplicaterevisioncb(self, node) | |
|
553 | duplicaterevisioncb(self, self.rev(node)) | |
|
554 | 554 | empty = False |
|
555 | 555 | continue |
|
556 | 556 | |
@@ -560,12 +560,12 b' class filestorage(object):' | |||
|
560 | 560 | else: |
|
561 | 561 | text = mdiff.patch(self.revision(deltabase), delta) |
|
562 | 562 | |
|
563 | self._addrawrevision( | |
|
563 | rev = self._addrawrevision( | |
|
564 | 564 | node, text, transaction, linkrev, p1, p2, flags |
|
565 | 565 | ) |
|
566 | 566 | |
|
567 | 567 | if addrevisioncb: |
|
568 |
addrevisioncb(self, |
|
|
568 | addrevisioncb(self, rev) | |
|
569 | 569 | empty = False |
|
570 | 570 | return not empty |
|
571 | 571 |
General Comments 0
You need to be logged in to leave comments.
Login now