incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject git commit: [#4961] Fix version check
Date Thu, 13 Dec 2012 22:48:28 GMT
Updated Branches:
  refs/heads/tv/4961 50dc76694 -> 4ffc706a4


[#4961] Fix version check


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/4ffc706a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4ffc706a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4ffc706a

Branch: refs/heads/tv/4961
Commit: 4ffc706a42c288cdc30f33bb7e23194e827cde6b
Parents: 50dc766
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Thu Dec 13 22:48:09 2012 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Thu Dec 13 22:48:09 2012 +0000

----------------------------------------------------------------------
 ForgeSVN/forgesvn/model/svn.py                   |    5 ++++-
 ForgeSVN/forgesvn/tests/model/test_repository.py |    4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4ffc706a/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index efdc306..19aa1e8 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -158,8 +158,11 @@ class SVNImplementation(M.RepositoryImplementation):
         if not (asbool(tg.config.get('scm.svn.hotcopy', True)) and
                 source_url.startswith('file://')):
             return False
+        # check for svn version 1.7 or later
         stdout, stderr = self.check_call(['svn', '--version'])
-        return bool(re.search('version 1.7', stdout))
+        pattern = r'version (?P<maj>\d+)\.(?P<min>\d+)'
+        m = re.search(pattern, stdout)
+        return m and (int(m.group('maj')) * 10 + int(m.group('min'))) >= 17
 
     def check_call(self, cmd):
         p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4ffc706a/ForgeSVN/forgesvn/tests/model/test_repository.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/tests/model/test_repository.py b/ForgeSVN/forgesvn/tests/model/test_repository.py
index b866488..5233811 100644
--- a/ForgeSVN/forgesvn/tests/model/test_repository.py
+++ b/ForgeSVN/forgesvn/tests/model/test_repository.py
@@ -153,14 +153,14 @@ class TestSVNRepo(unittest.TestCase, RepoImplTestBase):
         for combo in product(
                 ['file:///myfile', 'http://myfile'],
                 [True, False],
-                ['version 1.7', 'version 1.6']):
+                ['version 1.7', 'version 1.6', 'version 2.0.3']):
             source_url = combo[0]
             tg.config = {'scm.svn.hotcopy': combo[1]}
             stdout = combo[2]
             obj.check_call.return_value = stdout, ''
             expected = (source_url.startswith('file://') and
                     tg.config['scm.svn.hotcopy'] and
-                    stdout == 'version 1.7')
+                    stdout != 'version 1.6')
             result = func(obj, source_url)
             assert result == expected
 


Mime
View raw message