comparison hgext/evolve.py @ 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
comparison
equal deleted inserted replaced
706:90f0a1ede70a 707:f914e315b717
908 ui.write_err(_('no troubled changeset\n')) 908 ui.write_err(_('no troubled changeset\n'))
909 return 1 909 return 1
910 910
911 while tr is not None: 911 while tr is not None:
912 result = _evolveany(ui, repo, tr, dryrunopt) 912 result = _evolveany(ui, repo, tr, dryrunopt)
913 if 2 == result or not allopt: 913 if not allopt:
914 return result 914 return result
915 tr = _picknexttroubled(ui, repo, anyopt or allopt) 915 tr = _picknexttroubled(ui, repo, anyopt or allopt)
916 916
917 917
918 def _evolveany(ui, repo, tr, dryrunopt): 918 def _evolveany(ui, repo, tr, dryrunopt):
985 ui.debug("stabilize target %s is plain dead," 985 ui.debug("stabilize target %s is plain dead,"
986 " trying to stabilize on its parent") 986 " trying to stabilize on its parent")
987 obs = obs.parents()[0] 987 obs = obs.parents()[0]
988 newer = obsolete.successorssets(repo, obs.node()) 988 newer = obsolete.successorssets(repo, obs.node())
989 if len(newer) > 1: 989 if len(newer) > 1:
990 ui.write_err(_("conflict rewriting. can't choose destination\n")) 990 raise util.Abort(_("conflict rewriting. can't choose destination\n"))
991 return 2
992 targets = newer[0] 991 targets = newer[0]
993 assert targets 992 assert targets
994 if len(targets) > 1: 993 if len(targets) > 1:
995 ui.write_err(_("does not handle splitted parent yet\n")) 994 raise util.Abort(_("does not handle split parents yet\n"))
996 return 2 995 return 2
997 target = targets[0] 996 target = targets[0]
998 displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate}) 997 displayer = cmdutil.show_changeset(ui, repo, {'template': shorttemplate})
999 target = repo[target] 998 target = repo[target]
1000 repo.ui.status(_('move:')) 999 repo.ui.status(_('move:'))