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