Bug 4295 - strip -B deletes bookmark before doing anything else
Summary: strip -B deletes bookmark before doing anything else
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: mq (show other bugs)
Version: 3.0.2
Hardware: PC Mac OS
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-05 00:32 UTC by Bryan O'Sullivan
Modified: 2014-07-25 17:26 UTC (History)
2 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bryan O'Sullivan 2014-07-05 00:32 UTC
The -B option to "hg strip" deletes the bookmark before checking if it can actually strip anything.

This makes it easy to lose a bookmark in a situation where a strip will abort due to e.g. a dirty working directory. If that occurs, it becomes way harder to kill off an unwanted head and its ancestors, because there's no longer a bookmark referring to them:

hg init wat
cd wat
echo a>a
hg ci -Ama
echo a>>a
hg ci -Amb
hg bookmark wat
echo b>>a
# this will delete the bookmark, but the strip will not proceed
hg strip -B wat
Comment 1 David Soria Parra 2014-07-09 00:09 UTC
Fix ready and queued.
Comment 2 HG Bot 2014-07-09 13:45 UTC
Fixed by http://selenic.com/repo/hg/rev/f6f122f4813b
David Soria Parra <davidsp@fb.com>
strip: remove bookmarks after strip succeed (issue4295)

In case we have revs to strip, delete the bookmark after the strip succeeds, not
beforehand as we might still abort due to dirty working directory, etc.

(please test the fix)