changeset 6253:8643272ade4c mercurial-5.3

test-compat: merge mercurial-5.4 into mercurial-5.3
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 26 Apr 2022 10:36:29 +0400
parents bb7cead02a23 (diff) b8a1743e7ff9 (current diff)
children c442d967ad15 fbf0e66d3709
files .gitlab-ci.yml
diffstat 16 files changed, 230 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/.gitlab-ci.yml	Tue Feb 22 08:57:39 2022 +0300
+++ b/.gitlab-ci.yml	Tue Apr 26 10:36:29 2022 +0400
@@ -10,13 +10,13 @@
     script:
         - *prepare_hg
         - pytype --version
-        - jobs=$(python -c 'import multiprocessing; print multiprocessing.cpu_count()')
+        - jobs=$(python3 -c 'import multiprocessing; print(multiprocessing.cpu_count())')
         - pytype -P /ci/repos/mercurial/:hgext3rd -k hgext3rd -x hgext3rd/evolve/thirdparty -j $jobs || true
     when: manual
 
 variables:
-    PY: py2
-    PYTHON: python
+    PY: py3
+    PYTHON: python3
     RUNTEST_ARGS: ""
     TEST_HGMODULEPOLICY: "allow"
 
@@ -32,67 +32,43 @@
 checks-py2:
     <<: *runtests
     variables:
+        PY: py2
+        PYTHON: python2
         RUNTEST_ARGS: "--test-list /tmp/check-tests.txt"
 
 checks-py3:
     <<: *runtests
     variables:
-        PY: py3
-        PYTHON: python3
         RUNTEST_ARGS: "--test-list /tmp/check-tests.txt"
 
 tests-py2-cext:
     <<: *runtests
     variables:
+        PY: py2
+        PYTHON: python2
         RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt"
         TEST_HGMODULEPOLICY: "c"
 
 tests-py2-pure:
     <<: *runtests
     variables:
+        PY: py2
+        PYTHON: python2
         RUNTEST_ARGS: "--pure --blacklist /tmp/check-tests.txt"
         TEST_HGMODULEPOLICY: "py"
 
 tests-py3-cext:
     <<: *runtests
     variables:
-        PY: py3
-        PYTHON: python3
         RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt"
         TEST_HGMODULEPOLICY: "c"
 
 tests-py3-pure:
     <<: *runtests
     variables:
-        PY: py3
-        PYTHON: python3
         RUNTEST_ARGS: "--pure --blacklist /tmp/check-tests.txt"
         TEST_HGMODULEPOLICY: "py"
 
