Show More
@@ -2676,12 +2676,34 b' def perf_unbundle(ui, repo, fname, **opt' | |||
|
2676 | 2676 | """benchmark application of a bundle in a repository. |
|
2677 | 2677 | |
|
2678 | 2678 | This does not include the final transaction processing""" |
|
2679 | ||
|
2679 | 2680 | from mercurial import exchange |
|
2680 | 2681 | from mercurial import bundle2 |
|
2682 | from mercurial import transaction | |
|
2681 | 2683 | |
|
2682 | 2684 | opts = _byteskwargs(opts) |
|
2683 | 2685 | |
|
2684 | if True: | |
|
2686 | ### some compatibility hotfix | |
|
2687 | # | |
|
2688 | # the data attribute is dropped in 63edc384d3b7 a changeset introducing a | |
|
2689 | # critical regression that break transaction rollback for files that are | |
|
2690 | # de-inlined. | |
|
2691 | method = transaction.transaction._addentry | |
|
2692 | pre_63edc384d3b7 = "data" in getargspec(method).args | |
|
2693 | # the `detailed_exit_code` attribute is introduced in 33c0c25d0b0f | |
|
2694 | # a changeset that is a close descendant of 18415fc918a1, the changeset | |
|
2695 | # that conclude the fix run for the bug introduced in 63edc384d3b7. | |
|
2696 | args = getargspec(error.Abort.__init__).args | |
|
2697 | post_18415fc918a1 = "detailed_exit_code" in args | |
|
2698 | ||
|
2699 | old_max_inline = None | |
|
2700 | try: | |
|
2701 | if not (pre_63edc384d3b7 or post_18415fc918a1): | |
|
2702 | # disable inlining | |
|
2703 | old_max_inline = mercurial.revlog._maxinline | |
|
2704 | # large enough to never happen | |
|
2705 | mercurial.revlog._maxinline = 2 ** 50 | |
|
2706 | ||
|
2685 | 2707 | with repo.lock(): |
|
2686 | 2708 | bundle = [None, None] |
|
2687 | 2709 | orig_quiet = repo.ui.quiet |
@@ -2721,6 +2743,9 b' def perf_unbundle(ui, repo, fname, **opt' | |||
|
2721 | 2743 | gen, tr = bundle |
|
2722 | 2744 | if tr is not None: |
|
2723 | 2745 | tr.abort() |
|
2746 | finally: | |
|
2747 | if old_max_inline is not None: | |
|
2748 | mercurial.revlog._maxinline = old_max_inline | |
|
2724 | 2749 | |
|
2725 | 2750 | |
|
2726 | 2751 | @command( |
General Comments 0
You need to be logged in to leave comments.
Login now