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

Unified Diff: tools/cr/cr/commands/sync.py

Issue 116363002: [cr tool] Fixing import problems (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change the place we hook late detection from Created 6 years, 11 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 | « tools/cr/cr/actions/ninja.py ('k') | tools/cr/cr/plugin.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cr/cr/commands/sync.py
diff --git a/tools/cr/cr/commands/sync.py b/tools/cr/cr/commands/sync.py
index cef9b7a6f4abb9077d28388cf31a707bc69e6399..4f5232ab46f49add0c474e887f7840bab6f92c75 100644
--- a/tools/cr/cr/commands/sync.py
+++ b/tools/cr/cr/commands/sync.py
@@ -44,12 +44,10 @@ class SyncCommand(cr.Command):
cr.Host.Execute(context, '{GCLIENT_BINARY}', 'sync', *context.remains)
-def _AutoDetectGClient():
- """Attempts to detect gclient and it's parent repository."""
- gclient_binaries = cr.Host.SearchPath('gclient')
- if gclient_binaries:
- SyncCommand.DETECTED.Set(GCLIENT_BINARY=gclient_binaries[0])
- SyncCommand.DETECTED.Set(DEPOT_TOOLS=os.path.dirname(gclient_binaries[0]))
-
-# Invoke the auto detection
-_AutoDetectGClient()
+ @classmethod
+ def ClassInit(cls):
+ # Attempt to detect gclient and it's parent repository.
+ gclient_binaries = cr.Host.SearchPath('gclient')
+ if gclient_binaries:
+ cls.DETECTED.Set(GCLIENT_BINARY=gclient_binaries[0])
+ cls.DETECTED.Set(DEPOT_TOOLS=os.path.dirname(gclient_binaries[0]))
« no previous file with comments | « tools/cr/cr/actions/ninja.py ('k') | tools/cr/cr/plugin.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698