Skip to content

Commit

Permalink
mdiff: remove experimental.xdiff config and related code
Browse files Browse the repository at this point in the history
Summary:
we have enabled xdiff for 5+ years, let's remove the experimental.xdiff
config

Reviewed By: quark-zju

Differential Revision: D54324349

fbshipit-source-id: e058bd77c8c48c2e809a4ea4649d1a3ccb2d53e7
  • Loading branch information
zzl0 authored and facebook-github-bot committed Mar 1, 2024
1 parent 9b5289c commit 7518624
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
1 change: 0 additions & 1 deletion eden/scm/sapling/configitems.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ def getitemregister(configtable):
coreconfigitem("experimental", "sparse-read.min-gap-size", default="256K")
coreconfigitem("experimental", "treemanifest", default=False)
coreconfigitem("experimental", "uncommitondirtywdir", default=True)
coreconfigitem("experimental", "xdiff", default=True)
coreconfigitem("experimental", "gitcopytrace", default=True)
coreconfigitem("extensions", ".*", default=None, generic=True)
coreconfigitem("format", "aggressivemergedeltas", default=False)
Expand Down
4 changes: 0 additions & 4 deletions eden/scm/sapling/dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,10 +1090,6 @@ def print_time():
elif rpath:
ui.warn(_("warning: --repository ignored\n"))

from . import match as matchmod, mdiff

mdiff.init(ui)

ui.log("command", "%s\n", msg)
if repo:
repo.dirstate.loginfo(ui, "pre")
Expand Down
14 changes: 2 additions & 12 deletions eden/scm/sapling/mdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import struct
import zlib
from hashlib import sha1
from typing import Iterator, List, Optional, Pattern, Sized, Tuple, TYPE_CHECKING, Union
from typing import Iterator, List, Optional, Pattern, Sized, Tuple, Union

import bindings

Expand All @@ -28,13 +28,9 @@
bdiff = bindings.cext.bdiff
mpatch = bindings.cext.mpatch

if TYPE_CHECKING:
import sapling


_missing_newline_marker = b"\\ No newline at end of file\n"

blocks = bdiff.blocks
blocks = bindings.xdiff.blocks
fixws = bdiff.fixws
patches = mpatch.patches
patchedsize = mpatch.patchedsize
Expand All @@ -44,12 +40,6 @@
rb"(\t+| +|[a-zA-Z0-9_\x80-\xff]+|[^ \ta-zA-Z0-9_\x80-\xff])"
)

# called by dispatch.py
def init(ui: "sapling.ui.ui") -> None:
if ui.configbool("experimental", "xdiff"):
global blocks
blocks = bindings.xdiff.blocks


def splitnewlines(text: bytes) -> "List[bytes]":
"""like str.splitlines, but only split on newlines."""
Expand Down

0 comments on commit 7518624

Please sign in to comment.