Mercurial > hg
comparison hgext/mq.py @ 11637:64f284da1278 stable
mq: cleanup status if applied mq is stripped (issue1881)
stripping of applied mq patches leads to wrong state recorded in status
file. find all mq patches that will be affected and clean up status file
before strip.
author | Vishakh H <vsh426@gmail.com> |
---|---|
date | Tue, 20 Jul 2010 20:37:29 +0530 |
parents | 134eb1c97e94 |
children | c4f6f0a1bd5a 3e561b6af810 |
comparison
equal
deleted
inserted
replaced
11636:c10eaf1210cd | 11637:64f284da1278 |
---|---|
2415 update = False | 2415 update = False |
2416 elif p[1] == nullid and rev != cl.ancestor(p[0], rev): | 2416 elif p[1] == nullid and rev != cl.ancestor(p[0], rev): |
2417 update = False | 2417 update = False |
2418 elif rev not in (cl.ancestor(p[0], rev), cl.ancestor(p[1], rev)): | 2418 elif rev not in (cl.ancestor(p[0], rev), cl.ancestor(p[1], rev)): |
2419 update = False | 2419 update = False |
2420 | |
2421 q = repo.mq | |
2422 if q.applied: | |
2423 if rev == cl.ancestor(repo.lookup('qtip'), rev): | |
2424 q.applied_dirty = True | |
2425 start = 0 | |
2426 end = len(q.applied) | |
2427 applied_list = [i.node for i in q.applied] | |
2428 if rev in applied_list: | |
2429 start = applied_list.index(rev) | |
2430 del q.applied[start:end] | |
2431 q.save_dirty() | |
2420 | 2432 |
2421 repo.mq.strip(repo, rev, backup=backup, update=update, force=opts['force']) | 2433 repo.mq.strip(repo, rev, backup=backup, update=update, force=opts['force']) |
2422 return 0 | 2434 return 0 |
2423 | 2435 |
2424 def select(ui, repo, *args, **opts): | 2436 def select(ui, repo, *args, **opts): |