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

Unified Diff: gclient.py

Issue 2885021: Move _RunHooks() higher to simplify the diff. NO CODE CHANGE. (Closed)
Patch Set: Created 10 years, 5 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
diff --git a/gclient.py b/gclient.py
index e3596b9fd612817365b837b8c9115edc440a6f1a..04087100c5cd32c20308aede42d36e529279270f 100644
--- a/gclient.py
+++ b/gclient.py
@@ -314,26 +314,6 @@ class Dependency(GClientKeywords):
deps[d] = url
return deps
- def _RunHookAction(self, hook_dict, matching_file_list):
- """Runs the action from a single hook."""
- logging.info(hook_dict)
- logging.info(matching_file_list)
- command = hook_dict['action'][:]
- if command[0] == 'python':
- # If the hook specified "python" as the first item, the action is a
- # Python script. Run it by starting a new copy of the same
- # interpreter.
- command[0] = sys.executable
-
- if '$matching_files' in command:
- splice_index = command.index('$matching_files')
- command[splice_index:splice_index + 1] = matching_file_list
-
- # Use a discrete exit status code of 2 to indicate that a hook action
- # failed. Users of this script may wish to treat hook action failures
- # differently from VC failures.
- return gclient_utils.SubprocessCall(command, self.root_dir(), fail_status=2)
-
def _RunHooks(self, command, file_list, is_using_git):
"""Evaluates all hooks, running actions as needed.
"""
@@ -367,6 +347,26 @@ class Dependency(GClientKeywords):
if matching_file_list:
self._RunHookAction(hook_dict, matching_file_list)
+ def _RunHookAction(self, hook_dict, matching_file_list):
+ """Runs the action from a single hook."""
+ logging.info(hook_dict)
+ logging.info(matching_file_list)
+ command = hook_dict['action'][:]
+ if command[0] == 'python':
+ # If the hook specified "python" as the first item, the action is a
+ # Python script. Run it by starting a new copy of the same
+ # interpreter.
+ command[0] = sys.executable
+
+ if '$matching_files' in command:
+ splice_index = command.index('$matching_files')
+ command[splice_index:splice_index + 1] = matching_file_list
+
+ # Use a discrete exit status code of 2 to indicate that a hook action
+ # failed. Users of this script may wish to treat hook action failures
+ # differently from VC failures.
+ return gclient_utils.SubprocessCall(command, self.root_dir(), fail_status=2)
+
def root_dir(self):
return self.parent.root_dir()
« 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