branching: merge with stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sat, 10 Nov 2018 15:47:46 +0100
changeset 4236 259d57b906a4
parent 4234 2cc81ae30f37 (diff)
parent 4235 e30119dfd626 (current diff)
child 4237 9e64a7d09895
branching: merge with stable
hgext3rd/evolve/__init__.py
hgext3rd/evolve/cmdrewrite.py
hgext3rd/evolve/evolvecmd.py
hgext3rd/topic/__init__.py
--- a/hgext3rd/evolve/__init__.py	Sat Nov 10 15:37:22 2018 +0100
+++ b/hgext3rd/evolve/__init__.py	Sat Nov 10 15:47:46 2018 +0100
@@ -1136,6 +1136,23 @@
         if opts['evolve']:
             cmdutil.bailifchanged(repo)
 
+        children = [ctx for ctx in wparents[0].children() if not ctx.obsolete()]
+        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]
+            template = utility.stacktemplate
+        displayer = compat.changesetdisplayer(ui, repo, {'template': template})
+
+        # check if we need to evolve while updating to the next child revision
+        aspchildren = evolvecmd._aspiringchildren(repo, [repo['.'].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 not opts['merge']:
             # we only skip the check if noconflict is set
             if ui.config('commands', 'update.check') == 'noconflict':
@@ -1147,15 +1164,6 @@
                     exc.hint = _('do you want --merge?')
                     raise
 
-        children = [ctx for ctx in wparents[0].children() if not ctx.obsolete()]
-        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]
-            template = utility.stacktemplate
-        displayer = compat.changesetdisplayer(ui, repo, {'template': template})
         if len(children) == 1:
             c = children[0]
             return _updatetonext(ui, repo, c, displayer, opts)
@@ -1172,11 +1180,6 @@
             else:
                 return _updatetonext(ui, repo, repo[choosedrev], displayer, opts)
         else:
-            aspchildren = evolvecmd._aspiringchildren(repo, [repo['.'].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 not opts['evolve'] or not aspchildren:
                 if filtered:
                     ui.warn(_('no children on topic "%s"\n') % topic)
--- a/hgext3rd/evolve/cmdrewrite.py	Sat Nov 10 15:37:22 2018 +0100
+++ b/hgext3rd/evolve/cmdrewrite.py	Sat Nov 10 15:47:46 2018 +0100
@@ -105,7 +105,7 @@
      ('', 'close-branch', None,
       _('mark a branch as closed, hiding it from the branch list')),
      ('s', 'secret', None, _('use the secret phase for committing')),
-     ('n', 'note', '', _('store a note on amend')),
+     ('n', 'note', '', _('store a note on amend'), _('TEXT')),
     ] + walkopts + commitopts + commitopts2 + commitopts3 + interactiveopt,
     _('[OPTION]... [FILE]...'),
     helpbasic=True)
@@ -462,9 +462,9 @@
     'uncommit',
     [('a', 'all', None, _('uncommit all changes when no arguments given')),
      ('i', 'interactive', False, _('interactive mode to uncommit (EXPERIMENTAL)')),
-     ('r', 'rev', '', _('revert commit content to REV instead')),
+     ('r', 'rev', '', _('revert commit content to REV instead'), _('REV')),
      ('', 'revert', False, _('discard working directory changes after uncommit')),
-     ('n', 'note', '', _('store a note on uncommit')),
+     ('n', 'note', '', _('store a note on uncommit'), _('TEXT')),
      ] + commands.walkopts + commitopts + commitopts2 + commitopts3,
     _('[OPTION]... [NAME]'))
 def uncommit(ui, repo, *pats, **opts):
@@ -662,10 +662,10 @@
 
 @eh.command(
     'fold|squash',
-    [('r', 'rev', [], _("revision to fold")),
+    [('r', 'rev', [], _("revision to fold"), _('REV')),
      ('', 'exact', None, _("only fold specified revisions")),
      ('', 'from', None, _("fold revisions linearly to working copy parent")),
-     ('n', 'note', '', _('store a note on fold')),
+     ('n', 'note', '', _('store a note on fold'), _('TEXT')),
     ] + commitopts + commitopts2 + commitopts3,
     _('hg fold [OPTION]... [-r] REV'),
     helpbasic=True)
@@ -791,9 +791,9 @@
 
 @eh.command(
     'metaedit',
-    [('r', 'rev', [], _("revision to edit")),
+    [('r', 'rev', [], _("revision to edit"), _('REV')),
      ('', 'fold', None, _("also fold specified revisions into one")),
-     ('n', 'note', '', _('store a note on metaedit')),
+     ('n', 'note', '', _('store a note on metaedit'), _('TEXT')),
     ] + commitopts + commitopts2 + commitopts3,
     _('hg metaedit [OPTION]... [-r] [REV]'))
 def metaedit(ui, repo, *revs, **opts):
@@ -941,10 +941,10 @@
 @eh.command(
     'prune|obsolete',
     [('n', 'new', [], _("successor changeset (DEPRECATED)")),
-     ('s', 'succ', [], _("successor changeset")),
-     ('r', 'rev', [], _("revisions to prune")),
+     ('s', 'succ', [], _("successor changeset"), _('REV')),
+     ('r', 'rev', [], _("revisions to prune"), _('REV')),
      ('k', 'keep', None, _("does not modify working copy during prune")),
-     ('n', 'note', '', _('store a note on prune')),
+     ('n', 'note', '', _('store a note on prune'), _('TEXT')),
      ('', 'pair', False, _("record a pairing, such as a rebase or divergence resolution "
                            "(pairing multiple precursors to multiple successors)")),
      ('', 'biject', False, _("alias to --pair (DEPRECATED)")),
@@ -953,7 +953,7 @@
      ('', 'split', False,
       _("record a split (on precursor, multiple successors)")),
      ('B', 'bookmark', [], _("remove revs only reachable from given"
-                             " bookmark"))] + metadataopts,
+                             " bookmark"), _('BOOKMARK'))] + metadataopts,
     _('[OPTION] [-r] REV...'),
     helpbasic=True)
 # XXX -U  --noupdate option to prevent wc update and or bookmarks update ?
