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

Unified Diff: gclient_scm.py

Issue 6676119: Move where the check is to handle things not being checked out yet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 9 years, 9 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
===================================================================
--- gclient_scm.py (revision 79299)
+++ gclient_scm.py (working copy)
@@ -186,23 +186,6 @@
verbose = ['--verbose']
printed_path = True
- # See if the url has changed
- current_url = self._Capture(['config', 'remote.origin.url'])
- if current_url != url:
- print('_____ switching %s to a new upstream' % self.relpath)
- # Make sure it's clean
- self._CheckClean(rev_str)
- # Switch over to the new upstream
- self._Run(['remote', 'set-url', 'origin', url], options)
- quiet = []
- if not options.verbose:
- quiet = ['--quiet']
- self._Run(['fetch', 'origin', '--prune'] + quiet, options)
- self._Run(['reset', '--hard', 'origin/master'] + quiet, options)
- files = self._Capture(['ls-files']).splitlines()
- file_list.extend([os.path.join(self.checkout_path, f) for f in files])
- return
-
if revision.startswith('refs/heads/'):
rev_type = "branch"
elif revision.startswith('origin/'):
@@ -231,6 +214,23 @@
'\tAnd run gclient sync again\n'
% (self.relpath, rev_str, self.relpath))
+ # See if the url has changed
+ current_url = self._Capture(['config', 'remote.origin.url'])
+ if current_url != url:
+ print('_____ switching %s to a new upstream' % self.relpath)
+ # Make sure it's clean
+ self._CheckClean(rev_str)
+ # Switch over to the new upstream
+ self._Run(['remote', 'set-url', 'origin', url], options)
+ quiet = []
+ if not options.verbose:
+ quiet = ['--quiet']
+ self._Run(['fetch', 'origin', '--prune'] + quiet, options)
+ self._Run(['reset', '--hard', 'origin/master'] + quiet, options)
+ files = self._Capture(['ls-files']).splitlines()
+ file_list.extend([os.path.join(self.checkout_path, f) for f in files])
+ return
+
cur_branch = self._GetCurrentBranch()
# Cases:
« 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