##// END OF EJS Templates
strip: simplify some repeated conditions...
Martin von Zweigbergk -
r29951:e7acbe53 default
parent child Browse files
Show More
@@ -147,7 +147,8 b' def strip(ui, repo, nodelist, backup=Tru'
147 vfs.join(backupfile))
147 vfs.join(backupfile))
148 repo.ui.log("backupbundle", "saved backup bundle to %s\n",
148 repo.ui.log("backupbundle", "saved backup bundle to %s\n",
149 vfs.join(backupfile))
149 vfs.join(backupfile))
150 if saveheads or savebases:
150 chgrpfile = None
151 if saveheads:
151 # do not compress partial bundle if we remove it from disk later
152 # do not compress partial bundle if we remove it from disk later
152 chgrpfile = _bundle(repo, savebases, saveheads, node, 'temp',
153 chgrpfile = _bundle(repo, savebases, saveheads, node, 'temp',
153 compress=False)
154 compress=False)
@@ -184,7 +185,7 b' def strip(ui, repo, nodelist, backup=Tru'
184 if troffset == 0:
185 if troffset == 0:
185 repo.store.markremoved(file)
186 repo.store.markremoved(file)
186
187
187 if saveheads or savebases:
188 if chgrpfile:
188 ui.note(_("adding branch\n"))
189 ui.note(_("adding branch\n"))
189 f = vfs.open(chgrpfile, "rb")
190 f = vfs.open(chgrpfile, "rb")
190 gen = exchange.readbundle(ui, f, chgrpfile, vfs)
191 gen = exchange.readbundle(ui, f, chgrpfile, vfs)
@@ -229,12 +230,12 b' def strip(ui, repo, nodelist, backup=Tru'
229 if backupfile:
230 if backupfile:
230 ui.warn(_("strip failed, full bundle stored in '%s'\n")
231 ui.warn(_("strip failed, full bundle stored in '%s'\n")
231 % vfs.join(backupfile))
232 % vfs.join(backupfile))
232 elif saveheads:
233 elif chgrpfile:
233 ui.warn(_("strip failed, partial bundle stored in '%s'\n")
234 ui.warn(_("strip failed, partial bundle stored in '%s'\n")
234 % vfs.join(chgrpfile))
235 % vfs.join(chgrpfile))
235 raise
236 raise
236 else:
237 else:
237 if saveheads or savebases:
238 if chgrpfile:
238 # Remove partial backup only if there were no exceptions
239 # Remove partial backup only if there were no exceptions
239 vfs.unlink(chgrpfile)
240 vfs.unlink(chgrpfile)
240
241
General Comments 0
You need to be logged in to leave comments. Login now