changeset 5908:e24bdf74cf83

branching: merge with stable
author Anton Shestakov <av6@dwimlabs.net>
date Sun, 25 Apr 2021 23:52:29 +0800
parents 04a1713c9ef5 (current diff) 355bd0f7354b (diff)
children efdbbced2374
files CHANGELOG hgext3rd/evolve/metadata.py hgext3rd/topic/__init__.py
diffstat 6 files changed, 273 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri Apr 23 11:55:42 2021 +0200
+++ b/.hgtags	Sun Apr 25 23:52:29 2021 +0800
@@ -93,3 +93,4 @@
 35b883a4ff5a97973eb9e6f00014e71f14cebe70 10.2.0
 eadc1d09f2f567fdae7280aefc8cf4cdc4d78cbc 10.2.0.post1
 c0ed8e57463875414d1c06f0428d550c4480d289 10.3.0
+93dc3cb6884259f91d739a1cfe993a01820c729c 10.3.1
--- a/CHANGELOG	Fri Apr 23 11:55:42 2021 +0200
+++ b/CHANGELOG	Sun Apr 25 23:52:29 2021 +0800
@@ -1,6 +1,23 @@
 Changelog
 =========
 
+10.3.1 -- 2021-04-25
+--------------------
+
+  * cache: fix corruption issue when mixing 32-bit and 64-bit environments
+
+  * next: unstable changesets with a different topic are no longer targets for
+    hg next as long as it's invoked without --no-topic flag
+  * next: when some potential targets are unstable, ask user which changeset
+    they want to update to (only mixing stable and unstable when --evolve flag
+    is given, which is the default)
+
+  * packaging: default to using Python 3 in Makefile
+
+topic (0.22.1)
+
+  * compatibility with Mercurial 5.8
+
 10.3.0 -- 2021-03-11
 --------------------
 
--- a/debian/changelog	Fri Apr 23 11:55:42 2021 +0200
+++ b/debian/changelog	Sun Apr 25 23:52:29 2021 +0800
@@ -1,3 +1,9 @@
+mercurial-evolve (10.3.1-1) unstable; urgency=medium
+
+  * new upstream release
+
+ -- Anton Shestakov <av6@dwimlabs.net>  Sun, 25 Apr 2021 14:13:18 +0800
+
 mercurial-evolve (10.3.0-1) unstable; urgency=medium
 
   * new upstream release
--- a/hgext3rd/evolve/__init__.py	Fri Apr 23 11:55:42 2021 +0200
+++ b/hgext3rd/evolve/__init__.py	Sun Apr 25 23:52:29 2021 +0800
@@ -743,13 +743,13 @@
     else:
         header = _(b"multiple parents, choose one to update:")
         prevs = [p.rev() for p in parents]
-        choosedrev = utility.revselectionprompt(repo.ui, repo, prevs, header)
-        if choosedrev is None:
+        selectedrev = utility.revselectionprompt(repo.ui, repo, prevs, header)
+        if selectedrev is None:
             for p in parents:
                 display(p)
             repo.ui.warn(_(b'multiple parents, explicitly update to one\n'))
         else:
