changeset 6231:d0f0a7b68d2d

branching: merge with stable
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 26 Apr 2022 17:39:11 +0400
parents 6020b7e92a86 (current diff) ab92c510ab05 (diff)
children 1d553662fc1b
files CHANGELOG hgext3rd/evolve/cmdrewrite.py hgext3rd/evolve/evolvecmd.py hgext3rd/evolve/metadata.py hgext3rd/evolve/state.py tests/test-fixup.t
diffstat 11 files changed, 189 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Apr 08 02:19:50 2022 +0300
+++ b/.hgtags	Tue Apr 26 17:39:11 2022 +0400
@@ -99,3 +99,4 @@
 de530d27554b43c00509696dc7a1496f5129e1a4 10.4.0
 64bb9c4a13d388233d4d6d9b761ece9c6ce77fb3 10.4.1
 0d53a8d4170b32d03e4fd8582b32fe2790d5e34f 10.5.0
+62f31db544594837a71cb91a7c1e8e515c5a52e9 10.5.1
--- a/CHANGELOG	Fri Apr 08 02:19:50 2022 +0300
+++ b/CHANGELOG	Tue Apr 26 17:39:11 2022 +0400
@@ -11,6 +11,17 @@
 
   * topic: allow Unicode word characters in topic names
 
+10.5.1 -- 2022-04-26
+--------------------
+
+  * 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
 --------------------
 
--- a/debian/changelog	Fri Apr 08 02:19:50 2022 +0300
+++ b/debian/changelog	Tue Apr 26 17:39:11 2022 +0400
@@ -1,3 +1,9 @@
+mercurial-evolve (10.5.1-1) unstable; urgency=medium
+
+  * new upstream release
+
+ -- Anton Shestakov <av6@dwimlabs.net>  Tue, 26 Apr 2022 12:58:30 +0400
+
 mercurial-evolve (10.5.0-1) unstable; urgency=medium
 
   * new upstream release
--- a/debian/copyright	Fri Apr 08 02:19:50 2022 +0300
+++ b/debian/copyright	Tue Apr 26 17:39:11 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/cmdrewrite.py	Fri Apr 08 02:19:50 2022 +0300
+++ b/hgext3rd/evolve/cmdrewrite.py	Tue Apr 26 17:39:11 2022 +0400
@@ -1522,7 +1522,10 @@
         raise compat.InputError(_(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):
--- a/hgext3rd/evolve/evolvecmd.py	Fri Apr 08 02:19:50 2022 +0300
+++ b/hgext3rd/evolve/evolvecmd.py	Tue Apr 26 17:39:11 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: "
@@ -1767,7 +1767,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):
@@ -1821,7 +1822,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/state.py	Fri Apr 08 02:19:50 2022 +0300
+++ b/hgext3rd/evolve/state.py	Tue Apr 26 17:39:11 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	Fri Apr 08 02:19:50 2022 +0300
+++ b/hgext3rd/evolve/utility.py	Tue Apr 26 17:39:11 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/tests/test-check-sdist.t	Fri Apr 08 02:19:50 2022 +0300
+++ b/tests/test-check-sdist.t	Tue Apr 26 17:39:11 2022 +0400
@@ -35,7 +35,7 @@
 
   $ tar -tzf hg-evolve-*.tar.gz | sed 's|^hg-evolve-[^/]*/||' | sort > files
   $ wc -l files
-  356 files
+  357 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 17:39:11 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	Fri Apr 08 02:19:50 2022 +0300
+++ b/tests/test-fixup.t	Tue Apr 26 17:39:11 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
 
@@ -249,7 +262,7 @@
   | o  9:12b5e442244f baz
   | |   () secret
   | o  5:2eec5320cfc7 bar
-  |/    () draft
+  |/    (bm) draft
   o  0:e63c23eaa88a foo
       () draft
 
@@ -286,7 +299,7 @@
   | o  9:12b5e442244f baz
   | |   () secret
   | o  5:2eec5320cfc7 bar
-  |/    () draft
+  |/    (bm) draft
   o  0:e63c23eaa88a foo
       () draft
 
@@ -310,7 +323,7 @@
   | | o  16:0dd54868f420 update foo
   | |/    () draft
   o |  5:2eec5320cfc7 bar
-  |/    () draft
+  |/    (bm) draft
   o  0:e63c23eaa88a foo
       () draft
 
@@ -325,7 +338,7 @@
   | o  16:0dd54868f420 update foo
   | |   () draft
   o |  5:2eec5320cfc7 bar
-  |/    () draft
+  |/    (bm) draft
   o  0:e63c23eaa88a foo
       () draft
   $ hg diff -c .