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

Unified Diff: gclient.py

Issue 165070: Make gclient pass correct relative paths to the hooks. (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: '' Created 11 years, 4 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: gclient.py
===================================================================
--- gclient.py (revision 22671)
+++ gclient.py (working copy)
@@ -1325,6 +1325,7 @@
self._options.revision = revision_overrides.get(name)
scm = SCMWrapper(url, self._root_dir, name)
scm.RunCommand(command, self._options, args, file_list)
+ file_list = [os.path.join(name, file.strip()) for file in file_list]
self._options.revision = None
try:
deps_content = FileRead(os.path.join(self._root_dir, name,
@@ -1368,7 +1369,20 @@
scm = SCMWrapper(url, self._root_dir, d)
scm.RunCommand(command, self._options, args, file_list)
self._options.revision = None
+
+ # Convert all absolute paths to relative.
+ for i in range(len(file_list)):
+ if not os.path.isabs(file_list[i]):
M-A Ruel 2009/08/06 22:53:29 That should be deterministic.
M-A Ruel 2009/08/10 15:58:12 Just add a #TODO(you): Make it deterministic to be
+ continue
+ prefix = os.path.commonprefix([self._root_dir.lower(),
+ file_list[i].lower()])
+ file_list[i] = file_list[i][len(prefix):]
+
+ # Strip any leading path separators.
+ while file_list[i].startswith('\\') or file_list[i].startswith('/'):
+ file_list[i] = file_list[i][1:]
+
is_using_git = IsUsingGit(self._root_dir, entries.keys())
self._RunHooks(command, file_list, is_using_git)
« 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