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

Unified Diff: presubmit.py

Issue 113290: Deprecate gcl.GetSVNFileInfo() for gclient.CaptureSVNInfo(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: fixed presubmit.py and updated unit tests 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 | « gcl.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: presubmit.py
===================================================================
--- presubmit.py (revision 15890)
+++ presubmit.py (working copy)
@@ -32,6 +32,7 @@
# TODO(joi) Would be cleaner to factor out utils in gcl to separate module, but
# for now it would only be a couple of functions so hardly worth it.
import gcl
+import gclient
import presubmit_canned_checks
@@ -207,7 +208,7 @@
Remember to check for the None case and show an appropriate error!
"""
- local_path = gcl.GetSVNFileInfo(depot_path).get('Path')
+ local_path = gclient.CaptureSVNInfo(depot_path).get('Path')
if not local_path:
return None
else:
@@ -223,7 +224,7 @@
Returns:
The depot path (SVN URL) of the file if mapped, otherwise None.
"""
- depot_path = gcl.GetSVNFileInfo(local_path).get('URL')
+ depot_path = gclient.CaptureSVNInfo(local_path).get('URL')
if not depot_path:
return None
else:
@@ -331,7 +332,7 @@
Returns the empty string if the file does not exist in SCM.
"""
- return gcl.GetSVNFileInfo(self.AbsoluteLocalPath()).get('URL', '')
+ return gclient.CaptureSVNInfo(self.AbsoluteLocalPath()).get('URL', '')
def LocalPath(self):
"""Returns the path of this file on the local disk relative to client root.
@@ -350,7 +351,8 @@
# subversion, especially on Windows.
return os.path.isdir(self.path)
else:
- return gcl.GetSVNFileInfo(self.path).get('Node Kind') == 'directory'
+ return gclient.CaptureSVNInfo(self.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 | « gcl.py ('k') | tests/gcl_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698