comparison hgext/evolve.py @ 1364:f00d91365ab9

evolve: make uncommit respect allowunsable Before this patch, the uncommit command was performing the same way regardless of the value of experimental.evolution. With this patch if the configuration does not allow unstability, uncommit won't create instability.
author Laurent Charignon <lcharignon@fb.com>
date Wed, 20 May 2015 12:46:13 -0700
parents 043e5ca9322f
children 4ed67cce8c23
comparison
equal deleted inserted replaced
1363:2eaa2943f9f3 1364:f00d91365ab9
2207 rev = scmutil.revsingle(repo, opts.get('rev')) 2207 rev = scmutil.revsingle(repo, opts.get('rev'))
2208 ctx = repo[None] 2208 ctx = repo[None]
2209 if ctx.p1() == rev or ctx.p2() == rev: 2209 if ctx.p1() == rev or ctx.p2() == rev:
2210 raise util.Abort(_("cannot uncommit to parent changeset")) 2210 raise util.Abort(_("cannot uncommit to parent changeset"))
2211 2211
2212 onahead = old.rev() in repo.changelog.headrevs()
2213 disallowunstable = not obsolete.isenabled(repo, obsolete.allowunstableopt)
2214 if disallowunstable and not onahead:
2215 raise util.Abort(_("cannot uncommit in the middle of a stack"))
2216
2212 # Recommit the filtered changeset 2217 # Recommit the filtered changeset
2213 tr = repo.transaction('uncommit') 2218 tr = repo.transaction('uncommit')
2214 newid = None 2219 newid = None
2215 includeorexclude = opts.get('include') or opts.get('exclude') 2220 includeorexclude = opts.get('include') or opts.get('exclude')
2216 if (pats or includeorexclude or opts.get('all')): 2221 if (pats or includeorexclude or opts.get('all')):