##// END OF EJS Templates
merge: store commitinfo if these is a dc or cd conflict...
merge: store commitinfo if these is a dc or cd conflict delete-changed or changed-delete conflicts can either be resolved by mergetool, if some tool is passed and using or by user choose something on prompt or user doing some `hg revert` after choosing the file to remain conflicted. If the user decides to keep the changed side, on commit we just reuse the parent filenode. This is mostly fine unless we are in a distributed environment and people are doing criss-cross merges. Since, we don't have recursive merges or any other way of describing the end result of the merge was an explicit choice and it should be differentiated from it's ancestors, merge algo during criss-cross merges fails to take in account the explicit choice made by user and end up with a what-can-be-said-wrong-merge. The solution which we are trying to fix this is by creating a filenode on commit instead of reusing the parent filenode. This helps differentiate between pre-merged filenode and post-merge filenode and kind of tells about the choice user made. To implement creating new filenode functionality, we store info about these files in mergestate so that we can read them on commit and force create a new filenode. Differential Revision: https://phab.mercurial-scm.org/D8988

File last commit:

r45339:118f067f default
r46158:4c8a93ec default
Show More
pyoxidizer.bzl
98 lines | 3.3 KiB | text/x-python | PythonLexer
Gregory Szorc
hgcli: customize for Mercurial...
r45129 ROOT = CWD + "/../.."
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128
Gregory Szorc
packaging: support building Inno installer with PyOxidizer...
r45270 # Code to run in Python interpreter.
RUN_CODE = "import hgdemandimport; hgdemandimport.enable(); from mercurial import dispatch; dispatch.run()"
set_build_path(ROOT + "/build/pyoxidizer")
def make_distribution():
return default_python_distribution()
def make_distribution_windows():
Rodrigo Damazio Bovendorp
pyoxidizer: formatting bazel definitions...
r45339 return default_python_distribution(flavor = "standalone_dynamic")
Gregory Szorc
packaging: support building Inno installer with PyOxidizer...
r45270
def make_exe(dist):
Rodrigo Damazio Bovendorp
pyoxidizer: formatting bazel definitions...
r45339 """Builds a Rust-wrapped Mercurial binary."""
Gregory Szorc
hgcli: customize for Mercurial...
r45129 config = PythonInterpreterConfig(
raw_allocator = "system",
Gregory Szorc
packaging: support building Inno installer with PyOxidizer...
r45270 run_eval = RUN_CODE,
Gregory Szorc
hgcli: customize for Mercurial...
r45129 # We want to let the user load extensions from the file system
filesystem_importer = True,
# We need this to make resourceutil happy, since it looks for sys.frozen.
sys_frozen = True,
legacy_windows_stdio = True,
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128 )
exe = dist.to_python_executable(
Gregory Szorc
hgcli: customize for Mercurial...
r45129 name = "hg",
resources_policy = "prefer-in-memory-fallback-filesystem-relative:lib",
config = config,
# Extension may depend on any Python functionality. Include all
# extensions.
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128 extension_module_filter = "all",
)
Gregory Szorc
packaging: support building Inno installer with PyOxidizer...
r45270 # Add Mercurial to resources.
for resource in dist.pip_install(["--verbose", ROOT]):
# This is a bit wonky and worth explaining.
#
# Various parts of Mercurial don't yet support loading package
# resources via the ResourceReader interface. Or, not having
# file-based resources would be too inconvenient for users.
#
# So, for package resources, we package them both in the
# filesystem as well as in memory. If both are defined,
# PyOxidizer will prefer the in-memory location. So even
# if the filesystem file isn't packaged in the location
# specified here, we should never encounter an errors as the
# resource will always be available in memory.
if type(resource) == "PythonPackageResource":
exe.add_filesystem_relative_python_resource(".", resource)
exe.add_in_memory_python_resource(resource)
else:
exe.add_python_resource(resource)
# On Windows, we install extra packages for convenience.
if "windows" in BUILD_TARGET_TRIPLE:
exe.add_python_resources(
Rodrigo Damazio Bovendorp
pyoxidizer: formatting bazel definitions...
r45339 dist.pip_install(["-r", ROOT + "/contrib/packaging/requirements_win32.txt"]),
Gregory Szorc
packaging: support building Inno installer with PyOxidizer...
r45270 )
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128
Gregory Szorc
hgcli: customize for Mercurial...
r45129 return exe
Gregory Szorc
packaging: support building Inno installer with PyOxidizer...
r45270 def make_manifest(dist, exe):
Gregory Szorc
hgcli: customize for Mercurial...
r45129 m = FileManifest()
m.add_python_resource(".", exe)
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128
Gregory Szorc
packaging: support building Inno installer with PyOxidizer...
r45270 return m
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128
def make_embedded_resources(exe):
return exe.to_embedded_resources()
Gregory Szorc
packaging: support building Inno installer with PyOxidizer...
r45270 register_target("distribution_posix", make_distribution)
register_target("distribution_windows", make_distribution_windows)
register_target("exe_posix", make_exe, depends = ["distribution_posix"])
register_target("exe_windows", make_exe, depends = ["distribution_windows"])
register_target(
"app_posix",
make_manifest,
depends = ["distribution_posix", "exe_posix"],
default = "windows" not in BUILD_TARGET_TRIPLE,
)
register_target(
"app_windows",
make_manifest,
depends = ["distribution_windows", "exe_windows"],
default = "windows" in BUILD_TARGET_TRIPLE,
)
Gregory Szorc
hgcli: add stub PyOxidizer project...
r45128 resolve_targets()
# END OF COMMON USER-ADJUSTED SETTINGS.
#
# Everything below this is typically managed by PyOxidizer and doesn't need
# to be updated by people.
Gregory Szorc
packaging: support building Inno installer with PyOxidizer...
r45270 PYOXIDIZER_VERSION = "0.7.0"