236 |
236 |
237 ui.note(_("adding branch\n")) |
237 ui.note(_("adding branch\n")) |
238 f = vfs.open(chgrpfile, "rb") |
238 f = vfs.open(chgrpfile, "rb") |
239 try: |
239 try: |
240 gen = exchange.readbundle(ui, f, chgrpfile, vfs) |
240 gen = exchange.readbundle(ui, f, chgrpfile, vfs) |
241 if not ui.verbose: |
241 # silence internal shuffling chatter |
242 # silence internal shuffling chatter |
242 override = {('ui', 'quiet'): True} |
243 ui.pushbuffer() |
243 if ui.verbose: |
244 if isinstance(gen, bundle2.unbundle20): |
244 override = {} |
245 with repo.transaction('strip') as tr: |
245 with ui.configoverride(override): |
246 bundle2.processbundle(repo, gen, lambda: tr) |
246 if isinstance(gen, bundle2.unbundle20): |
247 else: |
247 with repo.transaction('strip') as tr: |
248 gen.apply(repo, 'strip', 'bundle:' + vfs.join(chgrpfile), True) |
248 bundle2.processbundle(repo, gen, lambda: tr) |
249 if not ui.verbose: |
249 else: |
250 ui.popbuffer() |
250 gen.apply(repo, 'strip', 'bundle:' + vfs.join(chgrpfile), True) |
251 finally: |
251 finally: |
252 f.close() |
252 f.close() |
253 |
253 |
254 # remove undo files |
254 # remove undo files |
255 for undovfs, undofile in repo.undofiles(): |
255 for undovfs, undofile in repo.undofiles(): |