diff --git a/tools/mapmerge/1prepare_map.bat b/tools/mapmerge/1prepare_map.bat deleted file mode 100644 index 43f317e114..0000000000 --- a/tools/mapmerge/1prepare_map.bat +++ /dev/null @@ -1,7 +0,0 @@ -cd ../../maps/tether - -FOR %%f IN (*.dmm) DO ( - copy %%f %%f.backup -) - -pause diff --git a/tools/mapmerge/2clean_map.bat b/tools/mapmerge/2clean_map.bat deleted file mode 100644 index f97ad14793..0000000000 --- a/tools/mapmerge/2clean_map.bat +++ /dev/null @@ -1,8 +0,0 @@ -SET z_levels=10 -cd - -FOR %%f IN (../../maps/tether/*.dmm) DO ( - java -jar MapPatcher.jar -clean ../../maps/tether/%%f.backup ../../maps/tether/%%f ../../maps/tether/%%f -) - -pause diff --git a/tools/mapmerge/MapPatcher.jar b/tools/mapmerge/MapPatcher.jar deleted file mode 100644 index f4351b3603..0000000000 Binary files a/tools/mapmerge/MapPatcher.jar and /dev/null differ diff --git a/tools/mapmerge/clean_map_git.sh b/tools/mapmerge/clean_map_git.sh deleted file mode 100755 index 25cef6da93..0000000000 --- a/tools/mapmerge/clean_map_git.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -for MAPFILE in ../../maps/*.dmm -do - MAPNAME=$(basename $MAPFILE) - git show HEAD:maps/$MAPNAME > tmp.dmm - java -jar MapPatcher.jar -clean tmp.dmm $MAPFILE $MAPFILE - rm tmp.dmm -done diff --git a/tools/mapmerge/git_merge_installer.bat b/tools/mapmerge/git_merge_installer.bat deleted file mode 100644 index 59e3a803e9..0000000000 --- a/tools/mapmerge/git_merge_installer.bat +++ /dev/null @@ -1,6 +0,0 @@ -@echo off -set tab= -echo. >> ../../.git/config -echo [merge "merge-dmm"] >> ../../.git/config -echo %tab%name = mapmerge driver >> ../../.git/config -echo %tab%driver = ./tools/mapmerge/mapmerge.sh %%O %%A %%B >> ../../.git/config diff --git a/tools/mapmerge/git_merge_installer.sh b/tools/mapmerge/git_merge_installer.sh deleted file mode 100755 index c6d70bc0c9..0000000000 --- a/tools/mapmerge/git_merge_installer.sh +++ /dev/null @@ -1,6 +0,0 @@ -F="../../.git/config" - -echo '' >> $F -echo '[merge "merge-dmm"]' >> $F -echo ' name = mapmerge driver' >> $F -echo ' driver = ./tools/mapmerge/mapmerge.sh %O %A %B' >> $F diff --git a/tools/mapmerge/install.txt b/tools/mapmerge/install.txt deleted file mode 100644 index 943b195b5e..0000000000 --- a/tools/mapmerge/install.txt +++ /dev/null @@ -1,19 +0,0 @@ -1. Install java(http://www.java.com/en/download/index.jsp) -2. Make sure java is in your PATH. To test this, open git bash, and type "java". If it says unknown command, you need to add JAVA/bin to your PATH variable (A guide for this can be found at https://www.java.com/en/download/help/path.xml ). - -Committing -1. Before starting to edit the map, double-click "prepare_map.bat" in the tools/mapmerge/ directory. -2. After finishing your edit, and before your commit, double-click "clean_map.bat" in the tools/mapmerge/ directory. - -This will make sure in the new version of your map, no paths are needlessly changed, thus instead of 8000 lines changed you'll get 50 lines changed. This not only reduces size of your commit, it also makes it possible to get an overview of your map changes on the "files changed" page in your pull request. - -Merging -The easiest way to do merging is to install the merge driver. For this, open `Baystation12/.git/config` in a text editor, and paste the following lines to the end of it: - -[merge "merge-dmm"] - name = mapmerge driver - driver = ./tools/mapmerge/mapmerge.sh %O %A %B - -You may optionally instead run git_merge_installer.bat or git_merge_installer.sh which should automatically insert these lines for you at the appropriate location. - -After this, merging maps should happen automagically unless there are conflicts(a tile that both you and someone else changed). If there are conflicts, you will unfortunately still be stuck with opening both versions in a map editor, and manually resolving the issues. diff --git a/tools/mapmerge/mapmerge.sh b/tools/mapmerge/mapmerge.sh deleted file mode 100755 index 9e347ceaa2..0000000000 --- a/tools/mapmerge/mapmerge.sh +++ /dev/null @@ -1,9 +0,0 @@ -java -jar tools/mapmerge/MapPatcher.jar -merge $1 $2 $3 $2 -if [ "$?" -gt 0 ] -then - echo "Unable to automatically resolve map conflicts, please merge manually." - exit 1 -fi -java -jar tools/mapmerge/MapPatcher.jar -clean $3 $2 $2 - -exit 0 diff --git a/tools/mapmerge2/README.txt b/tools/mapmerge2/README.txt deleted file mode 100644 index 0ff4d21ac2..0000000000 --- a/tools/mapmerge2/README.txt +++ /dev/null @@ -1,52 +0,0 @@ -# Map Merge 2 - -**Map Merge 2** is an improvement over previous map merging scripts, with -better merge-conflict prevention, multi-Z support, and automatic handling of -key overflow. For up-to-date tips and tricks, also visit the [Map Merger] wiki article. - -## What Map Merging Is - -The "map merge" operation describes the process of rewriting a map file written -by the DreamMaker map editor to A) use a format more amenable to Git's conflict -resolution and B) differ in the least amount textually from the previous -version of the map while maintaining all the actual changes. It requires an old -version of the map to use as a reference and a new version of the map which -contains the desired changes. - -## Installation - -To install Python dependencies, run `requirements-install.bat`, or run -`python -m pip install -r requirements.txt` directly. See the [Git hooks] -documentation to install the Git pre-commit hook which runs the map merger -automatically, or use `tools/mapmerge/Prepare Maps.bat` to save backups before -running `mapmerge.bat`. - -For up-to-date installation and detailed troubleshooting instructions, visit -the [Map Merger] wiki article. - -## Code Structure - -Frontend scripts are meant to be run directly. They obey the environment -variables `TGM` to set whether files are saved in TGM (1) or DMM (0) format, -and `MAPROOT` to determine where maps are kept. By default, TGM is used and -the map root is autodetected. Each script may either prompt for the desired map -or be run with command-line parameters indicating which maps to act on. The -scripts include: - -* `convert.py` for converting maps to and from the TGM format. Used by - `tgm2dmm.bat` and `dmm2tgm.bat`. -* `mapmerge.py` for running the map merge on map backups saved by - `Prepare Maps.bat`. Used by `mapmerge.bat` - -Implementation modules: - -* `dmm.py` includes the map reader and writer. -* `mapmerge.py` includes the implementation of the map merge operation. -* `frontend.py` includes the common code for the frontend scripts. - -`precommit.py` is run by the [Git hooks] if installed, and merges the new -version of any map saved in the index (`git add`ed) with the old version stored -in Git when run. - -[Map Merger]: https://tgstation13.org/wiki/Map_Merger -[Git hooks]: ../hooks/README.md diff --git a/tools/mapmerge2/hooks/README.md b/tools/mapmerge2/hooks/README.md deleted file mode 100644 index 844f3a3952..0000000000 --- a/tools/mapmerge2/hooks/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# Git Integration Hooks - -This folder contains installable scripts for [Git hooks] and [merge drivers]. -Use of these hooks and drivers is optional and they must be installed -explicitly before they take effect. - -To install the current set of hooks, or update if new hooks are added, run -`install.bat` (Windows) or `install.sh` (Unix-like) as appropriate. - -Hooks expect a Unix-like environment on the backend. Usually this is handled -automatically by GUI tools like TortoiseGit and GitHub for Windows, but -[Git for Windows] is an option if you prefer to use a CLI even on Windows. - -## Current Hooks - -* **Pre-commit**: Runs [mapmerge2] on changed maps, if any. - -## Adding New Hooks - -New [Git hooks] may be added by creating a file named `.hook` in -this directory. Git determines what hooks are available and what their names -are. The install script copies the `.hook` file into `.git/hooks`, so editing -the `.hook` file will require a reinstall. - -New [merge drivers] may be added by adding a shell script named `.merge` -and updating `.gitattributes` in the root of the repository to include the line -`*. merge=`. The install script will set up the merge driver to point -to the `.merge` file directly, and editing it will not require a reinstall. - -`tools/hooks/python.sh` may be used as a trampoline to ensure that the correct -version of Python is found. - -[Git hooks]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks -[merge drivers]: https://git-scm.com/docs/gitattributes#_performing_a_three_way_merge -[Git for Windows]: https://gitforwindows.org/ -[mapmerge2]: ../mapmerge2/README.md diff --git a/tools/mapmerge2/hooks/install.bat b/tools/mapmerge2/hooks/install.bat deleted file mode 100644 index 50fa647a66..0000000000 --- a/tools/mapmerge2/hooks/install.bat +++ /dev/null @@ -1,15 +0,0 @@ -@echo off -cd %~dp0 -for %%f in (*.hook) do ( - echo Installing hook: %%~nf - mkdir ..\..\..\.git\hooks - copy %%f ..\..\..\.git\hooks\%%~nf >nul -) -for %%f in (*.merge) do ( - echo Installing merge driver: %%~nf - echo [merge "%%~nf"]^ - - driver = tools/hooks/%%f %%P %%O %%A %%B %%L >> ..\..\..\.git\config -) -echo Done -pause diff --git a/tools/mapmerge2/hooks/install.sh b/tools/mapmerge2/hooks/install.sh deleted file mode 100644 index be42d2ee96..0000000000 --- a/tools/mapmerge2/hooks/install.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -cd "$(dirname "$0")" -for f in *.hook; do - echo Installing hook: ${f%.hook} - cp $f ../../../.git/hooks/${f%.hook} -done -for f in *.merge; do - echo Installing merge driver: ${f%.merge} - git config --replace-all merge.${f%.merge}.driver "tools/mapmerge2/hooks/$f %P %O %A %B %L" -done -echo "Done" diff --git a/tools/mapmerge2/hooks/pre-commit.hook b/tools/mapmerge2/hooks/pre-commit.hook deleted file mode 100644 index b78780ccbb..0000000000 --- a/tools/mapmerge2/hooks/pre-commit.hook +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -exec tools/mapmerge2/hooks/python.sh -m precommit diff --git a/tools/mapmerge2/hooks/python.sh b/tools/mapmerge2/hooks/python.sh deleted file mode 100644 index 32557070f4..0000000000 --- a/tools/mapmerge2/hooks/python.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -set -e -if command -v python3 >/dev/null 2>&1; then - PY=python3 -else - PY=python -fi -PATHSEP=$($PY - <<'EOF' -import sys, os -if sys.version_info.major != 3 or sys.version_info.minor < 6: - sys.stderr.write("Python 3.6+ is required: " + sys.version + "\n") - exit(1) -print(os.pathsep) -EOF -) -export PYTHONPATH=tools/mapmerge2/${PATHSEP}${PYTHONPATH} -$PY "$@"