@@ -42,7 +42,7 @@ def checklocalchanges(repo, force=False,
raise util.Abort(_("local changed subrepos found" + excsuffix))
return m, a, r, d
-def strip(ui, repo, revs, update=True, backup="all", force=None, bookmark=None):
+def strip(ui, repo, revs, update=True, backup=True, force=None):
wlock = lock = None
try:
wlock = repo.wlock()
@@ -114,11 +114,9 @@ def stripcmd(ui, repo, *revs, **opts):
Return 0 on success.
"""
- backup = 'all'
- if opts.get('backup'):
- backup = 'strip'
- elif opts.get('no_backup') or opts.get('nobackup'):
- backup = 'none'
+ backup = True
+ if opts.get('no_backup') or opts.get('nobackup'):
+ backup = False
cl = repo.changelog
revs = list(revs) + opts.get('rev')
@@ -47,7 +47,7 @@ def _collectbrokencsets(repo, files, str
return s
-def strip(ui, repo, nodelist, backup="all", topic='backup'):
+def strip(ui, repo, nodelist, backup=True, topic='backup'):
repo = repo.unfiltered()
repo.destroying()
@@ -58,8 +58,6 @@ def strip(ui, repo, nodelist, backup="al
striplist = [cl.rev(node) for node in nodelist]
striprev = min(striplist)
- keeppartialbundle = backup == 'strip'
-
# Some revisions with rev > striprev may not be descendants of striprev.
# We have to find these revisions and put them in a bundle, so that
# we can restore them after the truncations.
@@ -109,7 +107,7 @@ def strip(ui, repo, nodelist, backup="al
# create a changegroup for all the branches we need to keep
backupfile = None
vfs = repo.vfs
- if backup == "all":
+ if backup:
backupfile = _bundle(repo, stripbases, cl.heads(), node, topic)
repo.ui.status(_("saved backup bundle to %s\n") %
vfs.join(backupfile))
@@ -118,7 +116,7 @@ def strip(ui, repo, nodelist, backup="al
if saveheads or savebases:
# do not compress partial bundle if we remove it from disk later
chgrpfile = _bundle(repo, savebases, saveheads, node, 'temp',
- compress=keeppartialbundle)
+ compress=False)
mfst = repo.manifest
@@ -156,8 +154,8 @@ def strip(ui, repo, nodelist, backup="al
if not repo.ui.verbose:
repo.ui.popbuffer()
f.close()
- if not keeppartialbundle:
- vfs.unlink(chgrpfile)
+
+ vfs.unlink(chgrpfile)
# remove undo files
for undovfs, undofile in repo.undofiles():