diff hgext/convert/common.py @ 26035:86598f4fe1cf

convert: add function to test if file is from source This adds a base implementation of a function that tests if a given file from a target repo came from the source repo. This will be used later to detect which files did not come from the source repo during a merge, so we can merge those files correctly instead of dropping them.
author Durham Goode <durham@fb.com>
date Sat, 15 Aug 2015 13:44:55 -0700
parents baea47cafe75
children 56b2bcea2529
line wrap: on
line diff
--- a/hgext/convert/common.py	Sat Aug 15 17:50:59 2015 +0900
+++ b/hgext/convert/common.py	Sat Aug 15 13:44:55 2015 -0700
@@ -82,6 +82,13 @@
     def after(self):
         pass
 
+    def targetfilebelongstosource(self, targetfilename):
+        """Returns true if the given targetfile belongs to the source repo. This
+        is useful when only a subdirectory of the target belongs to the source
+        repo."""
+        # For normal full repo converts, this is always True.
+        return True
+
     def setrevmap(self, revmap):
         """set the map of already-converted revisions"""
         pass