-doc:
-    image: registry.heptapod.net/mercurial/ci-images/py3-evolve-doc
-    script:
-        - make doc
-    variables:
-        LANG: en_US.UTF-8
-        PYTHON: python3
-        PYTHONPATH: "/ci/repos/mercurial:$PYTHONPATH"
-        SPHINXBUILD: python3 -m sphinx -b html
-    artifacts:
-        paths:
-            - html/*
-
-sdist:
-    stage: .post
-    image: registry.heptapod.net/mercurial/ci-images/py3-hgext3rd
-    script:
-        - python3 setup.py sdist
-    artifacts:
-        paths:
-            - dist/*
-    only:
-        - tags
-
 .windows_runtests_template: &windows_runtests
     before_script:
         - C:/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.t > C:/Temp/check-tests.txt'
--- a/.hgtags	Tue Feb 22 08:57:39 2022 +0300
+++ b/.hgtags	Tue Apr 26 10:36:29 2022 +0400
@@ -98,3 +98,4 @@
 cca465bf6a6a103449aa58deecdffba8e546f7c6 10.3.3
 de530d27554b43c00509696dc7a1496f5129e1a4 10.4.0
 64bb9c4a13d388233d4d6d9b761ece9c6ce77fb3 10.4.1
+0d53a8d4170b32d03e4fd8582b32fe2790d5e34f 10.5.0
--- a/CHANGELOG	Tue Feb 22 08:57:39 2022 +0300
+++ b/CHANGELOG	Tue Apr 26 10:36:29 2022 +0400
@@ -1,9 +1,22 @@
 Changelog
 =========
 
-10.5.0 - in progress
+10.5.1 - in progress
 --------------------
 
+  * evolve: avoid updating working copy when --dry-run is given (issue6669)
+  * evolve: correctly pick successors of a split changeset when its child was
+    pruned (issue6648)
+  * fixup: allow to be aborted using hg abort
+  * fixup: work correctly with bookmarks
+
+  * packaging: allow to unvendor cbor, update debian/copyright
+
+10.5.0 -- 2022-02-23
+--------------------
+
+  * compatibility with Mercurial 6.1
+
   * evolve: handle cases when working directory parent has multiple successors
   * multiple commands: do not check for new divergence if divergence is allowed
     via configuration
@@ -15,6 +28,8 @@
 
 topic (0.24.0)
 
+  * compatibility with Mercurial 6.1
+
   * topic: make histedit preserve topics when the first changeset in a stack
     is rewritten (issue6550)
 
--- a/debian/changelog	Tue Feb 22 08:57:39 2022 +0300
+++ b/debian/changelog	Tue Apr 26 10:36:29 2022 +0400
@@ -1,3 +1,9 @@
+mercurial-evolve (10.5.0-1) unstable; urgency=medium
+
+  * new upstream release
+
+ -- Anton Shestakov <av6@dwimlabs.net>  Wed, 23 Feb 2022 17:41:26 +0300
+
 mercurial-evolve (10.4.1-1) unstable; urgency=medium
 
   * new upstream release
--- a/debian/copyright	Tue Feb 22 08:57:39 2022 +0300
+++ b/debian/copyright	Tue Apr 26 10:36:29 2022 +0400
@@ -1,15 +1,49 @@
-This software was downloaded from
-https://www.mercurial-scm.org/repo/evolve/
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: evolve
+Source: https://www.mercurial-scm.org/repo/evolve/
+
+Files: *
+Copyright:
+ 2011—2022 Pierre-Yves David <pierre-yves.david@octobus.net>
+           Anton Shestakov <av6@dwimlabs.net>
+           and others
+License: GPL-2+
 
-Copyright 2011 Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
-               Logilab SA        <contact@logilab.fr>
-               Pierre-Yves David <pierre-yves.david@ens-lyon.org>
-	       Patrick Mezard <patrick@mezard.eu>
+Files: debian/*
+Copyright:
+ 2011-2022 Anton Shestakov <av6@dwimlabs.net>
+           Pierre-Yves David <pierre-yves.david@octobus.net>
+           Faheem Mitha <faheem@faheem.info>
+           Julien Cristau <julien.cristau@logilab.fr>
+           Georges Racinet <georges.racinet@octobus.net>
+           Denis Laxalde <denis@laxalde.org>
+           Kim Alvefur <zash@zash.se>
+           Martin von Zweigbergk <martinvonz@google.com>
+           Laurent Charignon <lcharignon@fb.com>
+           Philippe Pepiot <philippe.pepiot@logilab.fr>
+           Logilab SA <contact@logilab.fr>
+License: GPL-2+
 
+License: GPL-2+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+ .
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ .
+ On Debian systems, the complete text of the GNU General Public License
+ version 2 can be found in ‘/usr/share/common-licenses/GPL-2’.
 
 This software may be used and distributed according to the terms of the GNU
 General Public License version 2 or any later version.
 
 On Debian systems, the complete text of the GNU General Public License version
 2 can be found in `/usr/share/common-licenses/GPL-2'.
-
--- a/hgext3rd/evolve/__init__.py	Tue Feb 22 08:57:39 2022 +0300
+++ b/hgext3rd/evolve/__init__.py	Tue Apr 26 10:36:29 2022 +0400
@@ -1173,7 +1173,8 @@
         _fixup_msg = _(b'To continue:    hg fixup --continue\n'
                        b'To abort:       hg fixup --abort\n')
         statemod.addunfinished(b'fixup', fname=b'fixup-state',
-                               continueflag=True, statushint=_fixup_msg)
+                               continueflag=True, statushint=_fixup_msg,
+                               abortfunc=cmdrewrite.hgabortfixup)
     else:
         # hg <= 5.0 (5f2f6912c9e6)
         estate = (b'evolvestate', False, False, _(b'evolve in progress'),
--- a/hgext3rd/evolve/cmdrewrite.py	Tue Feb 22 08:57:39 2022 +0300
+++ b/hgext3rd/evolve/cmdrewrite.py	Tue Apr 26 10:36:29 2022 +0400
@@ -1509,7 +1509,10 @@
         raise error.Abort(_(b'please specify a revision to fixup'))
     target_ctx = scmutil.revsingle(repo, node)
 
-    fixup_state[b'startnode'] = repo[b'.'].node()
+    fixup_state.addopts({
+        b'bookmarkchanges': [],
+        b'startnode': repo[b'.'].node(),
+    })
 
     tr = repo.transaction(b'fixup')
     with util.acceptintervention(tr):
@@ -1594,3 +1597,10 @@
     ui.status(_(b'working directory is now at %s\n') % pctx)
     fixup_state.delete()
     return 0
+
+def hgabortfixup(ui, repo):
+    """logic to abort fixup using 'hg abort'"""
+    with repo.wlock(), repo.lock():
+        fixup_state = state.cmdstate(repo, path=b'fixup-state')
+        fixup_state.load()
+        return abortfixup(ui, repo, fixup_state)
--- a/hgext3rd/evolve/evolvecmd.py	Tue Feb 22 08:57:39 2022 +0300
+++ b/hgext3rd/evolve/evolvecmd.py	Tue Apr 26 10:36:29 2022 +0400
@@ -133,7 +133,7 @@
             ui.write_err(msg)
             return (False, b".")
         if exc.splitflag:
-            splitsucc = utility.select_split_successor(ui, repo, obs)
+            splitsucc = utility.select_split_successor(ui, repo, repo[exc.rev])
             if not splitsucc:
                 msg = _(b"could not solve instability, "
                         b"ambiguous destination: "
@@ -1768,7 +1768,8 @@
         if showprogress:
             progress.complete()
 
-    _cleanup(ui, repo, startnode, shouldupdate, headnode)
+    if not dryrunopt:
+        _cleanup(ui, repo, startnode, shouldupdate, headnode)
 
 def _solveonerev(ui, repo, rev, evolvestate, activetopic, dryrunopt, confirmopt,
                  progresscb, targetcat):
@@ -1822,7 +1823,7 @@
         ctx = repo[utility._singlesuccessor(repo, oldctx)]
     except utility.MultipleSuccessorsError as exc:
         if exc.splitflag:
-            splitsucc = utility.select_split_successor(ui, repo, oldctx)
+            splitsucc = utility.select_split_successor(ui, repo, repo[exc.rev])
             if splitsucc:
                 ctx = repo[splitsucc]
             else:
--- a/hgext3rd/evolve/metadata.py	Tue Feb 22 08:57:39 2022 +0300
+++ b/hgext3rd/evolve/metadata.py	Tue Apr 26 10:36:29 2022 +0400
@@ -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'10.5.0.dev'
-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'
+__version__ = b'10.5.1.dev'
+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'
 minimumhgversion = b'4.8'
 buglink = b'https://bz.mercurial-scm.org/'
--- a/hgext3rd/evolve/state.py	Tue Feb 22 08:57:39 2022 +0300
+++ b/hgext3rd/evolve/state.py	Tue Apr 26 10:36:29 2022 +0400
@@ -19,7 +19,14 @@
 import errno
 import struct
 
-from .thirdparty import cbor
+# use the vendored cbor if available, and if not, try and
+# use an externally provided one (would typically be the case
+# with distribution packages)
+try:
+    from .thirdparty import cbor
+    cbor.__doc__  # trigger ImportError immediately
+except ImportError:
+    import cbor
 
 from mercurial import (
     error,
--- a/hgext3rd/evolve/utility.py	Tue Feb 22 08:57:39 2022 +0300
+++ b/hgext3rd/evolve/utility.py	Tue Apr 26 10:36:29 2022 +0400
@@ -70,12 +70,14 @@
     """Exception raised by _singlesuccessor() when multiple successor sets exists
 
     Attributes:
+        rev               the revision that has multiple successor sets
         successorssets    the list of successorssets to call to easily recover
         divergenceflag    indicate that changeset has divergent rewriting
         splitflag         indicate that changeset was split
     """
 
-    def __init__(self, successorssets):
+    def __init__(self, rev, successorssets):
+        self.rev = rev
         self.successorssets = successorssets
         self.divergenceflag = len(successorssets) > 1
         self.splitflag = len(successorssets[0]) > 1
@@ -124,7 +126,7 @@
         obs = obs.p1()
         newer = obsutil.successorssets(repo, obs.node(), cache=cache)
     if len(newer) > 1 or len(newer[0]) > 1:
-        raise MultipleSuccessorsError(newer)
+        raise MultipleSuccessorsError(obs.rev(), newer)
 
     return repo[newer[0][0]].rev()
 
--- a/hgext3rd/pullbundle.py	Tue Feb 22 08:57:39 2022 +0300
+++ b/hgext3rd/pullbundle.py	Tue Apr 26 10:36:29 2022 +0400
@@ -92,8 +92,8 @@
 
 from mercurial.i18n import _
 
-__version__ = b'0.1.3.dev'
-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'
+__version__ = b'0.1.4.dev'
+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'
 minimumhgversion = b'4.8'
 buglink = b'https://bz.mercurial-scm.org/'
 
--- a/hgext3rd/topic/__init__.py	Tue Feb 22 08:57:39 2022 +0300
+++ b/hgext3rd/topic/__init__.py	Tue Apr 26 10:36:29 2022 +0400
@@ -231,9 +231,9 @@
               b'log.topic': b'green_background',
               }
 
-__version__ = b'0.24.0.dev'
+__version__ = b'0.24.1.dev'
 
-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'
+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'
 minimumhgversion = b'4.8'
 buglink = b'https://bz.mercurial-scm.org/'
 
--- a/tests/test-check-sdist.t	Tue Feb 22 08:57:39 2022 +0300
+++ b/tests/test-check-sdist.t	Tue Apr 26 10:36:29 2022 +0400
@@ -35,7 +35,7 @@
 
   $ tar -tzf hg-evolve-*.tar.gz | sed 's|^hg-evolve-[^/]*/||' | sort > files
   $ wc -l files
