Mercurial > hg
comparison hgext/mq.py @ 12682:58a3e2608ae4
strip: add --keep flag to avoid modifying wc during strip
Fixes issue1564.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Sat, 09 Oct 2010 11:02:11 -0500 |
parents | 97d7ee445e98 |
children | c52c629ce19e |
comparison
equal
deleted
inserted
replaced
12681:bc13e17067d9 | 12682:58a3e2608ae4 |
---|---|
2520 start = i | 2520 start = i |
2521 break | 2521 break |
2522 del q.applied[start:end] | 2522 del q.applied[start:end] |
2523 q.save_dirty() | 2523 q.save_dirty() |
2524 | 2524 |
2525 repo.mq.strip(repo, list(rootnodes), backup=backup, update=update, | 2525 revs = list(rootnodes) |
2526 if update and opts.get('keep'): | |
2527 wlock = repo.wlock() | |
2528 try: | |
2529 urev = repo.mq.qparents(repo, revs[0]) | |
2530 repo.dirstate.rebuild(urev, repo[urev].manifest()) | |
2531 repo.dirstate.write() | |
2532 update = False | |
2533 finally: | |
2534 wlock.release() | |
2535 | |
2536 repo.mq.strip(repo, revs, backup=backup, update=update, | |
2526 force=opts.get('force')) | 2537 force=opts.get('force')) |
2527 return 0 | 2538 return 0 |
2528 | 2539 |
2529 def select(ui, repo, *args, **opts): | 2540 def select(ui, repo, *args, **opts): |
2530 '''set or print guarded patches to push | 2541 '''set or print guarded patches to push |
3143 [('f', 'force', None, _('force removal of changesets even if the ' | 3154 [('f', 'force', None, _('force removal of changesets even if the ' |
3144 'working directory has uncommitted changes')), | 3155 'working directory has uncommitted changes')), |
3145 ('b', 'backup', None, _('bundle only changesets with local revision' | 3156 ('b', 'backup', None, _('bundle only changesets with local revision' |
3146 ' number greater than REV which are not' | 3157 ' number greater than REV which are not' |
3147 ' descendants of REV (DEPRECATED)')), | 3158 ' descendants of REV (DEPRECATED)')), |
3148 ('n', 'no-backup', None, _('no backups')), | 3159 ('n', 'no-backup', None, _('no backups')), |
3149 ('', 'nobackup', None, _('no backups (DEPRECATED)'))], | 3160 ('', 'nobackup', None, _('no backups (DEPRECATED)')), |
3150 _('hg strip [-f] [-n] REV...')), | 3161 ('k', 'keep', None, _("do not modify working copy during strip"))], |
3162 _('hg strip [-k] [-f] [-n] REV...')), | |
3151 "qtop": (top, [] + seriesopts, _('hg qtop [-s]')), | 3163 "qtop": (top, [] + seriesopts, _('hg qtop [-s]')), |
3152 "qunapplied": | 3164 "qunapplied": |
3153 (unapplied, | 3165 (unapplied, |
3154 [('1', 'first', None, _('show only the first patch'))] + seriesopts, | 3166 [('1', 'first', None, _('show only the first patch'))] + seriesopts, |
3155 _('hg qunapplied [-1] [-s] [PATCH]')), | 3167 _('hg qunapplied [-1] [-s] [PATCH]')), |