changeset 784:f214fb3f92cd

svnexternals: handle new overwrite argument of subrepo.get() The argument was introduced in hg-1.7.4-c19b9282d3a7.
author Patrick Mezard <pmezard@gmail.com>
date Wed, 02 Feb 2011 14:25:58 +0100
parents 7913a82a8cdd
children 40ddf8213fa2
files hgsubversion/svnexternals.py tests/test_externals.py
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svnexternals.py
+++ b/hgsubversion/svnexternals.py
@@ -390,7 +390,7 @@ if subrepo:
             state = (state[0].split(':', 1)[1], state[1])
             super(svnsubrepo, self).__init__(ctx, path, state)
 
-        def get(self, state):
+        def get(self, state, *args, **kwargs):
             # Resolve source first
             line = state[0].split(':', 1)[1]
             source, pegrev = parsedefinition(line)[2:4]
@@ -404,7 +404,9 @@ if subrepo:
                 source = resolvesource(self._ui, svnroot, source)
             if pegrev is not None:
                 source = source + '@' + pegrev
-            return super(svnsubrepo, self).get((source, state[1]))
+            state = (source, state[1])
+            # hg-1.7.4-c19b9282d3a7 introduced the overwrite argument
+            return super(svnsubrepo, self).get(state, *args, **kwargs)
 
         def dirty(self, ignoreupdate=False):
             # You cannot compare anything with HEAD. Just accept it
--- a/tests/test_externals.py
+++ b/tests/test_externals.py
@@ -250,6 +250,10 @@ 2 deps/project2
                   ['subdir2/deps/project1'])
         checkdeps(ui, repo, 4, ['subdir/deps/project1'], ['deps/project2'])
 
+        # Test update --clean, used to crash
+        repo.wwrite('subdir/deps/project1/a', 'foobar', '')
+        commands.update(ui, repo, node='4', clean=True)
+
 class TestPushExternals(test_util.TestBase):
     def test_push_externals(self, stupid=False):
         test_util.load_fixture_and_fetch('pushexternals.svndump',