##// END OF EJS Templates
strip: don't use "full" and "partial" to describe bundles...
Martin von Zweigbergk -
r29954:769aee32 default
parent child Browse files
Show More
@@ -147,10 +147,10 b' def strip(ui, repo, nodelist, backup=Tru'
147 147 vfs.join(backupfile))
148 148 repo.ui.log("backupbundle", "saved backup bundle to %s\n",
149 149 vfs.join(backupfile))
150 chgrpfile = None
150 tmpbundlefile = None
151 151 if saveheads:
152 # do not compress partial bundle if we remove it from disk later
153 chgrpfile = _bundle(repo, savebases, saveheads, node, 'temp',
152 # do not compress temporary bundle if we remove it from disk later
153 tmpbundlefile = _bundle(repo, savebases, saveheads, node, 'temp',
154 154 compress=False)
155 155
156 156 mfst = repo.manifest
@@ -185,21 +185,22 b' def strip(ui, repo, nodelist, backup=Tru'
185 185 if troffset == 0:
186 186 repo.store.markremoved(file)
187 187
188 if chgrpfile:
188 if tmpbundlefile:
189 189 ui.note(_("adding branch\n"))
190 f = vfs.open(chgrpfile, "rb")
191 gen = exchange.readbundle(ui, f, chgrpfile, vfs)
190 f = vfs.open(tmpbundlefile, "rb")
191 gen = exchange.readbundle(ui, f, tmpbundlefile, vfs)
192 192 if not repo.ui.verbose:
193 193 # silence internal shuffling chatter
194 194 repo.ui.pushbuffer()
195 195 if isinstance(gen, bundle2.unbundle20):
196 196 with repo.transaction('strip') as tr:
197 197 tr.hookargs = {'source': 'strip',
198 'url': 'bundle:' + vfs.join(chgrpfile)}
198 'url': 'bundle:' + vfs.join(tmpbundlefile)}
199 199 bundle2.applybundle(repo, gen, tr, source='strip',
200 url='bundle:' + vfs.join(chgrpfile))
200 url='bundle:' + vfs.join(tmpbundlefile))
201 201 else:
202 gen.apply(repo, 'strip', 'bundle:' + vfs.join(chgrpfile), True)
202 gen.apply(repo, 'strip', 'bundle:' + vfs.join(tmpbundlefile),
203 True)
203 204 if not repo.ui.verbose:
204 205 repo.ui.popbuffer()
205 206 f.close()
@@ -228,18 +229,18 b' def strip(ui, repo, nodelist, backup=Tru'
228 229
229 230 except: # re-raises
230 231 if backupfile:
231 ui.warn(_("strip failed, full bundle stored in '%s'\n")
232 ui.warn(_("strip failed, backup bundle stored in '%s'\n")
232 233 % vfs.join(backupfile))
233 if chgrpfile:
234 if tmpbundlefile:
234 235 ui.warn(_("strip failed, unrecovered changes stored in '%s'\n")
235 % vfs.join(chgrpfile))
236 % vfs.join(tmpbundlefile))
236 237 ui.warn(_("(fix the problem, then recover the changesets with "
237 "\"hg unbundle '%s'\")\n") % vfs.join(chgrpfile))
238 "\"hg unbundle '%s'\")\n") % vfs.join(tmpbundlefile))
238 239 raise
239 240 else:
240 if chgrpfile:
241 # Remove partial backup only if there were no exceptions
242 vfs.unlink(chgrpfile)
241 if tmpbundlefile:
242 # Remove temporary bundle only if there were no exceptions
243 vfs.unlink(tmpbundlefile)
243 244
244 245 repo.destroyed()
245 246
@@ -802,7 +802,7 b' pretxnclose hook failure should abort th'
802 802 saved backup bundle to * (glob)
803 803 transaction abort!
804 804 rollback completed
805 strip failed, full bundle stored in * (glob)
805 strip failed, backup bundle stored in * (glob)
806 806 abort: pretxnclose.error hook exited with status 1
807 807 [255]
808 808 $ hg recover
@@ -51,7 +51,7 b''
51 51 transaction abort!
52 52 failed to truncate data/b.i
53 53 rollback failed - please run hg recover
54 strip failed, full bundle
54 strip failed, backup bundle
55 55 abort: Permission denied .hg/store/data/b.i
56 56 % after update 0, strip 2
57 57 abandoned transaction found - run hg recover
@@ -104,7 +104,7 b''
104 104 transaction abort!
105 105 failed to truncate 00manifest.i
106 106 rollback failed - please run hg recover
107 strip failed, full bundle
107 strip failed, backup bundle
108 108 abort: Permission denied .hg/store/00manifest.i
109 109 % after update 0, strip 2
110 110 abandoned transaction found - run hg recover
@@ -374,7 +374,7 b' Failed hook while applying "saveheads" b'
374 374 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
375 375 transaction abort!
376 376 rollback completed
377 strip failed, full bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob)
377 strip failed, backup bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob)
378 378 strip failed, unrecovered changes stored in '$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob)
379 379 (fix the problem, then recover the changesets with "hg unbundle '$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob)
380 380 abort: pretxnchangegroup.bad hook exited with status 1
@@ -931,7 +931,7 b' Error during post-close callback of the '
931 931 > EOF
932 932 $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py
933 933 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg (glob)
934 strip failed, full bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' (glob)
934 strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' (glob)
935 935 abort: boom
936 936 [255]
937 937
General Comments 0
You need to be logged in to leave comments. Login now