Mercurial > evolve
comparison hgext/evolve.py @ 1397:35f2f54b557c
evolve: make prune respect allowunsable
Before this patch, the prune command was performing the same way regardless
of the value of experimental.evolution.
With this patch if the configuration does not allow unstability, prune won't
create instability.
author | Laurent Charignon <lcharignon@fb.com> |
---|---|
date | Fri, 19 Jun 2015 11:03:51 -0700 |
parents | ba95cec18fe9 |
children | 7ddcbf5469bc |
comparison
equal
deleted
inserted
replaced
1396:ba95cec18fe9 | 1397:35f2f54b557c |
---|---|
1948 hint='see "hg help phases" for details') | 1948 hint='see "hg help phases" for details') |
1949 precs.append(cp) | 1949 precs.append(cp) |
1950 if not precs: | 1950 if not precs: |
1951 raise util.Abort('nothing to prune') | 1951 raise util.Abort('nothing to prune') |
1952 | 1952 |
1953 if not obsolete.isenabled(repo, obsolete.allowunstableopt): | |
1954 if len(repo.revs("(%ld::) - %ld", revs, revs)) != 0: | |
1955 raise util.Abort(_("cannot prune in the middle of a stack")) | |
1956 | |
1953 # defines successors changesets | 1957 # defines successors changesets |
1954 sucs = scmutil.revrange(repo, succs) | 1958 sucs = scmutil.revrange(repo, succs) |
1955 sucs.sort() | 1959 sucs.sort() |
1956 sucs = tuple(repo[n] for n in sucs) | 1960 sucs = tuple(repo[n] for n in sucs) |
1957 if not biject and len(sucs) > 1 and len(precs) > 1: | 1961 if not biject and len(sucs) > 1 and len(precs) > 1: |