Patrick Mézard  committed f025d00

svnexternals: add 'ignore' mode to avoid converting externals

  • Participants
  • Parent commits 7597ea4

Comments (0)

Files changed (3)

File hgsubversion/help/subversion.rst

     Set to ``subrepos`` to switch to subrepos-based externals support
     (requires Mercurial 1.7.1 or later.) Default is ``svnexternals``,
     which uses a custom hgsubversion-specific format and works on
-    older versions of Mercurial.
+    older versions of Mercurial. Use ``ignore`` to avoid converting externals.
 The following options only have an effect on the initial clone of a repository:

File hgsubversion/

                 hgsubstate.append('%s %s\n' % (rev, path))
             files['.hgsub'] = ''.join(hgsub)
             files['.hgsubstate'] = ''.join(hgsubstate)
+    elif mode == 'ignore':
+        files = {}
         raise hgutil.Abort(_('unknown externals modes: %s') % mode)
                 rev = 'HEAD'
             line = norevline.replace('{REV}', rev)
             external.setdefault(base, []).append(line)
+    elif mode == 'ignore':
+        pass
         raise hgutil.Abort(_('unknown externals modes: %s') % mode)
     return external

File tests/

     def test_hgsub_stupid(self):
+    def test_ignore(self):
+        repo = self._load_fixture_and_fetch('externals.svndump',
+                                            externals='ignore')
+        for rev in repo:
+            ctx = repo[rev]
+            self.assertTrue('.hgsvnexternals' not in ctx)
+            self.assertTrue('.hgsub' not in ctx)
+            self.assertTrue('.hgsubstate' not in ctx)
     def test_updatehgsub(self):
         def checkdeps(ui, repo, rev, deps, nodeps):
             commands.update(ui, repo, node=str(rev))