Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: presubmit_support.py

Issue 113782: Fix AffectedFile.IsDirectory() to use the right path. (Closed)
Patch Set: Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit_support.py
diff --git a/presubmit_support.py b/presubmit_support.py
index 96d138040ef5bfd1c57e57f86969347de7086fed..9c3a6e817e4acd4eba168011ecf7b599aec4822f 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698