changeset 6469:76716ec978da mercurial-5.3

test-compat: merge mercurial-5.4 into mercurial-5.3
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 21 Mar 2023 22:34:59 -0300
parents 7130a8bdb2c6 (current diff) 0c344cc1f6db (diff)
children 8c11ab988e2a 39d4c87b579e
files tests/test-evolve-abort-orphan.t tests/test-evolve-interrupted.t
diffstat 16 files changed, 81 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/.gitlab/issue_templates/new-version.md	Sat Feb 25 11:41:07 2023 +0400
+++ b/.gitlab/issue_templates/new-version.md	Tue Mar 21 22:34:59 2023 -0300
@@ -20,6 +20,7 @@
 * [ ] 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
 * [ ] add `.dev0` to the `__version__` field
 * [ ] merge stable into default
 * [ ] push the result to https://www.mercurial-scm.org/repo/evolve/
--- a/.hgtags	Sat Feb 25 11:41:07 2023 +0400
+++ b/.hgtags	Tue Mar 21 22:34:59 2023 -0300
@@ -103,3 +103,4 @@
 7a7da643a6e302f524e3c96c084e16db371dea90 10.5.2
 569e09c61c4f0f78b5bb581b02583fc7139470d7 10.5.3
 6b128ae8e2ade0b781eb8c0f7411db3f090d26f7 11.0.0rc0
+eb221b2c1f8196effb48a61d9d83565b878308fd 11.0.0
--- a/CHANGELOG	Sat Feb 25 11:41:07 2023 +0400
+++ b/CHANGELOG	Tue Mar 21 22:34:59 2023 -0300
@@ -1,7 +1,16 @@
 Changelog
 =========
 
-11.0.0 - in progress
+11.0.1 - in progress
+--------------------
+
+  * compatibility with Mercurial 6.4
+
+topic (1.0.1)
+
+  * compatibility with Mercurial 6.4
+
+11.0.0 -- 2023-02-26
 --------------------
 
   * packaging: list all contributors in debian/copyright
--- a/Makefile	Sat Feb 25 11:41:07 2023 +0400
+++ b/Makefile	Tue Mar 21 22:34:59 2023 -0300
@@ -25,7 +25,7 @@
 
 .PHONY: install-home
 install-home:
-	$(PYTHON) setup.py install --home="$(HOME)" --prefix="" --force
+	$(PYTHON) setup.py install --home="$(HOME)" --prefix="" --force --old-and-unmanageable --single-version-externally-managed
 
 .PHONY: doc
 doc:
--- a/README.rst	Sat Feb 25 11:41:07 2023 +0400
+++ b/README.rst	Tue Mar 21 22:34:59 2023 -0300
@@ -261,6 +261,8 @@
 
 * upload the tarball to PyPI,
 
+* build .deb on Heptapod CI for the tagged commit,
+
 * make an announcement on evolve-testers@mercurial-scm.org and
   mercurial@mercurial-scm.org,
 
--- a/debian/changelog	Sat Feb 25 11:41:07 2023 +0400
+++ b/debian/changelog	Tue Mar 21 22:34:59 2023 -0300
@@ -1,3 +1,9 @@
+mercurial-evolve (11.0.0-1) unstable; urgency=medium
+
+  * new upstream release
+
+ -- Anton Shestakov <av6@dwimlabs.net>  Sun, 26 Feb 2023 22:30:11 +0400
+
 mercurial-evolve (11.0.0rc0-1) unstable; urgency=medium
 
   * new upstream release
--- a/hgext3rd/evolve/cmdrewrite.py	Sat Feb 25 11:41:07 2023 +0400
+++ b/hgext3rd/evolve/cmdrewrite.py	Tue Mar 21 22:34:59 2023 -0300
@@ -1007,13 +1007,23 @@
                     # changed
                     changedfiles.extend(repo[rev].files())
 
+                need_write = True
+                if util.safehasattr(repo.dirstate, 'changing_parents'):
+                    changing_parents = repo.dirstate.changing_parents(repo)
+                else:
+                    # hg <= 6.3 (7a8bfc05b691)
+                    need_write = False
+                    changing_parents = util.nullcontextmanager()
+
                 # reset files that only changed in the dirstate too
                 dirstate = repo.dirstate
                 dirchanges = compat.dirchanges(dirstate)
                 changedfiles.extend(dirchanges)
-                repo.dirstate.rebuild(newnode.node(), newnode.manifest(),
-                                      changedfiles)
-                dirstate.write(tr)
+                with changing_parents:
+                    repo.dirstate.rebuild(newnode.node(), newnode.manifest(),
+                                          changedfiles)
+                if need_write:
+                    dirstate.write(tr)
             else:
                 bookactive = repo._activebookmark
                 # Active bookmark that we don't want to delete (with -B option)
