When the length logic for fast-import 'data' commands was updated in
4c10270 (Fix data handling, 2023-03-02), one branch was missed, so
commit messages now do not have a final LF appended in most cases. This
changed the longtime behavior, which had been consistent since the first
commit of hg2git, 9832035 (Initial import, 2007-03-06), and is expected
by some applications which compare against old conversions from
Mercurial.
When commit ddfc3a8300 ("Run file_data_filter on deleted files")
started calling the file_data_filter plugin method, in order to make
deletion of plugin-renamed files work, the example plugins were not
updated. This commit updates the example plugins to not crash when the
file context is None.
Thanks to @hetas discovering this.
Closes 328
The `file_data_filter` method should be called when files are deleted.
In this case the `data` and `file_ctx` keys map to None. This is so
that a filter which modifies file names can apply the same name
transformations before files are deleted.
Run the CI tests with both the earliest supported Python version and
the latest stable release.
The intent is to quickly notice when new features require adjusting
the oldest supported Python version and also detect when the latest
stable version breaks old code (as when 3.12 removed `imp` and we
witched to `importlib` in #311).
Add `--debug` command line flag which dumps the detected versions of
Mercurial and Python. This will probably help future debugging when
unexpected versions are used.
Don't look for a Python 2 interpreter as Python is no longer
supported. If there is a Python 2 available and it had the Mercurial
modules available, hg-fast-export would use it and fail to import
`importlib.machinery`. This is probably the cause of #314.
Closes#314.
Python 3.12 has removed imp and it's recommended to use importlib
instead. Python 2.7 doesn't have importlib, so Python 2.7 support is
ceased (not a big deal since it's been more than 3 years since it was
EOLed) as a part of this change.
Based on the latest walk-through: https://github.com/github/codeql-action.
Gets rid of the warning:
Warning: 1 issue was detected with this workflow: git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
It's included as a module for a reason.
Also, use "$0" so the tests can be run like `./t/main.t` (or any other
directory).
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This way export_commit is much simpler (already quite complex), and it's
easier to modify the logic.
No functional changes.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>