##// END OF EJS Templates
split: close transaction in the unlikely event of a conflict while rebasing...
split: close transaction in the unlikely event of a conflict while rebasing `hg split` *should* never result in conflicts, but in case there are bugs, we should at least commit the transaction so they can continue the rebase. One of our users ran into the regression fixed by D10120. They fixed the conflict and the tried to continue the rebase, but it failed with "abort: cannot continue inconsistent rebase" because the rebase state referred to commits written in a transaction that was never committed. Side note: `hg split` should probably turn off copy tracing to reduce the impact of such bugs, and to speed it up as well. Copies made in the rebased commits should still be respected because `hg rebase` calls `copies.graftcopies()`. Differential Revision: https://phab.mercurial-scm.org/D10164

File last commit:

r43346:2372284d default
r47492:7f6c002d default
Show More
revset.py
57 lines | 1.6 KiB | text/x-python | PythonLexer
Philippe Pepiot
perf: add asv benchmarks...
r30406 # revset.py - asv revset benchmarks
#
# Copyright 2016 Logilab SA <contact@logilab.fr>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''ASV revset benchmarks generated from contrib/base-revsets.txt
Each revset benchmark is parameterized with variants (first, last, sort, ...)
'''
from __future__ import absolute_import
import os
import string
import sys
from . import basedir, perfbench
Augie Fackler
formatting: blacken the codebase...
r43346
Philippe Pepiot
perf: add asv benchmarks...
r30406 def createrevsetbenchmark(baseset, variants=None):
if variants is None:
# Default variants
Augie Fackler
formatting: blacken the codebase...
r43346 variants = ["plain", "first", "last", "sort", "sort+first", "sort+last"]
fname = "track_" + "_".join(
"".join(
[c if c in string.digits + string.letters else " " for c in baseset]
).split()
)
Philippe Pepiot
perf: add asv benchmarks...
r30406
def wrap(fname, baseset):
@perfbench(name=baseset, params=[("variant", variants)])
def f(perf, variant):
revset = baseset
if variant != "plain":
for var in variant.split("+"):
revset = "%s(%s)" % (var, revset)
return perf("perfrevset", revset)
Augie Fackler
formatting: blacken the codebase...
r43346
Philippe Pepiot
perf: add asv benchmarks...
r30406 f.__name__ = fname
return f
Augie Fackler
formatting: blacken the codebase...
r43346
Philippe Pepiot
perf: add asv benchmarks...
r30406 return wrap(fname, baseset)
Augie Fackler
formatting: blacken the codebase...
r43346
Philippe Pepiot
perf: add asv benchmarks...
r30406 def initializerevsetbenchmarks():
mod = sys.modules[__name__]
Augie Fackler
formatting: blacken the codebase...
r43346 with open(os.path.join(basedir, 'contrib', 'base-revsets.txt'), 'rb') as fh:
Philippe Pepiot
perf: add asv benchmarks...
r30406 for line in fh:
baseset = line.strip()
if baseset and not baseset.startswith('#'):
func = createrevsetbenchmark(baseset)
setattr(mod, func.__name__, func)
Augie Fackler
formatting: blacken the codebase...
r43346
Philippe Pepiot
perf: add asv benchmarks...
r30406 initializerevsetbenchmarks()