comparison mercurial/rewriteutil.py @ 40636:8c6329fa6038

rewriteutil: move publicrevs closer to where it's used
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 14 Nov 2018 15:05:38 +0800
parents 490df753894d
children 57875cf423c9
comparison
equal deleted inserted replaced
40635:acd17caa699a 40636:8c6329fa6038
25 if node.nullrev in revs: 25 if node.nullrev in revs:
26 msg = _("cannot %s null changeset") % (action) 26 msg = _("cannot %s null changeset") % (action)
27 hint = _("no changeset checked out") 27 hint = _("no changeset checked out")
28 raise error.Abort(msg, hint=hint) 28 raise error.Abort(msg, hint=hint)
29 29
30 publicrevs = repo.revs('%ld and public()', revs)
31 if len(repo[None].parents()) > 1: 30 if len(repo[None].parents()) > 1:
32 raise error.Abort(_("cannot %s while merging") % action) 31 raise error.Abort(_("cannot %s while merging") % action)
33 32
33 publicrevs = repo.revs('%ld and public()', revs)
34 if publicrevs: 34 if publicrevs:
35 msg = _("cannot %s public changesets") % (action) 35 msg = _("cannot %s public changesets") % (action)
36 hint = _("see 'hg help phases' for details") 36 hint = _("see 'hg help phases' for details")
37 raise error.Abort(msg, hint=hint) 37 raise error.Abort(msg, hint=hint)
38 38