@@ -1132,8 +1132,8 @@
 
 @eh.command(
     'split',
-    [('r', 'rev', [], _("revision to split")),
-     ('n', 'note', '', _("store a note on split")),
+    [('r', 'rev', [], _("revision to split"), _('REV')),
+     ('n', 'note', '', _("store a note on split"), _('TEXT')),
     ] + commitopts + commitopts2 + commitopts3,
     _('hg split [OPTION]... [-r] REV'),
     helpbasic=True)
@@ -1229,8 +1229,8 @@
 
 @eh.command(
     'touch',
-    [('r', 'rev', [], 'revision to update'),
-     ('n', 'note', '', _('store a note on touch')),
+    [('r', 'rev', [], _('revision to update'), _('REV')),
+     ('n', 'note', '', _('store a note on touch'), _('TEXT')),
      ('D', 'duplicate', False,
       'do not mark the new revision as successor of the old one'),
      ('A', 'allowdivergence', False,
@@ -1322,7 +1322,7 @@
 
 @eh.command(
     'pick|grab',
-    [('r', 'rev', '', 'revision to pick'),
+    [('r', 'rev', '', _('revision to pick'), _('REV')),
      ('c', 'continue', False, 'continue interrupted pick'),
      ('a', 'abort', False, 'abort interrupted pick'),
     ],
--- a/hgext3rd/evolve/evolvecmd.py	Sat Nov 10 15:37:22 2018 +0100
+++ b/hgext3rd/evolve/evolvecmd.py	Sat Nov 10 15:47:46 2018 +0100
@@ -1342,7 +1342,7 @@
      ('A', 'any', False,
       _('also consider troubled changesets unrelated to current working '
         'directory')),
-     ('r', 'rev', [], _('solves troubles of these revisions')),
+     ('r', 'rev', [], _('solves troubles of these revisions'), _('REV')),
      ('', 'bumped', False, _('solves only bumped changesets (DEPRECATED)')),
      ('', 'phase-divergent', False, _('solves only phase-divergent changesets')),
      ('', 'divergent', False, _('solves only divergent changesets (DEPRECATED)')),
@@ -1749,14 +1749,25 @@
             # evolved to confirm that if atop msg should be suppressed to remove
             # redundancy
             lastsolved = None
+            activetopic = getattr(repo, 'currenttopic', '')
             for rev in evolvestate['revs']:
                 # XXX: prevent this lookup by storing nodes instead of revnums
                 curctx = unfi[rev]
-                if (curctx.node() not in evolvestate['replacements']
-                    and curctx.node() not in evolvestate['skippedrevs']):
+
+                # check if we can use stack template
+                revtopic = getattr(curctx, 'topic', lambda: '')()
+                topicidx = getattr(curctx, 'topicidx', lambda: None)()
+                stacktmplt = False
+                if (activetopic and (activetopic == revtopic)
+                    and topicidx is not None):
+                    stacktmplt = True
+
+                if (curctx.node() not in evolvestate['replacements'] and
+                    curctx.node() not in evolvestate['skippedrevs']):
                     newnode = _solveone(ui, repo, curctx, evolvestate, False,
                                         confirm, progresscb, category,
-                                        lastsolved=lastsolved)
+                                        lastsolved=lastsolved,
+                                        stacktmplt=stacktmplt)
                     if newnode[0]:
                         evolvestate['replacements'][curctx.node()] = newnode[1]
                         lastsolved = newnode[1]
--- a/hgext3rd/evolve/metadata.py	Sat Nov 10 15:37:22 2018 +0100
+++ b/hgext3rd/evolve/metadata.py	Sat Nov 10 15:47:46 2018 +0100
@@ -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__ = '8.3.2.dev'
+__version__ = '8.4.0.dev'
 testedwith = '4.3.2 4.4.2 4.5.2 4.6.2 4.7'
 minimumhgversion = '4.3'
 buglink = 'https://bz.mercurial-scm.org/'
--- a/hgext3rd/evolve/rewind.py	Sat Nov 10 15:37:22 2018 +0100
+++ b/hgext3rd/evolve/rewind.py	Sat Nov 10 15:47:46 2018 +0100
@@ -27,10 +27,11 @@
 
 @eh.command(
     'rewind|undo',
-    [('', 'to', [], _("rewind to these revisions")),
+    [('', 'to', [], _("rewind to these revisions"), _('REV')),
      ('', 'as-divergence', None, _("preserve current latest successors")),
      ('', 'exact', None, _("only rewind explicitly selected revisions")),
-     ('', 'from', [], _("rewind these revisions to their predecessors")),
+     ('', 'from', [],
+      _("rewind these revisions to their predecessors"), _('REV')),
     ],
     _(''),
     helpbasic=True)
--- a/hgext3rd/topic/__init__.py	Sat Nov 10 15:37:22 2018 +0100
+++ b/hgext3rd/topic/__init__.py	Sat Nov 10 15:47:46 2018 +0100
@@ -177,7 +177,7 @@
               'topic.active': 'green',
              }
 
-__version__ = '0.12.2.dev'
+__version__ = '0.13.0.dev'
 
 testedwith = '4.3.3 4.4.2 4.5.2 4.6.2 4.7'
 minimumhgversion = '4.3'
--- a/hgext3rd/topic/randomname.py	Sat Nov 10 15:37:22 2018 +0100
+++ b/hgext3rd/topic/randomname.py	Sat Nov 10 15:47:46 2018 +0100
@@ -189,7 +189,6 @@
     'pony',
     'porcupine',
     'porpoise',
-    'prairie',
     'puffin',
     'pug',
     'quagga',
--- a/tests/test-amend.t	Sat Nov 10 15:37:22 2018 +0100
+++ b/tests/test-amend.t	Sat Nov 10 15:47:46 2018 +0100
@@ -153,7 +153,7 @@
       --close-branch        mark a branch as closed, hiding it from the branch
                             list
    -s --secret              use the secret phase for committing
-   -n --note VALUE          store a note on amend
+   -n --note TEXT           store a note on amend
    -I --include PATTERN [+] include names matching the given patterns
    -X --exclude PATTERN [+] exclude names matching the given patterns
    -m --message TEXT        use text as commit message
--- a/tests/test-evolve-topic.t	Sat Nov 10 15:37:22 2018 +0100
+++ b/tests/test-evolve-topic.t	Sat Nov 10 15:47:46 2018 +0100
@@ -381,3 +381,63 @@
   $ hg prev
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   [s3] add eee
+
+Check stackaliases(s#) works with  --continue case also, while evolving:
+------------------------------------------------------------------------
+  $ hg up 18
+  switching to topic bar
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg evolve --all
+  move:[s2] add ggg
+  atop:[s1] add fff
+  move:[s3] add hhh
+  move:[s4] add iii
+  move:[s5] add jjj
+  working directory is now at 38a82cbb794a
+  $ hg up 18
+  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
+  $ echo "changes in hhh" > hhh
+  $ hg add hhh
+  $ hg ci --amend
+  4 new orphan changesets
+  $ hg log -G
+  @  26 - {bar} 2c295936ac04 add fff (draft)
+  |
+  | *  25 - {bar} 38a82cbb794a add jjj (draft)
+  | |
+  | *  24 - {bar} 4a44eba0fdb3 add iii (draft)
+  | |
+  | *  23 - {bar} 7acd9ea5d677 add hhh (draft)
+  | |
+  | *  22 - {bar} 735c7bd8f133 add ggg (draft)
+  | |
+  | x  18 - {bar} 793eb6370b2d add fff (draft)
+  |/
+  o  12 - {foo} 42b49017ff90 add eee (draft)
+  |
+  o  10 - {foo} d9cacd156ffc add ddd (draft)
+  |
+  o  2 - {foo} cced9bac76e3 add ccc (draft)
+  |
+  o  1 - {} a4dbed0837ea add bbb (draft)
+  |
+  o  0 - {} 199cc73e9a0b add aaa (draft)
+  
+  $ hg evolve --all
+  move:[s2] add ggg
+  atop:[s1] add fff
+  move:[s3] add hhh
+  merging hhh
+  warning: conflicts while merging hhh! (edit, then use 'hg resolve --mark')
+  fix conflicts and see `hg help evolve.interrupted`
+  [1]
+  $ echo "resolved hhh" > hhh
+  $ hg resolve --mark hhh
+  (no more unresolved files)
+  continue: hg evolve --continue
+  $ hg evolve --continue
+  evolving 23:7acd9ea5d677 "add hhh"
+  move:[s4] add iii
+  atop:[s3] add hhh
+  move:[s5] add jjj
+  working directory is now at 119e4c126fb2
--- a/tests/test-grab.t	Sat Nov 10 15:37:22 2018 +0100
+++ b/tests/test-grab.t	Sat Nov 10 15:47:46 2018 +0100
@@ -24,9 +24,9 @@
   
   options:
   
-   -r --rev VALUE revision to pick
-   -c --continue  continue interrupted pick
-   -a --abort     abort interrupted pick
+   -r --rev REV  revision to pick
+   -c --continue continue interrupted pick
+   -a --abort    abort interrupted pick
   
   (some details hidden, use --verbose to show complete help)
 
--- a/tests/test-options.t	Sat Nov 10 15:37:22 2018 +0100
+++ b/tests/test-options.t	Sat Nov 10 15:47:46 2018 +0100
@@ -24,6 +24,7 @@
   >   allowunstable
   >   exchange
   > EOF
-  $ hg prune | head -n 2
+  $ hg prune
   hg: unknown command 'prune'
   (use 'hg help' for a list of commands)
+  [255]
--- a/tests/test-tutorial.t	Sat Nov 10 15:37:22 2018 +0100
+++ b/tests/test-tutorial.t	Sat Nov 10 15:47:46 2018 +0100
@@ -934,9 +934,9 @@
   options ([+] can be repeated):
   
    -a --all                 uncommit all changes when no arguments given
-   -r --rev VALUE           revert commit content to REV instead
+   -r --rev REV             revert commit content to REV instead
       --revert              discard working directory changes after uncommit
-   -n --note VALUE          store a note on uncommit
+   -n --note TEXT           store a note on uncommit
    -I --include PATTERN [+] include names matching the given patterns
    -X --exclude PATTERN [+] exclude names matching the given patterns
    -m --message TEXT        use text as commit message
@@ -973,16 +973,16 @@
   
   options ([+] can be repeated):
   
-   -r --rev VALUE [+] revision to fold
-      --exact         only fold specified revisions
-      --from          fold revisions linearly to working copy parent
-   -n --note VALUE    store a note on fold
-   -m --message TEXT  use text as commit message
-   -l --logfile FILE  read commit message from file
-   -d --date DATE     record the specified date as commit date
-   -u --user USER     record the specified user as committer
-   -D --current-date  record the current date as commit date
-   -U --current-user  record the current user as committer
+   -r --rev REV [+]  revision to fold
+      --exact        only fold specified revisions
+      --from         fold revisions linearly to working copy parent
+   -n --note TEXT    store a note on fold
+   -m --message TEXT use text as commit message
+   -l --logfile FILE read commit message from file
+   -d --date DATE    record the specified date as commit date
+   -u --user USER    record the specified user as committer
+   -D --current-date record the current date as commit date
+   -U --current-user record the current user as committer
   
   (some details hidden, use --verbose to show complete help)