# HG changeset patch # User Anton Shestakov # Date 1650958324 -14400 # Node ID 8ca52c4f08aa61e792f2c7833626130cbdeacfc5 # Parent 314682992f7d0be86a51db8fb7de36ec6adfb771# Parent 4c0d0be7cf9550cbb5019251f641dfe872655dc1 test-compat: merge mercurial-5.0 into mercurial-4.9 diff -r 4c0d0be7cf95 -r 8ca52c4f08aa .gitlab-ci.yml --- a/.gitlab-ci.yml Tue Feb 22 23:57:06 2022 +0300 +++ b/.gitlab-ci.yml Tue Apr 26 11:32:04 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,16 +32,22 @@ checks-py2: <<: *runtests variables: + PY: py2 + PYTHON: python2 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" diff -r 4c0d0be7cf95 -r 8ca52c4f08aa .hgtags --- a/.hgtags Tue Feb 22 23:57:06 2022 +0300 +++ b/.hgtags Tue Apr 26 11:32:04 2022 +0400 @@ -98,3 +98,4 @@ cca465bf6a6a103449aa58deecdffba8e546f7c6 10.3.3 de530d27554b43c00509696dc7a1496f5129e1a4 10.4.0 64bb9c4a13d388233d4d6d9b761ece9c6ce77fb3 10.4.1 +0d53a8d4170b32d03e4fd8582b32fe2790d5e34f 10.5.0 diff -r 4c0d0be7cf95 -r 8ca52c4f08aa CHANGELOG --- a/CHANGELOG Tue Feb 22 23:57:06 2022 +0300 +++ b/CHANGELOG Tue Apr 26 11:32:04 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) diff -r 4c0d0be7cf95 -r 8ca52c4f08aa debian/changelog --- a/debian/changelog Tue Feb 22 23:57:06 2022 +0300 +++ b/debian/changelog Tue Apr 26 11:32:04 2022 +0400 @@ -1,3 +1,9 @@ +mercurial-evolve (10.5.0-1) unstable; urgency=medium + + * new upstream release + + -- Anton Shestakov Wed, 23 Feb 2022 17:41:26 +0300 + mercurial-evolve (10.4.1-1) unstable; urgency=medium * new upstream release diff -r 4c0d0be7cf95 -r 8ca52c4f08aa debian/copyright --- a/debian/copyright Tue Feb 22 23:57:06 2022 +0300 +++ b/debian/copyright Tue Apr 26 11:32:04 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 + Anton Shestakov + and others +License: GPL-2+ -Copyright 2011 Peter Arrenbrecht - Logilab SA - Pierre-Yves David - Patrick Mezard +Files: debian/* +Copyright: + 2011-2022 Anton Shestakov + Pierre-Yves David + Faheem Mitha + Julien Cristau + Georges Racinet + Denis Laxalde + Kim Alvefur + Martin von Zweigbergk + Laurent Charignon + Philippe Pepiot + Logilab SA +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'. - diff -r 4c0d0be7cf95 -r 8ca52c4f08aa hgext3rd/evolve/__init__.py --- a/hgext3rd/evolve/__init__.py Tue Feb 22 23:57:06 2022 +0300 +++ b/hgext3rd/evolve/__init__.py Tue Apr 26 11:32:04 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'), diff -r 4c0d0be7cf95 -r 8ca52c4f08aa hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Tue Feb 22 23:57:06 2022 +0300 +++ b/hgext3rd/evolve/cmdrewrite.py Tue Apr 26 11:32:04 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) diff -r 4c0d0be7cf95 -r 8ca52c4f08aa hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Tue Feb 22 23:57:06 2022 +0300 +++ b/hgext3rd/evolve/evolvecmd.py Tue Apr 26 11:32:04 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: diff -r 4c0d0be7cf95 -r 8ca52c4f08aa hgext3rd/evolve/metadata.py --- a/hgext3rd/evolve/metadata.py Tue Feb 22 23:57:06 2022 +0300 +++ b/hgext3rd/evolve/metadata.py Tue Apr 26 11:32:04 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/' diff -r 4c0d0be7cf95 -r 8ca52c4f08aa hgext3rd/evolve/state.py --- a/hgext3rd/evolve/state.py Tue Feb 22 23:57:06 2022 +0300 +++ b/hgext3rd/evolve/state.py Tue Apr 26 11:32:04 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, diff -r 4c0d0be7cf95 -r 8ca52c4f08aa hgext3rd/evolve/utility.py --- a/hgext3rd/evolve/utility.py Tue Feb 22 23:57:06 2022 +0300 +++ b/hgext3rd/evolve/utility.py Tue Apr 26 11:32:04 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() diff -r 4c0d0be7cf95 -r 8ca52c4f08aa hgext3rd/pullbundle.py --- a/hgext3rd/pullbundle.py Tue Feb 22 23:57:06 2022 +0300 +++ b/hgext3rd/pullbundle.py Tue Apr 26 11:32:04 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/' diff -r 4c0d0be7cf95 -r 8ca52c4f08aa hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Tue Feb 22 23:57:06 2022 +0300 +++ b/hgext3rd/topic/__init__.py Tue Apr 26 11:32:04 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/' diff -r 4c0d0be7cf95 -r 8ca52c4f08aa tests/test-check-sdist.t --- a/tests/test-check-sdist.t Tue Feb 22 23:57:06 2022 +0300 +++ b/tests/test-check-sdist.t Tue Apr 26 11:32:04 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 diff -r 4c0d0be7cf95 -r 8ca52c4f08aa tests/test-evolve-issue6648.t --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-evolve-issue6648.t Tue Apr 26 11:32:04 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 diff -r 4c0d0be7cf95 -r 8ca52c4f08aa tests/test-fixup.t --- a/tests/test-fixup.t Tue Feb 22 23:57:06 2022 +0300 +++ b/tests/test-fixup.t Tue Apr 26 11:32:04 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 @@ -236,7 +249,7 @@ | o 9:12b5e442244f baz | | () secret | o 5:2eec5320cfc7 bar - |/ () draft + |/ (bm) draft o 0:e63c23eaa88a foo () draft @@ -260,7 +273,7 @@ | | o 13:fed7e534b3bb update foo | |/ () draft o | 5:2eec5320cfc7 bar - |/ () draft + |/ (bm) draft o 0:e63c23eaa88a foo () draft @@ -275,7 +288,7 @@ | o 13:fed7e534b3bb update foo | | () draft o | 5:2eec5320cfc7 bar - |/ () draft + |/ (bm) draft o 0:e63c23eaa88a foo () draft $ hg diff -c .