Show More
@@ -662,14 +662,14 b' class queue:' | |||
|
662 | 662 | finally: |
|
663 | 663 | del wlock |
|
664 | 664 | |
|
665 | def strip(self, repo, rev, update=True, backup="all"): | |
|
665 | def strip(self, repo, rev, update=True, backup="all", force=None): | |
|
666 | 666 | wlock = lock = None |
|
667 | 667 | try: |
|
668 | 668 | wlock = repo.wlock() |
|
669 | 669 | lock = repo.lock() |
|
670 | 670 | |
|
671 | 671 | if update: |
|
672 | self.check_localchanges(repo, refresh=False) | |
|
672 | self.check_localchanges(repo, force=force, refresh=False) | |
|
673 | 673 | urev = self.qparents(repo, rev) |
|
674 | 674 | hg.clean(repo, urev) |
|
675 | 675 | repo.dirstate.write() |
@@ -2043,7 +2043,7 b' def strip(ui, repo, rev, **opts):' | |||
|
2043 | 2043 | elif opts['nobackup']: |
|
2044 | 2044 | backup = 'none' |
|
2045 | 2045 | update = repo.dirstate.parents()[0] != revlog.nullid |
|
2046 | repo.mq.strip(repo, rev, backup=backup, update=update) | |
|
2046 | repo.mq.strip(repo, rev, backup=backup, update=update, force=opts['force']) | |
|
2047 | 2047 | return 0 |
|
2048 | 2048 | |
|
2049 | 2049 | def select(ui, repo, *args, **opts): |
@@ -2352,7 +2352,8 b' cmdtable = {' | |||
|
2352 | 2352 | _('hg qseries [-ms]')), |
|
2353 | 2353 | "^strip": |
|
2354 | 2354 | (strip, |
|
2355 |
[(' |
|
|
2355 | [('f', 'force', None, _('force removal with local changes')), | |
|
2356 | ('b', 'backup', None, _('bundle unrelated changesets')), | |
|
2356 | 2357 | ('n', 'nobackup', None, _('no backups'))], |
|
2357 | 2358 | _('hg strip [-f] [-b] [-n] REV')), |
|
2358 | 2359 | "qtop": (top, [] + seriesopts, _('hg qtop [-s]')), |
@@ -266,6 +266,14 b' hg ci -Ama' | |||
|
266 | 266 | hg strip tip 2>&1 | sed 's/\(saving bundle to \).*/\1/' |
|
267 | 267 | hg unbundle .hg/strip-backup/* |
|
268 | 268 | |
|
269 | echo % strip with local changes, should complain | |
|
270 | hg up | |
|
271 | echo y>y | |
|
272 | hg add y | |
|
273 | hg strip tip | sed 's/\(saving bundle to \).*/\1/' | |
|
274 | echo % --force strip with local changes | |
|
275 | hg strip -f tip 2>&1 | sed 's/\(saving bundle to \).*/\1/' | |
|
276 | ||
|
269 | 277 | echo '% cd b; hg qrefresh' |
|
270 | 278 | hg init refresh |
|
271 | 279 | cd refresh |
@@ -250,6 +250,12 b' adding manifests' | |||
|
250 | 250 | adding file changes |
|
251 | 251 | added 1 changesets with 1 changes to 1 files |
|
252 | 252 | (run 'hg update' to get a working copy) |
|
253 | % strip with local changes, should complain | |
|
254 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
255 | abort: local changes found | |
|
256 | % --force strip with local changes | |
|
257 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
|
258 | saving bundle to | |
|
253 | 259 | % cd b; hg qrefresh |
|
254 | 260 | adding a |
|
255 | 261 | foo |
General Comments 0
You need to be logged in to leave comments.
Login now