Show More
@@ -2681,44 +2681,46 b' def perf_unbundle(ui, repo, fname, **opt' | |||||
2681 |
|
2681 | |||
2682 | opts = _byteskwargs(opts) |
|
2682 | opts = _byteskwargs(opts) | |
2683 |
|
2683 | |||
2684 | with repo.lock(): |
|
2684 | if True: | |
2685 | bundle = [None, None] |
|
2685 | with repo.lock(): | |
2686 | orig_quiet = repo.ui.quiet |
|
2686 | bundle = [None, None] | |
2687 | try: |
|
2687 | orig_quiet = repo.ui.quiet | |
2688 | repo.ui.quiet = True |
|
2688 | try: | |
2689 | with open(fname, mode="rb") as f: |
|
2689 | repo.ui.quiet = True | |
2690 |
|
2690 | with open(fname, mode="rb") as f: | ||
2691 | def noop_report(*args, **kwargs): |
|
2691 | ||
2692 | pass |
|
2692 | def noop_report(*args, **kwargs): | |
2693 |
|
2693 | pass | ||
2694 | def setup(): |
|
2694 | ||
2695 |
|
|
2695 | def setup(): | |
2696 |
|
|
2696 | gen, tr = bundle | |
2697 |
tr |
|
2697 | if tr is not None: | |
2698 | bundle[:] = [None, None] |
|
2698 | tr.abort() | |
2699 | f.seek(0) |
|
2699 | bundle[:] = [None, None] | |
2700 | bundle[0] = exchange.readbundle(ui, f, fname) |
|
2700 | f.seek(0) | |
2701 |
bundle[ |
|
2701 | bundle[0] = exchange.readbundle(ui, f, fname) | |
2702 | bundle[1]._report = noop_report # silence the transaction |
|
2702 | bundle[1] = repo.transaction(b'perf::unbundle') | |
2703 |
|
2703 | # silence the transaction | ||
2704 | def apply(): |
|
2704 | bundle[1]._report = noop_report | |
2705 | gen, tr = bundle |
|
2705 | ||
2706 |
|
|
2706 | def apply(): | |
2707 |
|
|
2707 | gen, tr = bundle | |
2708 |
|
|
2708 | bundle2.applybundle( | |
2709 |
|
|
2709 | repo, | |
2710 |
|
|
2710 | gen, | |
2711 |
|
|
2711 | tr, | |
2712 | ) |
|
2712 | source=b'perf::unbundle', | |
2713 |
|
2713 | url=fname, | ||
2714 | timer, fm = gettimer(ui, opts) |
|
2714 | ) | |
2715 | timer(apply, setup=setup) |
|
2715 | ||
2716 | fm.end() |
|
2716 | timer, fm = gettimer(ui, opts) | |
2717 | finally: |
|
2717 | timer(apply, setup=setup) | |
2718 | repo.ui.quiet == orig_quiet |
|
2718 | fm.end() | |
2719 | gen, tr = bundle |
|
2719 | finally: | |
2720 | if tr is not None: |
|
2720 | repo.ui.quiet == orig_quiet | |
2721 |
tr |
|
2721 | gen, tr = bundle | |
|
2722 | if tr is not None: | |||
|
2723 | tr.abort() | |||
2722 |
|
2724 | |||
2723 |
|
2725 | |||
2724 | @command( |
|
2726 | @command( |
General Comments 0
You need to be logged in to leave comments.
Login now