-  355 files
+  356 files
   $ fgrep debian files
   tests/test-check-debian.t
   $ fgrep __init__.py files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-evolve-issue6648.t	Tue Apr 26 10:36:29 2022 +0400
@@ -0,0 +1,87 @@
+Finding split successors for the correct ancestor (issue6648)
+https://bz.mercurial-scm.org/show_bug.cgi?id=6648
+
+  $ . $TESTDIR/testlib/common.sh
+
+  $ cat << EOF >> $HGRCPATH
+  > [extensions]
+  > evolve =
+  > EOF
+
+  $ hg init issue6648
+  $ cd issue6648
+
+  $ echo hi > foo
+  $ hg commit -qAm 'r0'
+  $ echo foo >> foo
+  $ echo foo >> foosplit
+  $ hg commit -qAm 'r1_splitme'
+  $ echo bar > bar
+  $ hg commit -qAm 'r2_obsoleteme'
+  $ echo baz > baz
+  $ hg commit -qAm 'r3'
+
+  $ hg prune -r 2
+  1 changesets pruned
+  1 new orphan changesets
+  $ hg split -r 1 --no-interactive foosplit
+  1 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  reverting foo
+  adding foosplit
+  created new head
+  no more changes to split
+
+  $ hg update -r 2
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  working directory parent is obsolete! (5c9b6cf2edc5)
+  (use 'hg evolve' to update to its parent successor)
+
+  $ hg log -G
+  o  changeset:   5:983ec6453b57
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     r1_splitme
+  |
+  o  changeset:   4:9ca7a4996099
+  |  parent:      0:e9326971c0ba
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     r1_splitme
+  |
+  | *  changeset:   3:c1e686af368d
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  instability: orphan
+  | |  summary:     r3
+  | |
+  | @  changeset:   2:5c9b6cf2edc5
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  obsolete:    pruned using prune
+  | |  summary:     r2_obsoleteme
+  | |
+  | x  changeset:   1:acdff8eea54c
+  |/   user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    obsolete:    split using split as 4:9ca7a4996099, 5:983ec6453b57
+  |    summary:     r1_splitme
+  |
+  o  changeset:   0:e9326971c0ba
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     r0
+  
+
+handling obsolete wdp works
+
+  $ hg evolve
+  update:[5] r1_splitme
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  working directory is now at 983ec6453b57
+
+stabilizing the orphan works
+
+  $ hg evolve
+  move:[3] r3
+  atop:[5] r1_splitme
--- a/tests/test-fixup.t	Tue Feb 22 08:57:39 2022 +0300
+++ b/tests/test-fixup.t	Tue Apr 26 10:36:29 2022 +0400
@@ -56,8 +56,10 @@
 amending the middle of the stack
 --------------------------------
 
