From 4c5ad6d5d2368a2ee5eac702f366d4a639467f60 Mon Sep 17 00:00:00 2001 From: "dpranke@chromium.org" Date: Fri, 18 May 2012 02:05:10 +0000 Subject: [PATCH] scm.add() doesn't work properly with svn 1.7 https://bugs.webkit.org/show_bug.cgi?id=86779 Reviewed by Ojan Vafai. The code relied on '.svn' directories being present in order to tell if a directory had already been added to the repository; this is no longer true in SVN 1.7. * Scripts/webkitpy/common/checkout/scm/scm.py: (SCM): (SCM.in_working_directory): * Scripts/webkitpy/common/checkout/scm/svn.py: (SVN): (SVN.in_working_directory): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117526 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Tools/ChangeLog | 18 ++++++++++++++++++ Tools/Scripts/webkitpy/common/checkout/scm/scm.py | 4 ++-- Tools/Scripts/webkitpy/common/checkout/scm/svn.py | 13 ++++++++++--- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Tools/ChangeLog b/Tools/ChangeLog index c420ad3..a1cb1c7 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,21 @@ +2012-05-17 Dirk Pranke + + scm.add() doesn't work properly with svn 1.7 + https://bugs.webkit.org/show_bug.cgi?id=86779 + + Reviewed by Ojan Vafai. + + The code relied on '.svn' directories being present + in order to tell if a directory had already been added to the + repository; this is no longer true in SVN 1.7. + + * Scripts/webkitpy/common/checkout/scm/scm.py: + (SCM): + (SCM.in_working_directory): + * Scripts/webkitpy/common/checkout/scm/svn.py: + (SVN): + (SVN.in_working_directory): + 2012-05-17 Jon Lee Update Apple buildbots to prioritize latest changelists diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/scm.py b/Tools/Scripts/webkitpy/common/checkout/scm/scm.py index cbce361..9ff9e5f 100644 --- a/Tools/Scripts/webkitpy/common/checkout/scm/scm.py +++ b/Tools/Scripts/webkitpy/common/checkout/scm/scm.py @@ -133,8 +133,8 @@ class SCM: def _subclass_must_implement(): raise NotImplementedError("subclasses must implement") - @staticmethod - def in_working_directory(path): + @classmethod + def in_working_directory(cls, path): SCM._subclass_must_implement() def find_checkout_root(path): diff --git a/Tools/Scripts/webkitpy/common/checkout/scm/svn.py b/Tools/Scripts/webkitpy/common/checkout/scm/svn.py index af03f8d..6d3c3c1 100644 --- a/Tools/Scripts/webkitpy/common/checkout/scm/svn.py +++ b/Tools/Scripts/webkitpy/common/checkout/scm/svn.py @@ -82,9 +82,16 @@ class SVN(SCM, SVNRepository): else: self._patch_directories = patch_directories - @staticmethod - def in_working_directory(path): - return os.path.isdir(os.path.join(path, '.svn')) + @classmethod + def in_working_directory(cls, path): + if os.path.isdir(os.path.join(path, '.svn')): + # This is a fast shortcut for svn info that is usually correct for SVN < 1.7, + # but doesn't work for SVN >= 1.7. + return True + + svn_info_args = [cls.executable_name, 'info', path] + exit_code = Executive().run_command(svn_info_args, return_exit_code=True) + return (exit_code == 0) def find_uuid(self, path): if not self.in_working_directory(path): -- 2.7.4