##// END OF EJS Templates
bundle: transpose transaction scope with bundle type switch...
Martin von Zweigbergk -
r33042:dbc2ee17 default
parent child Browse files
Show More
@@ -5203,14 +5203,15 b' def unbundle(ui, repo, fname1, *fnames, '
5203 hint=_('use "hg debugapplystreamclonebundle"'))
5203 hint=_('use "hg debugapplystreamclonebundle"'))
5204 url = 'bundle:' + fname
5204 url = 'bundle:' + fname
5205 try:
5205 try:
5206 txnname = 'unbundle'
5207 if not isinstance(gen, bundle2.unbundle20):
5208 txnname = 'unbundle\n%s' % util.hidepassword(url)
5209 with repo.transaction(txnname) as tr:
5206 if isinstance(gen, bundle2.unbundle20):
5210 if isinstance(gen, bundle2.unbundle20):
5207 with repo.transaction('unbundle') as tr:
5208 op = bundle2.applybundle(repo, gen, tr,
5211 op = bundle2.applybundle(repo, gen, tr,
5209 source='unbundle',
5212 source='unbundle',
5210 url=url)
5213 url=url)
5211 else:
5214 else:
5212 txnname = 'unbundle\n%s' % util.hidepassword(url)
5213 with repo.transaction(txnname) as tr:
5214 op = bundle2.applybundle1(repo, gen, tr,
5215 op = bundle2.applybundle1(repo, gen, tr,
5215 source='unbundle', url=url)
5216 source='unbundle', url=url)
5216 except error.BundleUnknownFeatureError as exc:
5217 except error.BundleUnknownFeatureError as exc:
@@ -207,13 +207,14 b' def strip(ui, repo, nodelist, backup=Tru'
207 # silence internal shuffling chatter
207 # silence internal shuffling chatter
208 repo.ui.pushbuffer()
208 repo.ui.pushbuffer()
209 tmpbundleurl = 'bundle:' + vfs.join(tmpbundlefile)
209 tmpbundleurl = 'bundle:' + vfs.join(tmpbundlefile)
210 txnname = 'strip'
211 if not isinstance(gen, bundle2.unbundle20):
212 txnname = "strip\n%s" % util.hidepassword(tmpbundleurl)
213 with repo.transaction(txnname) as tr:
210 if isinstance(gen, bundle2.unbundle20):
214 if isinstance(gen, bundle2.unbundle20):
211 with repo.transaction('strip') as tr:
212 bundle2.applybundle(repo, gen, tr, source='strip',
215 bundle2.applybundle(repo, gen, tr, source='strip',
213 url=tmpbundleurl)
216 url=tmpbundleurl)
214 else:
217 else:
215 txnname = "strip\n%s" % util.hidepassword(tmpbundleurl)
216 with repo.transaction(txnname) as tr:
217 bundle2.applybundle1(repo, gen, tr, 'strip', tmpbundleurl,
218 bundle2.applybundle1(repo, gen, tr, 'strip', tmpbundleurl,
218 emptyok=True)
219 emptyok=True)
219 if not repo.ui.verbose:
220 if not repo.ui.verbose:
General Comments 0
You need to be logged in to leave comments. Login now