@@ -1143,7 +1153,7 @@
 
         # Set the right branch
         # XXX-TODO: Find a way to set the branch without altering the dirstate
-        repo.dirstate.setbranch(ctx.branch())
+        compat.setbranch(repo, ctx.branch())
 
         if pats:
             # refresh the wctx used for the matcher
@@ -1242,7 +1252,7 @@
         tr.close()
     finally:
         # Restore the old branch
-        repo.dirstate.setbranch(savedbranch)
+        compat.setbranch(repo, savedbranch)
 
         lockmod.release(tr, lock, wlock)
 
@@ -1411,7 +1421,7 @@
         newnode = repo.commit(text=origctx.description(),
                               user=origctx.user(),
                               date=origctx.date(), extra=origctx.extra())
-    repo.dirstate.setbranch(origctx.branch())
+    compat.setbranch(repo, origctx.branch())
 
     if pickstate:
         pickstate.delete()
--- a/hgext3rd/evolve/compat.py	Sat Feb 25 11:41:07 2023 +0400
+++ b/hgext3rd/evolve/compat.py	Tue Mar 21 22:34:59 2023 -0300
@@ -529,6 +529,15 @@
 
     context.overlayworkingctx._markdirty = fixedmarkdirty
 
+def setbranch(repo, branch):
+    # this attribute was introduced at about the same time dirstate.setbranch()
+    # was modified
+    # hg <= 6.3 (e9379b55ed80)
+    if util.safehasattr(dirstate, 'requires_changing_files_or_status'):
+        repo.dirstate.setbranch(branch, repo.currenttransaction())
+    else:
+        repo.dirstate.setbranch(branch)
+
 if util.safehasattr(dirstate.dirstate, 'get_entry'):
     def dirchanges(dirstate):
         return [
--- a/hgext3rd/evolve/evolvecmd.py	Sat Feb 25 11:41:07 2023 +0400
+++ b/hgext3rd/evolve/evolvecmd.py	Tue Mar 21 22:34:59 2023 -0300
@@ -791,7 +791,7 @@
             # preserved
             pass
         elif basebranch == divbranch and basebranch != othbranch:
-            repo.dirstate.setbranch(othbranch)
+            compat.setbranch(repo, othbranch)
         else:
             # all the three branches are different
             index = repo.ui.promptchoice(_(b"content divergent changesets on "
@@ -802,11 +802,11 @@
                                          (basebranch, divbranch, othbranch), 0)
 
             if index == 0:
-                repo.dirstate.setbranch(basebranch)
+                compat.setbranch(repo, basebranch)
             elif index == 1:
                 pass
             elif index == 2:
-                repo.dirstate.setbranch(othbranch)
+                compat.setbranch(repo, othbranch)
 
 def mergecommitmessages(ui, basedesc, divdesc, othdesc):
     """merges the commit messages and return the new merged message and whether
@@ -999,7 +999,7 @@
     if repo[b'.'].rev() != dest.rev():
         compat._update(repo, dest, branchmerge=False, force=True)
     if keepbranch:
-        repo.dirstate.setbranch(orig.branch())
+        compat.setbranch(repo, orig.branch())
     if util.safehasattr(repo, 'currenttopic'):
         # uurrgs
         # there no other topic setter yet
--- a/hgext3rd/evolve/metadata.py	Sat Feb 25 11:41:07 2023 +0400
+++ b/hgext3rd/evolve/metadata.py	Tue Mar 21 22:34:59 2023 -0300
@@ -5,7 +5,7 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-__version__ = b'11.0.0.dev0'
-testedwith = b'4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3'
+__version__ = b'11.0.1.dev0'
+testedwith = b'4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4'
 minimumhgversion = b'4.8'
 buglink = b'https://bz.mercurial-scm.org/'
--- a/hgext3rd/evolve/rewind.py	Sat Feb 25 11:41:07 2023 +0400
+++ b/hgext3rd/evolve/rewind.py	Tue Mar 21 22:34:59 2023 -0300
@@ -159,12 +159,19 @@
                         # changed
                         changedfiles.extend(ctx.files())
 
+                    if util.safehasattr(repo.dirstate, 'changing_parents'):
+                        changing_parents = repo.dirstate.changing_parents(repo)
+                    else:
+                        # hg <= 6.3 (7a8bfc05b691)
+                        changing_parents = util.nullcontextmanager()
+
                     # reset files that only changed in the dirstate too
                     dirstate = repo.dirstate
                     dirchanges = compat.dirchanges(dirstate)
                     changedfiles.extend(dirchanges)
-                    repo.dirstate.rebuild(newctx.node(), newctx.manifest(),
-                                          changedfiles)
+                    with changing_parents:
+                        repo.dirstate.rebuild(newctx.node(), newctx.manifest(),
+                                              changedfiles)
 
                     # TODO: implement restoration of copies/renames
                     # Ideally this step should be handled by dirstate.rebuild
--- a/hgext3rd/evolve/rewriteutil.py	Sat Feb 25 11:41:07 2023 +0400
+++ b/hgext3rd/evolve/rewriteutil.py	Tue Mar 21 22:34:59 2023 -0300
@@ -23,6 +23,7 @@
     node,
     obsolete,
     obsutil,
+    pycompat,
     revset,
     rewriteutil as corerewriteutil,
     scmutil,
@@ -60,12 +61,11 @@
     <action> can be used to control the commit message.
     """
     # hg <= 6.1 (d4752aeb20f1)
-    code = corerewriteutil.precheck.__code__
-    if r'check_divergence' in code.co_varnames[:code.co_argcount]:
+    args = pycompat.getargspec(corerewriteutil.precheck).args
+    if r'check_divergence' in args:
         return corerewriteutil.precheck(repo, revs, action,
                                         check_divergence=check_divergence)
 
-    # hg <= 5.8 (d90f6237)
     if node.nullrev in revs:
         msg = _(b"cannot %s the null revision") % (action)
         hint = _(b"no changeset checked out")
--- a/hgext3rd/topic/__init__.py	Sat Feb 25 11:41:07 2023 +0400
+++ b/hgext3rd/topic/__init__.py	Tue Mar 21 22:34:59 2023 -0300
@@ -233,9 +233,9 @@
               b'log.topic': b'green_background',
               }
 
-__version__ = b'1.0.0.dev0'
+__version__ = b'1.0.1.dev0'
 
-testedwith = b'4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3'
+testedwith = b'4.8 4.9 5.0 5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1 6.2 6.3 6.4'
 minimumhgversion = b'4.8'
 buglink = b'https://bz.mercurial-scm.org/'
 
--- a/tests/test-evolve-abort-orphan.t	Sat Feb 25 11:41:07 2023 +0400
+++ b/tests/test-evolve-abort-orphan.t	Tue Mar 21 22:34:59 2023 -0300
@@ -569,10 +569,11 @@
   last-message.txt
   requires
   store
-  undo.backup.bookmarks
+  undo.backup.bookmarks (no-hg64 !)
+  undo.backup.branch (hg64 !)
   undo.backup.dirstate
-  undo.bookmarks
-  undo.branch
+  undo.bookmarks (no-hg64 !)
+  undo.branch (no-hg64 !)
   undo.desc
-  undo.dirstate
+  undo.dirstate (no-hg64 !)
   wcache
--- a/tests/test-evolve-interrupted.t	Sat Feb 25 11:41:07 2023 +0400
+++ b/tests/test-evolve-interrupted.t	Tue Mar 21 22:34:59 2023 -0300
@@ -45,8 +45,8 @@
   $ hg evolve --update --config hooks.precommit=false --config ui.merge=:other
   move:[1] banana
   atop:[2] apricot and blueberry
-  transaction abort!
-  rollback completed
+  transaction abort! (no-hg64 !)
+  rollback completed (no-hg64 !)
   abort: precommit hook exited with status 1
   [255]
   $ hg l
@@ -104,8 +104,8 @@
   $ hg evolve --update --config hooks.precommit=false --config ui.merge=:other
   move:[1] banana
   atop:[2] apricot and blueberry
-  transaction abort!
-  rollback completed
+  transaction abort! (no-hg64 !)
+  rollback completed (no-hg64 !)
   abort: precommit hook exited with status 1
   [255]
   $ cat b
@@ -129,8 +129,8 @@
   $ hg evolve --update --config hooks.precommit=false --config ui.merge=:other
   move:[1] banana
   atop:[2] apricot and blueberry
-  transaction abort!
-  rollback completed
+  transaction abort! (no-hg64 !)
+  rollback completed (no-hg64 !)
   abort: precommit hook exited with status 1
   [255]
   $ hg evolve --continue
--- a/tests/test-evolve-stop-orphan.t	Sat Feb 25 11:41:07 2023 +0400
+++ b/tests/test-evolve-stop-orphan.t	Tue Mar 21 22:34:59 2023 -0300
@@ -177,11 +177,12 @@
   last-message.txt
   requires
   store
+  undo.backup.branch (hg64 !)
   undo.backup.dirstate
-  undo.bookmarks
-  undo.branch
+  undo.bookmarks (no-hg64 !)
+  undo.branch (no-hg64 !)
   undo.desc
-  undo.dirstate
+  undo.dirstate (no-hg64 !)
   wcache
 
 Checking when multiple revs need to be evolved, some revs evolve without