From 73e36ed387c92b0d18a652b0f64856d0ff14ceed Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Fri, 22 May 2009 20:04:13 +0000 Subject: [PATCH] Fix AffectedFile.IsDirectory() to use the right path. BUG=gcl commit doesn't show any "svn: 'bleh' is not a working copy" error R=jam Review URL: http://codereview.chromium.org/113782 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@16781 0039d316-1c4b-4281-b951-d872f2087c98 --- presubmit_support.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/presubmit_support.py b/presubmit_support.py index 96d138040..9c3a6e817 100755 --- a/presubmit_support.py +++ b/presubmit_support.py @@ -346,13 +346,14 @@ class AffectedFile(object): def IsDirectory(self): """Returns true if this object is a directory.""" - if os.path.exists(self.path): + path = self.AbsoluteLocalPath() + if os.path.exists(path): # Retrieve directly from the file system; it is much faster than querying # subversion, especially on Windows. - return os.path.isdir(self.path) + return os.path.isdir(path) else: - return gclient.CaptureSVNInfo(self.path).get('Node Kind') in ('dir', - 'directory') + return gclient.CaptureSVNInfo(path).get('Node Kind') in ('dir', + 'directory') def SvnProperty(self, property_name): """Returns the specified SVN property of this file, or the empty string