changeset 822:033b86e0f56d

stupid/filemap: disable this since it doesn't currently work hg 1.9 dramatically cleaned up patch application, but unfortunately this breaks stupid mode with filemaps. In the name of getting a release out the door, disabling this feature for now. There will be changes required in hg to make this work again, so we may just drop the feature entirely if nobody's interested.
author Augie Fackler <durin42@gmail.com>
date Fri, 30 Sep 2011 17:01:35 -0500
parents f28e0f54a6ef
children 4244f8f37484 38ebdf65d868
files hgsubversion/maps.py hgsubversion/stupid.py tests/test_fetch_mappings.py
diffstat 3 files changed, 15 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/maps.py
+++ b/hgsubversion/maps.py
@@ -290,6 +290,10 @@ class FileMap(object):
             return False
         return True
 
+    # Needed so empty filemaps are false
+    def __len__(self):
+        return len(self.include) + len(self.exclude)
+
     def add(self, fn, map, path):
         mapping = getattr(self, map)
         if path in mapping:
--- a/hgsubversion/stupid.py
+++ b/hgsubversion/stupid.py
@@ -2,10 +2,11 @@ import cStringIO
 import errno
 import re
 
-from mercurial import patch
-from mercurial import node
 from mercurial import context
+from mercurial import node
+from mercurial import patch
 from mercurial import revlog
+from mercurial import util as hgutil
 
 import svnwrap
 import svnexternals
@@ -589,6 +590,9 @@ def branches_in_paths(meta, tbdelta, pat
 def convert_rev(ui, meta, svn, r, tbdelta, firstrun):
     # this server fails at replay
 
+    if meta.filemap:
+        raise hgutil.Abort('filemaps currently unsupported with stupid replay.')
+
     branches = branches_in_paths(meta, tbdelta, r.paths, r.revnum,
                                  svn.checkpath, svn.list_files)
     brpaths = branches.values()
--- a/tests/test_fetch_mappings.py
+++ b/tests/test_fetch_mappings.py
@@ -26,7 +26,7 @@ class MapTests(test_util.TestBase):
     @property
     def branchmap(self):
         return os.path.join(self.tmpdir, 'branchmap')
-	
+
     @property
     def tagmap(self):
         return os.path.join(self.tmpdir, 'tagmap')
@@ -112,7 +112,8 @@ class MapTests(test_util.TestBase):
         self.assertEqual(node.hex(self.repo['default'].node()), 'e524296152246b3837fe9503c83b727075835155')
 
     def test_file_map_stupid(self):
-        self.test_file_map(True)
+        # TODO: re-enable test if we ever reinstate this feature
+        self.assertRaises(hgutil.Abort, self.test_file_map, True)
 
     def test_file_map_exclude(self, stupid=False):
         test_util.load_svndump_fixture(self.repo_path, 'replace_trunk_with_branch.svndump')
@@ -127,7 +128,8 @@ class MapTests(test_util.TestBase):
         self.assertEqual(node.hex(self.repo['default'].node()), 'b37a3c0297b71f989064d9b545b5a478bbed7cc1')
 
     def test_file_map_exclude_stupid(self):
-        self.test_file_map_exclude(True)
+        # TODO: re-enable test if we ever reinstate this feature
+        self.assertRaises(hgutil.Abort, self.test_file_map_exclude, True)
 
     def test_branchmap(self, stupid=False):
         test_util.load_svndump_fixture(self.repo_path, 'branchmap.svndump')