comparison hgext/evolve.py @ 1784:c3741a5adbb0 stable

fold: cleanly abort on empty fold set (issue5453) We now handle the empty set case, cleanly aborting instead of crashing with a traceback. The message used match the output of 'hg push' in similar situation.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 25 Jan 2017 16:40:45 +0100
parents 727c7211c810
children f22120b12715 b674277ea4ef
comparison
equal deleted inserted replaced
1777:e7149cc5101f 1784:c3741a5adbb0
3122 raise error.Abort(_("cannot fold non-linear revisions"), 3122 raise error.Abort(_("cannot fold non-linear revisions"),
3123 hint=_("given revisions are unrelated to parent " 3123 hint=_("given revisions are unrelated to parent "
3124 "of working directory")) 3124 "of working directory"))
3125 revs = extrevs 3125 revs = extrevs
3126 3126
3127 if len(revs) == 1: 3127 if not revs:
3128 raise error.Abort(_('specified revisions evaluate to an empty set'),
3129 hint=_('use different revision arguments'))
3130 elif len(revs) == 1:
3128 ui.write_err(_('single revision specified, nothing to fold\n')) 3131 ui.write_err(_('single revision specified, nothing to fold\n'))
3129 return 1 3132 return 1
3130 3133
3131 wlock = lock = None 3134 wlock = lock = None
3132 try: 3135 try: