changeset 7013:04af1642084d

branching: merge with stable
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 07 Feb 2025 12:29:33 +0100
parents 70b173f8428d (current diff) 33cda19d48e9 (diff)
children 42c10cc2ef03
files .gitlab-ci.yml CHANGELOG hgext3rd/evolve/compat.py hgext3rd/evolve/evolvecmd.py hgext3rd/evolve/metadata.py hgext3rd/evolve/obshistory.py hgext3rd/evolve/rewriteutil.py hgext3rd/topic/__init__.py
diffstat 13 files changed, 162 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/.gitlab-ci.yml	Wed Nov 27 17:48:38 2024 +0400
+++ b/.gitlab-ci.yml	Fri Feb 07 12:29:33 2025 +0100
@@ -75,7 +75,7 @@
 
 sdist:
     stage: .post
-    image: registry.heptapod.net/mercurial/ci-images/py3-hgext3rd
+    image: registry.heptapod.net/mercurial/ci-images/py3-hgext3rd:v2.1
     script:
         - python3 setup.py sdist
     artifacts:
--- a/.gitlab/issue_templates/new-version.md	Wed Nov 27 17:48:38 2024 +0400
+++ b/.gitlab/issue_templates/new-version.md	Fri Feb 07 12:29:33 2025 +0100
@@ -17,7 +17,6 @@
 * [ ] update the `__version__` field of all relevant extensions
 * [ ] create a new Debian entry
 * [ ] tag the version
-* [ ] move the `@` bookmark to the new tag
 * [ ] push/publish the tag to the main repository
 * [ ] upload the tarball to PyPI
 * [ ] build .deb on Heptapod CI for the tagged commit
--- a/.hgtags	Wed Nov 27 17:48:38 2024 +0400
+++ b/.hgtags	Fri Feb 07 12:29:33 2025 +0100
@@ -113,3 +113,5 @@
 ed7c98393e060210689f0b94d79e8b990403b6a9 11.1.4
 6219898ee0ad2ebd1d75500ac9d1b02e5b539de2 11.1.5
 885e8a8414bde9a14dcefbd342a9704e8ace7649 11.1.6
+3ea6267f54f19546fee70190c9fcf58ed6fa74a3 11.1.7
+175b1a7325335e651d3e25eb9f5487429c64706c 11.1.7.post1
--- a/CHANGELOG	Wed Nov 27 17:48:38 2024 +0400
+++ b/CHANGELOG	Fri Feb 07 12:29:33 2025 +0100
@@ -7,6 +7,19 @@
   * evolve: remove legacy.py that could be used to "detect and convert
     prehistoric format of obsolete markers" (older than Mercurial 2.3)
 
+11.1.7.post1 -- 2025-02-06
+--------------------------
+
+  * no changes from 11.1.7, only upgraded packaging
+
+11.1.7 -- 2025-02-06
+--------------------
+
+  * evolve: fix version check from 972d98ce3552 for hg 6.8 (issue6958)
+
+  * obslog: also display patch for rebased changesets (requires Mercurial 5.6
+    or newer for in-memory rebase support)
+
 11.1.6 -- 2024-11-27
 --------------------
 
--- a/README.rst	Wed Nov 27 17:48:38 2024 +0400
+++ b/README.rst	Fri Feb 07 12:29:33 2025 +0100
@@ -299,8 +299,6 @@
 
 * tag the commit,
 
-* move ``@`` bookmark to the new tag,
-
 * push and publish the tag,
 
 * upload the tarball to PyPI,
--- a/contrib/merge-test-compat.sh	Wed Nov 27 17:48:38 2024 +0400
+++ b/contrib/merge-test-compat.sh	Fri Feb 07 12:29:33 2025 +0100
@@ -3,7 +3,7 @@
 
 unset GREP_OPTIONS
 
-compatbranches=$(hg branches --quiet | grep 'mercurial-' | grep -v ':' | sort -n --reverse)
+compatbranches=$(HGRCPATH= hg branches --quiet | grep -E '^mercurial-' | sort -n --reverse)
 prev='stable'
 topic=${1:-'test-compat'}
 for branch in $compatbranches; do
@@ -15,11 +15,15 @@
     # are definitely unrelated to what we're doing.
     # In other words, if you want to test certain commits, assign them all to
     # one topic and provide that topic as the first argument to this script.
-    uptarget="first(max(branch('$branch') and topic('$topic')) or max(branch('$branch') and not topic()))"
+    uptarget="first(max(branch('re:^$branch') and topic('$topic')) or max(branch('re:^$branch') and not topic()))"
     hg up -r "$uptarget"
     hg topic "$topic"