+  $ hg bookmark bm
   $ echo 'hookah bar' > bar
   $ hg fixup -r 'desc(bar)'
+  (leaving bookmark bm)
   1 new orphan changesets
 
   $ hg diff -c tip
@@ -70,7 +72,7 @@
 
   $ hg glog
   o  5:2eec5320cfc7 bar
-  |   () draft
+  |   (bm) draft
   | @  3:fd2f632e47ab temporary fixup commit
   | |   () draft
   | *  2:a425495a8e64 baz
@@ -82,7 +84,7 @@
 
   $ hg glog --hidden
   o  5:2eec5320cfc7 bar
-  |   () draft
+  |   (bm) draft
   | x  4:4869c1db2884 temporary fixup commit
   | |   () draft
   | | @  3:fd2f632e47ab temporary fixup commit
@@ -94,6 +96,17 @@
   o  0:e63c23eaa88a foo
       () draft
 
+using --dry-run should only print actions (issue6669)
+
+  $ hg evolve --dry-run
+  update:[5] bar
+
+  $ hg evolve --dry-run --any
+  update:[5] bar
+  move:[2] baz
+  atop:[5] bar
+  hg rebase -r a425495a8e64 -d 2eec5320cfc7
+
   $ hg evolve
   update:[5] bar
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
@@ -107,7 +120,7 @@
   o  6:eb1755d9f810 baz
   |   () draft
   @  5:2eec5320cfc7 bar
