This instance will be upgraded to Heptapod 0.31.0rc on 2022-05-19 at 11:00 UTC+2 (a few minutes of down time)

Commit c979d64a authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

compat: drop 4.5 compatibility layer for log utility

parent 515d425c0a05
......@@ -274,6 +274,7 @@
help,
hg,
lock as lockmod,
logcmdutil,
node,
patch,
pycompat,
......@@ -984,7 +985,8 @@
if topic and hastopic:
template = utility.stacktemplate
displayer = compat.changesetdisplayer(ui, repo, {b'template': template})
displayer = logcmdutil.changesetdisplayer(ui, repo,
{b'template': template})
target, bookmark = _findprevtarget(repo, displayer,
opts.get('move_bookmark'), topic)
......@@ -1042,7 +1044,8 @@
children = [ctx for ctx in children if ctx not in filtered]
template = utility.stacktemplate
opts['stacktemplate'] = True
displayer = compat.changesetdisplayer(ui, repo, {b'template': template})
displayer = logcmdutil.changesetdisplayer(ui, repo,
{b'template': template})
# check if we need to evolve while updating to the next child revision
needevolve = False
......
......@@ -23,6 +23,7 @@
error,
hg,
lock as lockmod,
logcmdutil,
merge,
node,
obsolete,
......@@ -1397,7 +1398,7 @@
with ui.configoverride(overrides, b'touch'):
rewriteutil.precheck(repo, revs, b'touch')
tmpl = utility.shorttemplate
displayer = compat.changesetdisplayer(ui, repo, {b'template': tmpl})
displayer = logcmdutil.changesetdisplayer(ui, repo, {b'template': tmpl})
with repo.wlock(), repo.lock(), repo.transaction(b'touch'):
touchnodes(ui, repo, revs, displayer, **opts)
......
......@@ -30,20 +30,6 @@
arraytobytes = array.array.tostring
arrayfrombytes = array.array.fromstring
# hg < 4.6 compat (c8e2d6ed1f9e)
try:
from mercurial import logcmdutil
changesetdisplayer = logcmdutil.changesetdisplayer
changesetprinter = logcmdutil.changesetprinter
displaygraph = logcmdutil.displaygraph
changesetdiffer = logcmdutil.changesetdiffer
except (AttributeError, ImportError):
from mercurial import cmdutil
changesetdisplayer = cmdutil.show_changeset # pytype: disable=module-attr
changesetprinter = cmdutil.changeset_printer # pytype: disable=module-attr
displaygraph = cmdutil.displaygraph # pytype: disable=module-attr
changesetdiffer = None
# hg <= 5.3 (c21aca51b392)
try:
from mercurial import pathutil
......
......@@ -16,4 +16,5 @@
cmdutil,
commands,
context,
encoding,
error,
......@@ -19,3 +20,2 @@
error,
encoding,
hg,
......@@ -21,4 +21,5 @@
hg,
logcmdutil,
merge,
mergeutil,
node as nodemod,
......@@ -68,6 +69,6 @@
assert tr is not None
displayer = None
if stacktmplt:
displayer = compat.changesetdisplayer(ui, repo,
{b'template': stacktemplate})
displayer = logcmdutil.changesetdisplayer(ui, repo,
{b'template': stacktemplate})
else:
......@@ -73,6 +74,6 @@
else:
displayer = compat.changesetdisplayer(ui, repo,
{b'template': shorttemplate})
displayer = logcmdutil.changesetdisplayer(ui, repo,
{b'template': shorttemplate})
if b'orphan' == category:
result = _solveunstable(ui, repo, ctx, evolvestate, displayer,
dryrun, confirm, progresscb,
......@@ -1814,8 +1815,8 @@
oldid = repo[b'.'].node()
startctx = repo[b'.']
dryrunopt = opts.get('dry_run', False)
displayer = compat.changesetdisplayer(ui, repo,
{b'template': shorttemplate})
displayer = logcmdutil.changesetdisplayer(ui, repo,
{b'template': shorttemplate})
try:
ctx = repo[utility._singlesuccessor(repo, repo[b'.'])]
except utility.MultipleSuccessorsError as exc:
......
......@@ -13,5 +13,6 @@
commands,
error,
graphmod,
patch,
logcmdutil,
node as nodemod,
obsutil,
......@@ -17,5 +18,5 @@
obsutil,
node as nodemod,
patch,
pycompat,
scmutil,
util,
......@@ -134,7 +135,7 @@
b"patch": TEMPLATE_PATCH,
}
class obsmarker_printer(compat.changesetprinter):
class obsmarker_printer(logcmdutil.changesetprinter):
"""show (available) information about a node
We display the node, description (if available) and various information
......@@ -143,7 +144,7 @@
def __init__(self, ui, repo, *args, **kwargs):
if kwargs.pop('obspatch', False):
if compat.changesetdiffer is None:
if logcmdutil.changesetdiffer is None:
kwargs['matchfn'] = scmutil.matchall(repo)
else:
kwargs['differ'] = scmutil.matchall(repo)
......@@ -435,7 +436,7 @@
edges = graphmod.asciiedges
walker = _obshistorywalker(repo.unfiltered(), revs, opts.get('all', False),
opts.get('filternonlocal', False))
compat.displaygraph(ui, repo, walker, displayer, edges)
logcmdutil.displaygraph(ui, repo, walker, displayer, edges)
def _debugobshistoryrevs(ui, repo, revs, opts):
""" Display the obsolescence history for revset
......
......@@ -252,4 +252,5 @@
from mercurial import (
commands,
error,
localrepo,
......@@ -255,5 +256,5 @@
localrepo,
error,
logcmdutil,
node as nodemod,
pycompat,
scmutil,
......@@ -314,8 +315,9 @@
raise error.Abort(b'unknown sorting method: "%s"' % method,
hint=b'pick one of: %s' % valid_method)
displayer = compat.changesetdisplayer(ui, repo, pycompat.byteskwargs(opts),
buffered=True)
displayer = logcmdutil.changesetdisplayer(ui, repo,
pycompat.byteskwargs(opts),
buffered=True)
kwargs = {}
if opts['limit']:
kwargs['limit'] = int(opts['limit'])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment