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

Unified Diff: gclient.py

Issue 513923006: Skip MigrateConfigToGit if gclient config is non trivial. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 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
diff --git a/gclient.py b/gclient.py
index 3007487a5930d0f09aeac1260defe3be12bd4360..0d525c9921522b494d205cedcdb98c802c0c0870 100755
--- a/gclient.py
+++ b/gclient.py
@@ -1265,6 +1265,12 @@ want to set 'managed': False in .gclient.
# dump an updated .gclient file that preserves the ordering of the original.
a = ast.parse(self.config_content, options.config_filename, 'exec')
modified = False
+
+ # If non trivial gclient (e.g. includes an Import directive), skip this
+ # migration since it would crash either way.
+ if any(not hasattr(elem, 'targets') for elem in a.body):
szager1 2014/08/28 17:22:15 Instead of this, I would prefer you modify the nex
+ return self
+
solutions = [elem for elem in a.body if 'solutions' in
[target.id for target in elem.targets]]
if not solutions:
« 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