Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
22056:83df50a8d61c | 22057:445472225ccd |
---|---|
40 if checksubstate(repo): | 40 if checksubstate(repo): |
41 _("local changed subrepos found") # i18n tool detection | 41 _("local changed subrepos found") # i18n tool detection |
42 raise util.Abort(_("local changed subrepos found" + excsuffix)) | 42 raise util.Abort(_("local changed subrepos found" + excsuffix)) |
43 return m, a, r, d | 43 return m, a, r, d |
44 | 44 |
45 def strip(ui, repo, revs, update=True, backup="all", force=None, bookmark=None): | 45 def strip(ui, repo, revs, update=True, backup=True, force=None, bookmark=None): |
46 wlock = lock = None | 46 wlock = lock = None |
47 try: | 47 try: |
48 wlock = repo.wlock() | 48 wlock = repo.wlock() |
49 lock = repo.lock() | 49 lock = repo.lock() |
50 | 50 |
112 changesets in the public phase. But if the stripped changesets have | 112 changesets in the public phase. But if the stripped changesets have |
113 been pushed to a remote repository you will likely pull them again. | 113 been pushed to a remote repository you will likely pull them again. |
114 | 114 |
115 Return 0 on success. | 115 Return 0 on success. |
116 """ | 116 """ |
117 backup = 'all' | 117 backup = True |
118 if opts.get('backup'): | 118 if opts.get('no_backup') or opts.get('nobackup'): |
119 backup = 'strip' | 119 backup = False |
120 elif opts.get('no_backup') or opts.get('nobackup'): | |
121 backup = 'none' | |
122 | 120 |
123 cl = repo.changelog | 121 cl = repo.changelog |
124 revs = list(revs) + opts.get('rev') | 122 revs = list(revs) + opts.get('rev') |
125 revs = set(scmutil.revrange(repo, revs)) | 123 revs = set(scmutil.revrange(repo, revs)) |
126 | 124 |