diff hgext/convert/__init__.py @ 22470:8e0c4df28eec

convert: add support to detect git renames and copies Git is fairly unique among VCSes in that it doesn't record copies and renames, instead choosing to detect them on the fly. Since Mercurial expects copies and renames to be recorded, it can be valuable to preserve this history while converting a Git repository to Mercurial. This patch adds a new convert option, called 'convert.git.similarity', which determines how similar files must be to be treated as renames or copies.
author Siddharth Agarwal <sid0@fb.com>
date Fri, 12 Sep 2014 11:23:26 -0700
parents e1b68c0a9363
children cc5f94db672b
line wrap: on
line diff
--- a/hgext/convert/__init__.py	Thu Sep 11 23:57:49 2014 -0700
+++ b/hgext/convert/__init__.py	Fri Sep 12 11:23:26 2014 -0700
@@ -291,6 +291,15 @@
     leading 'refs/heads' stripped. Git submodules are converted to Git
     subrepos in Mercurial.
 
+    The following options can be set with ``--config``:
+
+    :convert.git.similarity: specify how similar files modified in a
+        commit must be to be imported as renames or copies, as a
+        percentage between ``0`` (disabled) and ``100`` (files must be
+        identical). For example, ``90`` means that a delete/add pair will
+        be imported as a rename if more than 90% of the file hasn't
+        changed. The default is ``0``.
+
     Perforce Source
     ###############