changeset 4233:efd542942d98

next: move some code to prepare for `next --evolve` by default Moved some values before the block where we suggest the user to use --merge flag. As we would need these values to find if we need to evolve or not before we can suggest user to use `--merge` flag. We will suggest user to use `--merge` flag only when we don't need to evolve. Because currently we don't support both --evolve(going to be True by default) and --merge at the same time.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Tue, 06 Nov 2018 11:22:39 +0530
parents 424b498aac00
children 2cc81ae30f37
files hgext3rd/evolve/__init__.py
diffstat 1 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/__init__.py	Sat Nov 10 00:55:34 2018 +0100
+++ b/hgext3rd/evolve/__init__.py	Tue Nov 06 11:22:39 2018 +0530
@@ -1136,6 +1136,16 @@
         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})
+
         if not opts['merge']:
             # we only skip the check if noconflict is set
             if ui.config('commands', 'update.check') == 'noconflict':
@@ -1147,15 +1157,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)