-    mergetarget="first(max(branch('$prev') and topic('$topic')) or max(branch('$prev') and not topic()))"
-    hg merge -r "$mergetarget"
-    hg commit -m "test-compat: merge $prev into $branch"
+    mergetarget="first(max(branch('re:^$prev') and topic('$topic')) or max(branch('re:^$prev') and not topic()))"
+    if hg log -r "$mergetarget and ancestors(.)" -T 'already merged' | grep 'merge'; then
+        echo "not merging $prev into $branch as it is already merged"
+    else
+        hg merge -r "$mergetarget"
+        hg commit -m "test-compat: merge $prev into $branch"
+    fi
     prev=$branch
 done
--- a/debian/changelog	Wed Nov 27 17:48:38 2024 +0400
+++ b/debian/changelog	Fri Feb 07 12:29:33 2025 +0100
@@ -1,3 +1,15 @@
+mercurial-evolve (11.1.7.post1-1) unstable; urgency=medium
+
+  * new upstream release
+
+ -- Anton Shestakov <av6@dwimlabs.net>  Thu, 06 Feb 2025 22:57:24 +0100
+
+mercurial-evolve (11.1.7-1) unstable; urgency=medium
+
+  * new upstream release
+
+ -- Anton Shestakov <av6@dwimlabs.net>  Thu, 06 Feb 2025 14:22:10 +0100
+
 mercurial-evolve (11.1.6-1) unstable; urgency=medium
 
   * new upstream release
--- a/hgext3rd/evolve/compat.py	Wed Nov 27 17:48:38 2024 +0400
+++ b/hgext3rd/evolve/compat.py	Fri Feb 07 12:29:33 2025 +0100
@@ -494,6 +494,89 @@
 
     context.overlayworkingctx.markcopied = fixedmarkcopied
 
+# hg <= 6.9 (f071b18e1382)
+# we detect a502f3f389b5 because it's close enough and touches the same code
+def _detect_hit(code):
+    """ detect a502f3f389b5 by inspecting variables of getfile()
+    """
+    return 'hit' in code.co_varnames[code.co_argcount:]
+def _new_tomemctx(tomemctx):
+    """ diving into tomemctx() to find and inspect the nested getfile()
+    """
+    return any(
+        _detect_hit(c) for c in tomemctx.__code__.co_consts
+        if util.safehasattr(c, 'co_varnames')
+    )
+if not _new_tomemctx(context.overlayworkingctx.tomemctx):
+    def fixed_tomemctx(
+        self,
+        text,
+        branch=None,
+        extra=None,
+        date=None,
+        parents=None,
+        user=None,
+        editor=None,
+    ):
+        """Converts this ``overlayworkingctx`` into a ``memctx`` ready to be
+        committed.
+
+        ``text`` is the commit message.
+        ``parents`` (optional) are rev numbers.
+        """
+        # Default parents to the wrapped context if not passed.
+        if parents is None:
+            parents = self.parents()
+            if len(parents) == 1:
+                parents = (parents[0], None)
+
+        # ``parents`` is passed as rev numbers; convert to ``commitctxs``.
+        if parents[1] is None:
+            parents = (self._repo[parents[0]], None)
+        else:
+            parents = (self._repo[parents[0]], self._repo[parents[1]])
+
+        files = self.files()
+
+        def getfile(repo, memctx, path):
+            hit = self._cache.get(path)
+            ### FIXED PART ###
+            if hit is None:
+                return self.filectx(path)
+            ### END FIXED PART ###
+            elif hit[b'exists']:
+                return context.memfilectx(
+                    repo,
+                    memctx,
+                    path,
+                    hit[b'data'],
+                    b'l' in hit[b'flags'],
+                    b'x' in hit[b'flags'],
+                    hit[b'copied'],
+                )
+            else:
+                # Returning None, but including the path in `files`, is
+                # necessary for memctx to register a deletion.
+                return None
+
+        if branch is None:
+            branch = self._wrappedctx.branch()
+
+        return context.memctx(
+            self._repo,
+            parents,
+            text,
+            files,
+            getfile,
+            date=date,
+            extra=extra,
+            user=user,
+            branch=branch,
+            editor=editor,
+        )
+
+    context.overlayworkingctx.tomemctx = fixed_tomemctx
+
 # what we're actually targeting here is e079e001d536
 # hg <= 5.0 (dc3fdd1b5af4)
 try:
--- a/hgext3rd/evolve/obscache.py	Wed Nov 27 17:48:38 2024 +0400
+++ b/hgext3rd/evolve/obscache.py	Fri Feb 07 12:29:33 2025 +0100
@@ -497,7 +497,8 @@
     wrapped = lambda repo: _computeobsoleteset(orig, repo)
     obsolete.cachefuncs[b'obsolete'] = wrapped
 
-    if util.versiontuple(n=3) < (6, 8, 2):
+    version = tuple(i if i is not None else 0 for i in util.versiontuple(n=3))
+    if version < (6, 8, 2):
         # e68fe567a780 was just before the 6.8.2 release
         # hg <= 6.8 (e68fe567a780)
         obsolete.cachefuncs[b'contentdivergent'] = _computecontentdivergentset
