changeset 707:f914e315b717

evolve: remove magic return values from utility functions
author Levi Bard <levi@unity3d.com>
date Sat, 09 Feb 2013 18:07:36 +0100
parents 90f0a1ede70a
children 0ff2251adfe0
files hgext/evolve.py
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/evolve.py	Sat Feb 09 17:02:34 2013 +0100
+++ b/hgext/evolve.py	Sat Feb 09 18:07:36 2013 +0100
@@ -910,7 +910,7 @@
 
     while tr is not None:
         result = _evolveany(ui, repo, tr, dryrunopt)
-        if 2 == result or not allopt:
+        if not allopt:
             return result
         tr = _picknexttroubled(ui, repo, anyopt or allopt)
         
@@ -987,12 +987,11 @@
         obs = obs.parents()[0]
         newer = obsolete.successorssets(repo, obs.node())
     if len(newer) > 1:
-        ui.write_err(_("conflict rewriting. can't choose destination\n"))
-        return 2
+        raise util.Abort(_("conflict rewriting. can't choose destination\n"))
     targets = newer[0]
     assert targets
     if len(targets) > 1:
-        ui.write_err(_("does not handle splitted parent yet\n"))
+        raise util.Abort(_("does not handle split parents yet\n"))
         return 2
     target = targets[0]
     displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate})