Show More
@@ -2522,7 +2522,18 def strip(ui, repo, *revs, **opts): | |||||
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 | |||
@@ -3146,8 +3157,9 cmdtable = { | |||||
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 |
|
|
3159 | ('n', 'no-backup', None, _('no backups')), | |
3149 |
|
|
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, |
@@ -380,3 +380,39 stripping ancestor of queue | |||||
380 | applied patches after stripping ancestor of queue |
|
380 | applied patches after stripping ancestor of queue | |
381 |
|
381 | |||
382 | $ hg qapplied |
|
382 | $ hg qapplied | |
|
383 | ||||
|
384 | Verify strip protects against stripping wc parent when there are uncommited mods | |||
|
385 | ||||
|
386 | $ echo b > b | |||
|
387 | $ hg add b | |||
|
388 | $ hg ci -m 'b' | |||
|
389 | $ hg log --graph | |||
|
390 | @ changeset: 1:7519abd79d14 | |||
|
391 | | tag: tip | |||
|
392 | | user: test | |||
|
393 | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
394 | | summary: b | |||
|
395 | | | |||
|
396 | o changeset: 0:9ab35a2d17cb | |||
|
397 | user: test | |||
|
398 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
399 | summary: a | |||
|
400 | ||||
|
401 | ||||
|
402 | $ echo c > b | |||
|
403 | $ echo c > bar | |||
|
404 | $ hg strip tip | |||
|
405 | abort: local changes found | |||
|
406 | [255] | |||
|
407 | $ hg strip tip --keep | |||
|
408 | saved backup bundle to * (glob) | |||
|
409 | $ hg log --graph | |||
|
410 | @ changeset: 0:9ab35a2d17cb | |||
|
411 | tag: tip | |||
|
412 | user: test | |||
|
413 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
414 | summary: a | |||
|
415 | ||||
|
416 | $ hg status | |||
|
417 | M bar | |||
|
418 | ? b |
General Comments 0
You need to be logged in to leave comments.
Login now