--- a/hgext3rd/evolve/obshistory.py	Wed Nov 27 17:48:38 2024 +0400
+++ b/hgext3rd/evolve/obshistory.py	Fri Feb 07 12:29:33 2025 +0100
@@ -369,9 +369,9 @@
         # For simplicity if both parents change, we currently only reflect the
         # impact on "p1" changeset. This should be improved at some point, but
         # this is good enough for now.
-        cand_ctx = _rebase_cand(repo, cand_ctx, nodep1, candp1)
+        cand_ctx = _rebase_cand(repo, cand_ctx, candp1, nodep1)
     elif nodep2 != candp2:
-        cand_ctx = _rebase_cand(repo, cand_ctx, nodep2, candp2)
+        cand_ctx = _rebase_cand(repo, cand_ctx, candp2, nodep2)
     if successive:
         return (node_ctx, cand_ctx)
     else:
@@ -392,7 +392,10 @@
         (b'ui', b'forcemerge'): b'internal:merge3-lie-about-conflicts'
     }
     with repo.ui.configoverride(configoverrides, b'obslog-diff'):
-        with repo.ui.silent():
+        # hg <= 5.8 (7a430116f639)
+        # this try-finally block can be replaced by ui.silent context manager
+        try:
+            repo.ui.pushbuffer()
             compat._update(
                 repo,
                 new_base,
@@ -406,6 +409,8 @@
                 wc=base,
                 ancestor=old_base,
             )
+        finally:
+            repo.ui.popbuffer()
     return base.tomemctx(text=ctx.description())
 
 def getmarkerdescriptionpatch(repo, basedesc, succdesc):
@@ -742,6 +747,8 @@
 
         try:
             actx, bctx = prepare_patch(repo, node, nodes, successive=successive)
+            assert actx is not None
+            assert bctx is not None
         except _NoPatchAvailable as exc:
             fm.data(nopatchreason=exc.reason)
         else:
@@ -773,7 +780,7 @@
             matchfn = scmutil.matchall(repo)
             firstline = True
             linestart = True
-            for chunk, label in patch.diffui(repo, actx.node(), bctx.node(),
+            for chunk, label in patch.diffui(repo, actx, bctx,
                                              matchfn, opts=diffopts):
                 if firstline:
                     ui.write(b'\n')
--- a/tests/test-evolve-phase-divergence.t	Wed Nov 27 17:48:38 2024 +0400
+++ b/tests/test-evolve-phase-divergence.t	Fri Feb 07 12:29:33 2025 +0100
@@ -1840,6 +1840,31 @@
   |      +
   |       E2
   |
+  |      diff -r 9eebcb77a7e2 letters
+  |      --- a/letters	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ b/letters	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,7 +1,7 @@
+  |       a
+  |       b
+  |       c
+  |      -D
+  |      +d
+  |       e
+  |       f
+  |       g
+  |      diff -r 9eebcb77a7e2 numbers
+  |      --- a/numbers	Thu Jan 01 00:00:00 1970 +0000
+  |      +++ b/numbers	Thu Jan 01 00:00:00 1970 +0000
+  |      @@ -1,7 +1,7 @@
+  |       1
+  |       2
+  |       3
+  |      -four
+  |      +4
+  |       5
+  |       6
+  |       seven
+  |
   |
   x  599454370881 (2) E2
   |    rewritten(description, content) from 3074c7249d20 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
--- a/tests/test-evolve-public-content-divergent-corner-cases.t	Wed Nov 27 17:48:38 2024 +0400
+++ b/tests/test-evolve-public-content-divergent-corner-cases.t	Fri Feb 07 12:29:33 2025 +0100
@@ -390,16 +390,15 @@
   |        +added c e
   |
   |        diff -r e568fd1029bb c
-  |        --- a/c	Thu Jan 01 00:00:00 1970 +0000
+  |        --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   |        +++ b/c	Thu Jan 01 00:00:00 1970 +0000
-  |        @@ -1,1 +1,1 @@
-  |        -c
+  |        @@ -0,0 +1,1 @@
   |        +cfoo
   |        diff -r e568fd1029bb d
   |        --- a/d	Thu Jan 01 00:00:00 1970 +0000
   |        +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   |        @@ -1,1 +0,0 @@
-  |        -dd
+  |        -d
   |        diff -r e568fd1029bb e
   |        --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   |        +++ b/e	Thu Jan 01 00:00:00 1970 +0000
--- a/tests/test-stack-split-s0.t	Wed Nov 27 17:48:38 2024 +0400
+++ b/tests/test-stack-split-s0.t	Fri Feb 07 12:29:33 2025 +0100
@@ -44,8 +44,7 @@
   created new head
   (consider using topic for lightweight branches. See 'hg help topic')
 
-  $ hg --config extensions.evolve= prune --split --rev 'desc(A)' \
-  >    --successor 'desc(X)' --successor 'desc(Y)'
+  $ hg prune --split --rev 'desc(A)' --successor 'desc(X)' --successor 'desc(Y)'
   1 changesets pruned
   3 new orphan changesets