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

Unified Diff: gclient_scm.py

Issue 1283083003: Make gclient revert work with DEPS when DEPS url changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 5 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_scm.py
diff --git a/gclient_scm.py b/gclient_scm.py
index 473a1bde81224395e8cb0e2adc619f3533099f2c..4bcc4b7ffc59c855a5985b25c47c75fa5d996193 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -717,7 +717,14 @@ class GitWrapper(SCMWrapper):
deps_revision = default_rev
if deps_revision.startswith('refs/heads/'):
deps_revision = deps_revision.replace('refs/heads/', self.remote + '/')
- deps_revision = self.GetUsableRev(deps_revision, options)
+ try:
+ deps_revision = self.GetUsableRev(deps_revision, options)
+ except gclient_utils.Error as e:
+ # If the DEPS entry's url and hash changed, try to update the origin.
+ # See also http://crbug.com/520067.
+ if 'safesync_url response "%s"' % deps_revision in e.message:
nodir 2015/08/12 17:04:26 Define a new exception class and raise it in lines
tandrii(chromium) 2015/08/12 17:17:33 Good idea, I was just lazy. Done.
+ return self.update(options, [], file_list)
+ raise
if file_list is not None:
files = self._Capture(['diff', deps_revision, '--name-only']).split()
« 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