Mercurial > hg
view tests/test-check-py3-compat.t @ 30660:1f21a6835604
convert: add config option to copy extra keys from Git commits
Git commit objects support storing arbitrary key-value metadata. While
there is no user-facing mechanism in Git to record these values, some
tools do record data here.
Currently, `hg convert` only handles the "author," "committer," and
"parent" keys in Git commit objects. All other keys are ignored. This
means that any custom keys are lost when converting Git repos to
Mercurial.
This patch implements support for copying a whitelist of extra keys
from Git commit objects to the "extras" dict of the destination. As
the added tests demonstate, this allows extra metadata to be preserved
during the conversion process.
This patch stops short of converting all metadata to "extras." We could
potentially implement this via `convert.git.extrakeys=*` or similar.
But copying everything by default is a bit dangerous because if Git
adds new keys to commit objects, we could find ourselves copying
things that shouldn't be copied!
This patch also assumes the source key is the same as the destination
key. We could implement support for prefixing the output key to
distinguish it as coming from Git. But until this feature is needed,
I'm inclined to hold off implementing it.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 22 Dec 2016 23:28:11 -0700 |
parents | 16f4b341288d |
children | 0eb4b3d38d5f |
line wrap: on
line source
#require test-repo $ . "$TESTDIR/helpers-testrepo.sh" $ cd "$TESTDIR"/.. $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py contrib/python-zstandard/setup.py not using absolute_import contrib/python-zstandard/setup_zstd.py not using absolute_import contrib/python-zstandard/tests/common.py not using absolute_import contrib/python-zstandard/tests/test_cffi.py not using absolute_import contrib/python-zstandard/tests/test_compressor.py not using absolute_import contrib/python-zstandard/tests/test_data_structures.py not using absolute_import contrib/python-zstandard/tests/test_decompressor.py not using absolute_import contrib/python-zstandard/tests/test_estimate_sizes.py not using absolute_import contrib/python-zstandard/tests/test_module_attributes.py not using absolute_import contrib/python-zstandard/tests/test_roundtrip.py not using absolute_import contrib/python-zstandard/tests/test_train_dictionary.py not using absolute_import i18n/check-translation.py not using absolute_import setup.py not using absolute_import tests/test-demandimport.py not using absolute_import #if py3exe $ hg files 'set:(**.py) - grep(pygments)' | sed 's|\\|/|g' \ > | xargs $PYTHON3 contrib/check-py3-compat.py \ > | sed 's/[0-9][0-9]*)$/*)/' hgext/convert/transport.py: error importing: <ImportError> No module named 'svn.client' (error at transport.py:*) hgext/fsmonitor/pywatchman/capabilities.py: error importing: <ImportError> No module named 'pybser' (error at __init__.py:*) hgext/fsmonitor/pywatchman/pybser.py: error importing: <ImportError> No module named 'pybser' (error at __init__.py:*) hgext/fsmonitor/watchmanclient.py: error importing: <ImportError> No module named 'pybser' (error at __init__.py:*) mercurial/cffi/bdiff.py: error importing: <ImportError> No module named 'mercurial.cffi' (error at check-py3-compat.py:*) mercurial/cffi/mpatch.py: error importing: <ImportError> No module named 'mercurial.cffi' (error at check-py3-compat.py:*) mercurial/cffi/osutil.py: error importing: <ImportError> No module named 'mercurial.cffi' (error at check-py3-compat.py:*) mercurial/scmwindows.py: error importing: <ImportError> No module named 'msvcrt' (error at win32.py:*) mercurial/win32.py: error importing: <ImportError> No module named 'msvcrt' (error at win32.py:*) mercurial/windows.py: error importing: <ImportError> No module named 'msvcrt' (error at windows.py:*) #endif #if py3exe py3pygments $ hg files 'set:(**.py) and grep(pygments)' | sed 's|\\|/|g' \ > | xargs $PYTHON3 contrib/check-py3-compat.py \ > | sed 's/[0-9][0-9]*)$/*)/' #endif