Title: [232605] trunk/Tools
Revision
232605
Author
[email protected]
Date
2018-06-07 16:15:41 -0700 (Thu, 07 Jun 2018)

Log Message

[webkitpy] Treat svn versions as Version objects
https://bugs.webkit.org/show_bug.cgi?id=186403
<rdar://problem/40904860>

Reviewed by Dan Bernstein.

* Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
* Scripts/webkitpy/common/checkout/scm/svn.py:
(SVN.svn_version): Return Version object instead of string.
(SVN._status_regexp): Convert version string to Version object.
(SVN.add_list): Ditto.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (232604 => 232605)


--- trunk/Tools/ChangeLog	2018-06-07 23:14:04 UTC (rev 232604)
+++ trunk/Tools/ChangeLog	2018-06-07 23:15:41 UTC (rev 232605)
@@ -1,3 +1,17 @@
+2018-06-07  Jonathan Bedard  <[email protected]>
+
+        [webkitpy] Treat svn versions as Version objects
+        https://bugs.webkit.org/show_bug.cgi?id=186403
+        <rdar://problem/40904860>
+
+        Reviewed by Dan Bernstein.
+
+        * Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
+        * Scripts/webkitpy/common/checkout/scm/svn.py:
+        (SVN.svn_version): Return Version object instead of string.
+        (SVN._status_regexp): Convert version string to Version object.
+        (SVN.add_list): Ditto.
+
 2018-06-07  Tadeu Zagallo  <[email protected]>
 
         Don't try to allocate JIT memory if we don't have the JIT entitlement

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py (232604 => 232605)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py	2018-06-07 23:14:04 UTC (rev 232604)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py	2018-06-07 23:15:41 UTC (rev 232605)
@@ -52,6 +52,7 @@
 from webkitpy.common.system.filesystem_mock import MockFileSystem
 from webkitpy.common.system.outputcapture import OutputCapture
 from webkitpy.common.system.executive_mock import MockExecutive
+from webkitpy.common.version import Version
 from .git import Git, AmbiguousCommitError
 from .detection import detect_scm_system
 from .scm import SCM, CheckoutNeedsUpdate, commit_error_handler, AuthenticationError
@@ -953,7 +954,7 @@
         self.assertFalse(os.path.exists(self.bogus_dir))
 
     def test_svn_lock(self):
-        if self.scm.svn_version() >= "1.7":
+        if self.scm.svn_version() >= Version(1, 7):
             # the following technique with .svn/lock then svn update doesn't work with subversion client 1.7 or later
             pass
         else:

Modified: trunk/Tools/Scripts/webkitpy/common/checkout/scm/svn.py (232604 => 232605)


--- trunk/Tools/Scripts/webkitpy/common/checkout/scm/svn.py	2018-06-07 23:14:04 UTC (rev 232604)
+++ trunk/Tools/Scripts/webkitpy/common/checkout/scm/svn.py	2018-06-07 23:15:41 UTC (rev 232605)
@@ -40,6 +40,7 @@
 from webkitpy.common.memoized import memoized
 from webkitpy.common.system.executive import Executive, ScriptError
 from webkitpy.common.webkit_finder import WebKitFinder
+from webkitpy.common.version import Version
 
 from .scm import AuthenticationError, SCM, commit_error_handler
 
@@ -139,7 +140,7 @@
 
     @memoized
     def svn_version(self):
-        return self._run_svn(['--version', '--quiet'])
+        return Version.from_string(self._run_svn(['--version', '--quiet']))
 
     def has_working_directory_changes(self):
         # FIXME: What about files which are not committed yet?
@@ -183,7 +184,7 @@
         return [self.executable_name, 'status']
 
     def _status_regexp(self, expected_types):
-        field_count = 6 if self.svn_version() > "1.6" else 5
+        field_count = 6 if self.svn_version() > Version(1, 6) else 5
         return "^(?P<status>[%s]).{%s} (?P<filename>.+)$" % (expected_types, field_count)
 
     def _add_parent_directories(self, path):
@@ -195,7 +196,7 @@
     def add_list(self, paths):
         for path in paths:
             self._add_parent_directories(os.path.dirname(os.path.abspath(path)))
-        if self.svn_version() >= "1.7":
+        if self.svn_version() >= Version(1, 7):
             # For subversion client 1.7 and later, need to add '--parents' option to ensure intermediate directories
             # are added; in addition, 1.7 returns an exit code of 1 from svn add if one or more of the requested
             # adds are already under version control, including intermediate directories subject to addition
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to