pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/py-mercurial/patches



Module Name:    pkgsrc
Committed By:   joerg
Date:           Thu Jun 20 23:56:45 UTC 2024

Added Files:
        pkgsrc/devel/py-mercurial/patches: patch-mercurial_bundle2.py
            patch-mercurial_exchange.py patch-mercurial_obsolete.py
            patch-mercurial_obsutil.py

Log Message:
mercurial-6.7.3nb1:
- add a two changesets from upstream and under review to improve the
  performance of the non-evolution obs exchange.
- install chg(1)


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.3 \
    pkgsrc/devel/py-mercurial/patches/patch-mercurial_bundle2.py
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/devel/py-mercurial/patches/patch-mercurial_exchange.py \
    pkgsrc/devel/py-mercurial/patches/patch-mercurial_obsolete.py \
    pkgsrc/devel/py-mercurial/patches/patch-mercurial_obsutil.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: pkgsrc/devel/py-mercurial/patches/patch-mercurial_bundle2.py
diff -u /dev/null pkgsrc/devel/py-mercurial/patches/patch-mercurial_bundle2.py:1.3
--- /dev/null   Thu Jun 20 23:56:45 2024
+++ pkgsrc/devel/py-mercurial/patches/patch-mercurial_bundle2.py        Thu Jun 20 23:56:45 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-mercurial_bundle2.py,v 1.3 2024/06/20 23:56:45 joerg Exp $
+
+Upstream f28c52a9f7b4
+
+--- mercurial/bundle2.py.orig  2024-03-29 20:37:05.000000000 +0000
++++ mercurial/bundle2.py
+@@ -1787,7 +1787,7 @@ def _addpartsfromopts(ui, repo, bundler,
+         addpartrevbranchcache(repo, bundler, outgoing)
+ 
+     if opts.get(b'obsolescence', False):
+-        obsmarkers = repo.obsstore.relevantmarkers(outgoing.missing)
++        obsmarkers = repo.obsstore.relevantmarkers(nodes=outgoing.missing)
+         buildobsmarkerspart(
+             bundler,
+             obsmarkers,

Index: pkgsrc/devel/py-mercurial/patches/patch-mercurial_exchange.py
diff -u /dev/null pkgsrc/devel/py-mercurial/patches/patch-mercurial_exchange.py:1.1
--- /dev/null   Thu Jun 20 23:56:45 2024
+++ pkgsrc/devel/py-mercurial/patches/patch-mercurial_exchange.py       Thu Jun 20 23:56:45 2024
@@ -0,0 +1,37 @@
+$NetBSD: patch-mercurial_exchange.py,v 1.1 2024/06/20 23:56:45 joerg Exp $
+
+Upstream f28c52a9f7b4
+https://foss.heptapod.net/mercurial/mercurial-devel/-/merge_requests/863
+
+--- mercurial/exchange.py.orig 2024-03-29 20:37:05.000000000 +0000
++++ mercurial/exchange.py
+@@ -668,8 +668,8 @@ def _pushdiscoveryobsmarkers(pushop):
+     repo = pushop.repo
+     # very naive computation, that can be quite expensive on big repo.
+     # However: evolution is currently slow on them anyway.
+-    nodes = (c.node() for c in repo.set(b'::%ln', pushop.futureheads))
+-    pushop.outobsmarkers = pushop.repo.obsstore.relevantmarkers(nodes)
++    revs = repo.revs(b'::%ln', pushop.futureheads)
++    pushop.outobsmarkers = pushop.repo.obsstore.relevantmarkers(revs=revs)
+ 
+ 
+ @pushdiscovery(b'bookmarks')
+@@ -2542,10 +2542,15 @@ def _getbundleobsmarkerpart(
+ ):
+     """add an obsolescence markers part to the requested bundle"""
+     if kwargs.get('obsmarkers', False):
++        unfi_cl = repo.unfiltered().changelog
+         if heads is None:
+-            heads = repo.heads()
+-        subset = [c.node() for c in repo.set(b'::%ln', heads)]
+-        markers = repo.obsstore.relevantmarkers(subset)
++            headrevs = repo.changelog.headrevs()
++        else:
++            get_rev = unfi_cl.index.get_rev
++            headrevs = [get_rev(node) for node in heads]
++            headrevs = [rev for rev in headrevs if rev is not None]
++        revs = set(unfi_cl.ancestors(headrevs, inclusive=True))
++        markers = repo.obsstore.relevantmarkers(revs=revs)
+         markers = obsutil.sortedmarkers(markers)
+         bundle2.buildobsmarkerspart(bundler, markers)
+ 
Index: pkgsrc/devel/py-mercurial/patches/patch-mercurial_obsolete.py
diff -u /dev/null pkgsrc/devel/py-mercurial/patches/patch-mercurial_obsolete.py:1.1
--- /dev/null   Thu Jun 20 23:56:45 2024
+++ pkgsrc/devel/py-mercurial/patches/patch-mercurial_obsolete.py       Thu Jun 20 23:56:45 2024
@@ -0,0 +1,48 @@
+$NetBSD: patch-mercurial_obsolete.py,v 1.1 2024/06/20 23:56:45 joerg Exp $
+
+Upstream f28c52a9f7b4
+
+--- mercurial/obsolete.py.orig 2024-03-29 20:37:05.000000000 +0000
++++ mercurial/obsolete.py
+@@ -771,10 +771,11 @@ class obsstore:
+             _addchildren(self.children, markers)
+         _checkinvalidmarkers(self.repo, markers)
+ 
+-    def relevantmarkers(self, nodes):
+-        """return a set of all obsolescence markers relevant to a set of nodes.
++    def relevantmarkers(self, nodes=None, revs=None):
++        """return a set of all obsolescence markers relevant to a set of
++        nodes or revisions.
+ 
+-        "relevant" to a set of nodes mean:
++        "relevant" to a set of nodes or revisions mean:
+ 
+         - marker that use this changeset as successor
+         - prune marker of direct children on this changeset
+@@ -782,10 +783,24 @@ class obsstore:
+           markers
+ 
+         It is a set so you cannot rely on order."""
++        if nodes is None:
++            nodes = set()
++        if revs is None:
++            revs = set()
+ 
+-        pendingnodes = set(nodes)
++        get_rev = self.repo.unfiltered().changelog.index.get_rev
++        pendingnodes = set()
++        for marker in self._all:
++            for node in (marker[0],) + marker[1] + (marker[5] or ()):
++                if node in nodes:
++                    pendingnodes.add(node)
++                elif revs:
++                    rev = get_rev(node)
++                    if rev is not None and rev in revs:
++                        pendingnodes.add(node)
+         seenmarkers = set()
+-        seennodes = set(pendingnodes)
++        seenmarkers = set()
++        seennodes = set()
+         precursorsmarkers = self.predecessors
+         succsmarkers = self.successors
+         children = self.children
Index: pkgsrc/devel/py-mercurial/patches/patch-mercurial_obsutil.py
diff -u /dev/null pkgsrc/devel/py-mercurial/patches/patch-mercurial_obsutil.py:1.1
--- /dev/null   Thu Jun 20 23:56:45 2024
+++ pkgsrc/devel/py-mercurial/patches/patch-mercurial_obsutil.py        Thu Jun 20 23:56:45 2024
@@ -0,0 +1,15 @@
+$NetBSD: patch-mercurial_obsutil.py,v 1.1 2024/06/20 23:56:45 joerg Exp $
+
+Upstream f28c52a9f7b4
+
+--- mercurial/obsutil.py.orig  2024-03-29 20:37:05.000000000 +0000
++++ mercurial/obsutil.py
+@@ -108,7 +108,7 @@ def getmarkers(repo, nodes=None, exclusi
+     elif exclusive:
+         rawmarkers = exclusivemarkers(repo, nodes)
+     else:
+-        rawmarkers = repo.obsstore.relevantmarkers(nodes)
++        rawmarkers = repo.obsstore.relevantmarkers(nodes=nodes)
+ 
+     for markerdata in rawmarkers:
+         yield marker(repo, markerdata)



Home | Main Index | Thread Index | Old Index