next: set if we need to evolve or not; also move logic to appropriate pos
authorSushil khanchi <sushilkhanchi97@gmail.com>
Sat, 10 Nov 2018 15:30:10 +0100
changeset 4234 2cc81ae30f37
parent 4233 efd542942d98
child 4236 259d57b906a4
next: set if we need to evolve or not; also move logic to appropriate pos set the value `needevolve` and also move the logic to find aspiringchildren to appropriate position i.e before we suggest user to use other flags like --merge.
hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py	Tue Nov 06 11:22:39 2018 +0530
+++ b/hgext3rd/evolve/__init__.py	Sat Nov 10 15:30:10 2018 +0100
@@ -1146,6 +1146,13 @@
             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':
@@ -1173,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)