Mercurial > public > mercurial-scm > hg
diff hgext/strip.py @ 22057:445472225ccd
strip: remove -b/--backup codepaths
cset ba3bc6474bbf has removed this option. This commit just tidies the
code that was associated to it. It also fixes the internal calls to
the strip() function.
Before this change, any function that thought it would want as a final
safety to keep a partial backup bundle (bundling changes not linearly
related to the current change being stripped), had to explicitly pass
a backup="strip" option. With this change, these backups are always
kept in case of an exception and always removed if there is no
exception. Only full backups can be specified with backup=True or no
full backups with backup=False.
author | Jordi Guti?rrez Hermoso <jordigh@octave.org> |
---|---|
date | Thu, 24 Jul 2014 15:06:08 -0400 |
parents | ba3bc6474bbf |
children | 68df36ce3d8a |
line wrap: on
line diff
--- a/hgext/strip.py Thu Aug 07 12:51:45 2014 -0400 +++ b/hgext/strip.py Thu Jul 24 15:06:08 2014 -0400 @@ -42,7 +42,7 @@ 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, bookmark=None): wlock = lock = None try: wlock = repo.wlock() @@ -114,11 +114,9 @@ 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')