Show More
@@ -1804,7 +1804,7 def _addpartsfromopts(ui, repo, bundler, | |||
|
1804 | 1804 | addpartrevbranchcache(repo, bundler, outgoing) |
|
1805 | 1805 | |
|
1806 | 1806 | if opts.get(b'obsolescence', False): |
|
1807 | obsmarkers = repo.obsstore.relevantmarkers(outgoing.missing) | |
|
1807 | obsmarkers = repo.obsstore.relevantmarkers(nodes=outgoing.missing) | |
|
1808 | 1808 | buildobsmarkerspart( |
|
1809 | 1809 | bundler, |
|
1810 | 1810 | obsmarkers, |
@@ -704,8 +704,8 def _pushdiscoveryobsmarkers(pushop): | |||
|
704 | 704 | repo = pushop.repo |
|
705 | 705 | # very naive computation, that can be quite expensive on big repo. |
|
706 | 706 | # However: evolution is currently slow on them anyway. |
|
707 |
|
|
|
708 |
pushop.outobsmarkers = pushop.repo.obsstore.relevantmarkers( |
|
|
707 | revs = repo.revs(b'::%ln', pushop.futureheads) | |
|
708 | pushop.outobsmarkers = pushop.repo.obsstore.relevantmarkers(revs=revs) | |
|
709 | 709 | |
|
710 | 710 | |
|
711 | 711 | @pushdiscovery(b'bookmarks') |
@@ -2604,10 +2604,15 def _getbundleobsmarkerpart( | |||
|
2604 | 2604 | ): |
|
2605 | 2605 | """add an obsolescence markers part to the requested bundle""" |
|
2606 | 2606 | if kwargs.get('obsmarkers', False): |
|
2607 | unfi_cl = repo.unfiltered().changelog | |
|
2607 | 2608 | if heads is None: |
|
2608 | heads = repo.heads() | |
|
2609 | subset = [c.node() for c in repo.set(b'::%ln', heads)] | |
|
2610 | markers = repo.obsstore.relevantmarkers(subset) | |
|
2609 | headrevs = repo.changelog.headrevs() | |
|
2610 | else: | |
|
2611 | get_rev = unfi_cl.index.get_rev | |
|
2612 | headrevs = [get_rev(node) for node in heads] | |
|
2613 | headrevs = [rev for rev in headrevs if rev is not None] | |
|
2614 | revs = unfi_cl.ancestors(headrevs, inclusive=True) | |
|
2615 | markers = repo.obsstore.relevantmarkers(revs=revs) | |
|
2611 | 2616 | markers = obsutil.sortedmarkers(markers) |
|
2612 | 2617 | bundle2.buildobsmarkerspart(bundler, markers) |
|
2613 | 2618 |
@@ -773,10 +773,11 class obsstore: | |||
|
773 | 773 | _addchildren(self.children, markers) |
|
774 | 774 | _checkinvalidmarkers(self.repo, markers) |
|
775 | 775 | |
|
776 | def relevantmarkers(self, nodes): | |
|
777 |
"""return a set of all obsolescence markers relevant to a set of |
|
|
776 | def relevantmarkers(self, nodes=None, revs=None): | |
|
777 | """return a set of all obsolescence markers relevant to a set of | |
|
778 | nodes or revisions. | |
|
778 | 779 | |
|
779 | "relevant" to a set of nodes mean: | |
|
780 | "relevant" to a set of nodes or revisions mean: | |
|
780 | 781 | |
|
781 | 782 | - marker that use this changeset as successor |
|
782 | 783 | - prune marker of direct children on this changeset |
@@ -784,13 +785,33 class obsstore: | |||
|
784 | 785 | markers |
|
785 | 786 | |
|
786 | 787 | It is a set so you cannot rely on order.""" |
|
788 | if nodes is None: | |
|
789 | nodes = set() | |
|
790 | if revs is None: | |
|
791 | revs = set() | |
|
787 | 792 | |
|
788 | pendingnodes = set(nodes) | |
|
789 |
|
|
|
790 | seennodes = set(pendingnodes) | |
|
793 | tonode = self.repo.unfiltered().changelog.node | |
|
794 | pendingnodes = set() | |
|
791 | 795 | precursorsmarkers = self.predecessors |
|
792 | 796 | succsmarkers = self.successors |
|
793 | 797 | children = self.children |
|
798 | for node in nodes: | |
|
799 | if ( | |
|
800 | node in precursorsmarkers | |
|
801 | or node in succsmarkers | |
|
802 | or node in children | |
|
803 | ): | |
|
804 | pendingnodes.add(node) | |
|
805 | for rev in revs: | |
|
806 | node = tonode(rev) | |
|
807 | if ( | |
|
808 | node in precursorsmarkers | |
|
809 | or node in succsmarkers | |
|
810 | or node in children | |
|
811 | ): | |
|
812 | pendingnodes.add(node) | |
|
813 | seenmarkers = set() | |
|
814 | seennodes = pendingnodes.copy() | |
|
794 | 815 | while pendingnodes: |
|
795 | 816 | direct = set() |
|
796 | 817 | for current in pendingnodes: |
@@ -109,7 +109,7 def getmarkers(repo, nodes=None, exclusi | |||
|
109 | 109 | elif exclusive: |
|
110 | 110 | rawmarkers = exclusivemarkers(repo, nodes) |
|
111 | 111 | else: |
|
112 | rawmarkers = repo.obsstore.relevantmarkers(nodes) | |
|
112 | rawmarkers = repo.obsstore.relevantmarkers(nodes=nodes) | |
|
113 | 113 | |
|
114 | 114 | for markerdata in rawmarkers: |
|
115 | 115 | yield marker(repo, markerdata) |
General Comments 0
You need to be logged in to leave comments.
Login now