-  |   () draft
+  |   (bm) draft
   o  0:e63c23eaa88a foo
       () draft
 
@@ -128,7 +141,7 @@
   @  9:12b5e442244f baz
   |   () secret
   o  5:2eec5320cfc7 bar
-  |   () draft
+  |   (bm) draft
   o  0:e63c23eaa88a foo
       () draft
 
@@ -149,7 +162,7 @@
   | @  9:12b5e442244f baz
   | |   () secret
   | o  5:2eec5320cfc7 bar
-  |/    () draft
+  |/    (bm) draft
   o  0:e63c23eaa88a foo
       () draft
 
@@ -188,6 +201,19 @@
    foo
   +update foo again
 
+testing abort command
+
+  $ hg fixup -r 'desc("update foo")'
+  merging foo
+  warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
+  unresolved merge conflicts
+  (see 'hg help evolve.interrupted')
+  [1]
+
+  $ hg abort
+  fixup aborted
+  working directory is now at 12b5e442244f
+
 testing --continue flag
 
   $ hg fixup -r 'desc("update foo")'
@@ -236,7 +262,7 @@
   | o  9:12b5e442244f baz
   | |   () secret
   | o  5:2eec5320cfc7 bar
-  |/    () draft
+  |/    (bm) draft
   o  0:e63c23eaa88a foo
       () draft
 
@@ -260,7 +286,7 @@
   | | o  13:fed7e534b3bb update foo
   | |/    () draft
   o |  5:2eec5320cfc7 bar
-  |/    () draft
+  |/    (bm) draft
   o  0:e63c23eaa88a foo
       () draft
 
@@ -275,7 +301,7 @@
   | o  13:fed7e534b3bb update foo
   | |   () draft
   o |  5:2eec5320cfc7 bar
-  |/    () draft
+  |/    (bm) draft
   o  0:e63c23eaa88a foo
       () draft
   $ hg diff -c .