-            target = repo[choosedrev]
+            target = repo[selectedrev]
     return target, bookmark
 
 @eh.command(
@@ -845,9 +845,9 @@
         topic = _getcurrenttopic(repo)
         filtered = set()
         template = shorttemplate
-        if topic and not opts.get("no_topic", False):
-            filtered = set(ctx for ctx in children if ctx.topic() != topic)
-            children = [ctx for ctx in children if ctx not in filtered]
+        if topic and not opts['no_topic']:
+            filtered = set(ctx.rev() for ctx in children if ctx.topic() != topic)
+            children = [ctx for ctx in children if ctx.rev() not in filtered]
             template = utility.stacktemplate
             opts['stacktemplate'] = True
         display = compat.format_changeset_summary_fn(ui, repo, b'next',
@@ -856,10 +856,10 @@
         # check if we need to evolve while updating to the next child revision
         needevolve = False
         aspchildren = evolvecmd._aspiringchildren(repo, [repo[b'.'].rev()])
-        if topic:
-            filtered.update(repo[c] for c in aspchildren
-                            if repo[c].topic() != topic)
-            aspchildren = [ctx for ctx in aspchildren if ctx not in filtered]
+        if topic and not opts['no_topic']:
+            filtered.update(rev for rev in aspchildren
+                            if repo[rev].topic() != topic)
+            aspchildren = [rev for rev in aspchildren if rev not in filtered]
 
         # To catch and prevent the case when `next` would get confused by split,
         # lets filter those aspiring children which can be stablized on one of
@@ -869,7 +869,7 @@
             possdests = evolvecmd._possibledestination(repo, aspchild)
             if possdests & aspirants:
                 filtered.add(aspchild)
-        aspchildren = [ctx for ctx in aspchildren if ctx not in filtered]
+        aspchildren = [rev for rev in aspchildren if rev not in filtered]
         if aspchildren:
             needevolve = True
 
@@ -885,21 +885,21 @@
             else:
                 cmdutil.bailifchanged(repo, hint=_(b'do you want --merge?'))
 
-        if len(children) == 1:
+        if len(children) == 1 and (not opts['evolve'] or not aspchildren):
             c = children[0]
             return _updatetonext(ui, repo, c, display, opts)
         elif children:
             cheader = _(b"ambiguous next changeset, choose one to update:")
-            crevs = [c.rev() for c in children]
-            choosedrev = utility.revselectionprompt(ui, repo, crevs, cheader)
-            if choosedrev is None:
+            crevs = [c.rev() for c in children] + aspchildren
+            selectedrev = utility.revselectionprompt(ui, repo, crevs, cheader)
+            if selectedrev is None:
                 ui.warn(_(b"ambiguous next changeset:\n"))
-                for c in children:
-                    display(c)
+                for rev in crevs:
+                    display(repo[rev])
                 ui.warn(_(b"explicitly update to one of them\n"))
                 return 1
             else:
-                return _updatetonext(ui, repo, repo[choosedrev], display, opts)
+                return _updatetonext(ui, repo, repo[selectedrev], display, opts)
         else:
             if not opts['evolve'] or not aspchildren:
                 if filtered:
@@ -915,16 +915,16 @@
             elif len(aspchildren) > 1:
                 cheader = _(b"ambiguous next (unstable) changeset, choose one to"
                             b" evolve and update:")
-                choosedrev = utility.revselectionprompt(ui, repo,
-                                                        aspchildren, cheader)
-                if choosedrev is None:
+                selectedrev = utility.revselectionprompt(ui, repo,
+                                                         aspchildren, cheader)
+                if selectedrev is None:
                     ui.warn(_(b"ambiguous next (unstable) changeset:\n"))
                     for c in aspchildren:
                         display(repo[c])
                     ui.warn(_(b"(run 'hg evolve --rev REV' on one of them)\n"))
                     return 1
                 else:
-                    return _nextevolve(ui, repo, repo[choosedrev], opts)
+                    return _nextevolve(ui, repo, repo[selectedrev], opts)
             else:
                 return _nextevolve(ui, repo, aspchildren[0], opts)
     finally:
--- a/tests/test-check-sdist.t	Fri Apr 23 11:55:42 2021 +0200
+++ b/tests/test-check-sdist.t	Sun Apr 25 23:52:29 2021 +0800
@@ -35,7 +35,7 @@
 
   $ tar -tzf hg-evolve-*.tar.gz | sed 's|^hg-evolve-[^/]*/||' | sort > files
   $ wc -l files
-  348 files
+  349 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-topic-prev-next.t	Sun Apr 25 23:52:29 2021 +0800
@@ -0,0 +1,226 @@
+  $ . "$TESTDIR/testlib/topic_setup.sh"
+  $ . "$TESTDIR/testlib/common.sh"
+
+  $ cat << EOF >> $HGRCPATH
+  > [extensions]
+  > evolve =
+  > [ui]
+  > logtemplate = '{rev} [{topic}] {desc}\n'
+  > EOF
+
+Checking target ambiguity in hg next
+
+  $ hg init ambiguous-next
+  $ cd ambiguous-next
+
+  $ mkcommit root
+  $ hg topic A
+  marked working directory as topic: A
+  $ mkcommit A1
+  active topic 'A' grew its first changeset
+  (see 'hg help topics' for more information)
+  $ mkcommit A2
+  $ mkcommit A3
+  $ mkcommit A4
+  $ hg up 'desc("A3")'
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ mkcommit A5
+  $ hg up 'desc("A2")'
+  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
+  $ hg topic B
+  $ mkcommit B1
+  active topic 'B' grew its first changeset
+  (see 'hg help topics' for more information)
+  $ mkcommit B2
+
+  $ hg log -G
+  @  7 [B] B2
+  |
+  o  6 [B] B1
+  |
+  | o  5 [A] A5
+  | |
+  | | o  4 [A] A4
+  | |/
+  | o  3 [A] A3
+  |/
+  o  2 [A] A2
+  |
+  o  1 [A] A1
+  |
+  o  0 [] root
+  
+
+Quick sanity check
+
+  $ hg up 'desc("A1")'
+  switching to topic A
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  $ hg next
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  [s2] A2
+  $ hg stack
+  ### topic: A (2 heads)
+  ### target: default (branch)
+  s5: A4
+  s3^ A3 (base)
+  s4: A5
+  s3: A3
+  s2@ A2 (current)
+  s1: A1
+  s0^ root (base)
+  $ hg next
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  [s3] A3
+  $ hg log -G
+  o  7 [B] B2
+  |
+  o  6 [B] B1
+  |
+  | o  5 [A] A5
+  | |
+  | | o  4 [A] A4
+  | |/
+  | @  3 [A] A3
+  |/
+  o  2 [A] A2
+  |
+  o  1 [A] A1
+  |
+  o  0 [] root
+  
+  $ hg next
+  ambiguous next changeset:
+  [s5] A4
+  [s4] A5
+  explicitly update to one of them
+  [1]
+
+Let's make some changesets unstable
+
+  $ hg up 'desc("A2")'
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo foo > A2
+  $ hg amend
+  5 new orphan changesets
+  $ hg stack
+  ### topic: A (2 heads)
+  ### target: default (branch)
+  s5$ A4 (orphan)
+  s3^ A3 (base orphan)
+  s4$ A5 (orphan)
+  s3$ A3 (orphan)
+  s2@ A2 (current)
+  s1: A1
+  s0^ root (base)
+  $ hg log -G
+  @  8 [A] A2
+  |
+  | *  7 [B] B2
+  | |
+  | *  6 [B] B1
+  | |
+  | | *  5 [A] A5
+  | | |
+  | | | *  4 [A] A4
+  | | |/
+  | | *  3 [A] A3
+  | |/
+  | x  2 [A] A2
+  |/
+  o  1 [A] A1
+  |
+  o  0 [] root
+  
+
+B1 shouldn't be considered a target, orphan or not
+
+  $ hg next
+  move:[s3] A3
+  atop:[s2] A2
+  working directory is now at 2b67b6a6cae1
+
+B1 is not considered a target when it's been stabilized
+
+  $ hg up 'desc("A2")'
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ hg evolve --rev 'desc("B1")'
+  move:[6] B1
+  atop:[8] A2
+  switching to topic A
+  $ hg next
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  [s3] A3
+
+A4 and A5 should be ambiguous for hg next even if A5 is an orphan and A4 is not
+
+  $ hg evolve --rev 'desc("A3") + desc("A4")'
+  move:[s5] A4
+  atop:[s3] A3
+  $ hg up 'desc("A3")'
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg stack
+  ### topic: A (2 heads)
+  ### target: default (branch)
+  s5: A4
+  s3^ A3 (base current)
+  s4$ A5 (orphan)
+  s3@ A3 (current)
+  s2: A2
+  s1: A1
+  s0^ root (base)
+  $ hg next --no-evolve --dry-run
+  hg update 51d70e81d730;
+  [s5] A4
+  $ hg next
+  ambiguous next changeset:
+  [s5] A4
+  [s4] A5
+  explicitly update to one of them
+  [1]
+
+  $ cd ..
+
+Making sure plain hg next sticks to topic when target is unstable
+
+  $ hg init next-unstable-topic
+  $ cd next-unstable-topic
+
+  $ mkcommit ROOT
+  $ hg topics topic-a
+  marked working directory as topic: topic-a
+  $ mkcommit A
+  active topic 'topic-a' grew its first changeset
+  (see 'hg help topics' for more information)
+  $ hg topics topic-b
+  $ mkcommit B
+  active topic 'topic-b' grew its first changeset
+  (see 'hg help topics' for more information)
+  $ hg up 'topic("topic-a")'
+  switching to topic topic-a
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo foo > foo
+  $ hg ci -A --amend
+  adding foo
+  1 new orphan changesets
+  $ hg log -G
+  @  3 [topic-a] A
+  |
+  | *  2 [topic-b] B
+  | |
+  | x  1 [topic-a] A
+  |/
+  o  0 [] ROOT
+  
+
+  $ hg next
+  no children on topic "topic-a"
+  do you want --no-topic
+  [1]
+
+  $ hg next --no-topic
+  move:[2] B
+  atop:[3] A
+  working directory is now at 53f8332d648f
+
+  $ cd ..