Mercurial > hg
comparison mercurial/repair.py @ 32930:af31d531dda0
changegroup: let callers pass in transaction to apply() (API)
I think passing in the transaction makes it a little clearer and more
consistent with bundle2.
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 15 Jun 2017 22:46:38 -0700 |
parents | d11e2343762b |
children | 8e3021fd1a44 |
comparison
equal
deleted
inserted
replaced
32929:d11e2343762b | 32930:af31d531dda0 |
---|---|
206 with repo.transaction('strip') as tr: | 206 with repo.transaction('strip') as tr: |
207 bundle2.applybundle(repo, gen, tr, source='strip', | 207 bundle2.applybundle(repo, gen, tr, source='strip', |
208 url=tmpbundleurl) | 208 url=tmpbundleurl) |
209 else: | 209 else: |
210 txnname = "strip\n%s" % util.hidepassword(tmpbundleurl) | 210 txnname = "strip\n%s" % util.hidepassword(tmpbundleurl) |
211 with repo.transaction(txnname): | 211 with repo.transaction(txnname) as tr: |
212 gen.apply(repo, 'strip', tmpbundleurl, True) | 212 gen.apply(repo, tr, 'strip', tmpbundleurl, True) |
213 if not repo.ui.verbose: | 213 if not repo.ui.verbose: |
214 repo.ui.popbuffer() | 214 repo.ui.popbuffer() |
215 f.close() | 215 f.close() |
216 repo._phasecache.invalidate() | 216 repo._phasecache.invalidate() |
217 | 217 |