comparison hgext/evolve.py @ 1398:7ddcbf5469bc

evolve: make fold aware of allowunstable Before this patch, the fold command was performing the same way regardless of the value of experimental.evolution. With this patch if the configuration does not allow unstability, fold won't create instability.
author Laurent Charignon <lcharignon@fb.com>
date Fri, 19 Jun 2015 11:04:18 -0700
parents 35f2f54b557c
children 08ae023882f1
comparison
equal deleted inserted replaced
1397:35f2f54b557c 1398:7ddcbf5469bc
2443 heads = repo.revs('heads(%ld)', revs) 2443 heads = repo.revs('heads(%ld)', revs)
2444 if len(heads) > 1: 2444 if len(heads) > 1:
2445 raise util.Abort(_("cannot fold non-linear revisions " 2445 raise util.Abort(_("cannot fold non-linear revisions "
2446 "(multiple heads given)")) 2446 "(multiple heads given)"))
2447 head = repo[heads.first()] 2447 head = repo[heads.first()]
2448 disallowunstable = not obsolete.isenabled(repo, obsolete.allowunstableopt)
2449 if disallowunstable:
2450 if len(repo.revs("(%ld::) - %ld", revs, revs)) != 0:
2451 raise util.Abort(_("cannot fold chain not ending with a head "\
2452 "or with branching"))
2448 wlock = lock = None 2453 wlock = lock = None
2449 try: 2454 try:
2450 wlock = repo.wlock() 2455 wlock = repo.wlock()
2451 lock = repo.lock() 2456 lock = repo.lock()
2452 tr = repo.transaction('touch') 2457 tr = repo.transaction('touch')