Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ensure_dependencies.py

Issue 5652679430766592: Issue 2443 - Honour SKIP_DEPENDENCY_UPDATES environment variable (Closed)
Patch Set: Only warn if revision is wrong Created May 7, 2015, 1 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
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: ensure_dependencies.py
diff --git a/ensure_dependencies.py b/ensure_dependencies.py
index def9a7e9803cf29d8f8f70d644c599981b206163..f664abb991451b7b14a7411b4976fbad386ad7ec 100755
--- a/ensure_dependencies.py
+++ b/ensure_dependencies.py
@@ -240,6 +240,14 @@ def update_repo(target, revisions):
return
resolved_revision = repo_types[type].get_revision_id(target, revision)
+ current_revision = repo_types[type].get_revision_id(target)
+
+ if (resolved_revision != current_revision and
Sebastian Noack 2015/05/07 13:17:19 I think the code structure below below can be simp
kzar 2015/05/07 13:44:29 Done.
+ os.environ.get("SKIP_ENSURE_DEPENDENCIES", "").lower() not in ("", "0", "false")):
Sebastian Noack 2015/05/07 13:17:19 We agreed on SKIP_DEPENDENCY_UPDATES rather than S
kzar 2015/05/07 13:44:29 Done.
+ logging.warning("SKIP_ENSURE_DEPENDENCIES environment variable set, "
+ "%s not checked out to %s" % (target, revision))
+ return
+
if not resolved_revision:
logging.info("Revision %s is unknown, downloading remote changes" % revision)
repo_types[type].pull(target)
@@ -247,7 +255,6 @@ def update_repo(target, revisions):
if not resolved_revision:
raise Exception("Failed to resolve revision %s" % revision)
- current_revision = repo_types[type].get_revision_id(target)
if resolved_revision != current_revision:
logging.info("Updating repository %s to revision %s" % (target, resolved_revision))
repo_types[type].update(target, resolved_revision)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld