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 df5e6e38 authored by Pierre-Yves David's avatar Pierre-Yves David 🐙
Browse files

compat: drop 4.5 compatibility for strdiff

parent c979d64a2589
......@@ -8,8 +8,7 @@
import array
import contextlib
import inspect
from mercurial import (
context,
copies,
......@@ -12,8 +11,7 @@
from mercurial import (
context,
copies,
mdiff,
obsolete,
pycompat,
registrar,
......@@ -93,24 +91,6 @@
copied=copied.get(path)) # pytype: disable=wrong-keyword-args
return mctx
def strdiff(a, b, fn1, fn2):
""" A version of mdiff.unidiff for comparing two strings
"""
args = [a, b'', b, b'', fn1, fn2]
# hg < 4.6 compat 8b6dd3922f70
if util.safehasattr(inspect, 'signature'):
signature = inspect.signature(mdiff.unidiff)
needsbinary = r'binary' in signature.parameters
else:
argspec = inspect.getargspec(mdiff.unidiff)
needsbinary = r'binary' in argspec.args
if needsbinary:
args.append(False)
return mdiff.unidiff(*args)
# 46c2b19a1263f18a5829a21b7a5053019b0c5a31 in hg moved repair.stripbmrevset to
# scmutil.bookmarkrevs
# This change is a part of 4.7 cycle, so drop this when we drop support for hg <= 4.6
......
......@@ -14,6 +14,7 @@
error,
graphmod,
logcmdutil,
mdiff,
node as nodemod,
obsutil,
patch,
......@@ -248,8 +249,8 @@
basename = b"changeset-description"
succname = b"changeset-description"
d = compat.strdiff(basedesc, succdesc, basename, succname)
uheaders, hunks = d
uheaders, hunks = mdiff.unidiff(basedesc, b'', succdesc, b'',
basename, succname, False)
# Copied from patch.diff
text = b''.join(sum((list(hlines) for hrange, hlines in hunks), []))
......
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