|
|
@ -186,6 +186,23 @@ class GitWrapper(SCMWrapper):
|
|
|
|
verbose = ['--verbose']
|
|
|
|
verbose = ['--verbose']
|
|
|
|
printed_path = True
|
|
|
|
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/'):
|
|
|
|
if revision.startswith('refs/heads/'):
|
|
|
|
rev_type = "branch"
|
|
|
|
rev_type = "branch"
|
|
|
|
elif revision.startswith('origin/'):
|
|
|
|
elif revision.startswith('origin/'):
|
|
|
@ -198,7 +215,7 @@ class GitWrapper(SCMWrapper):
|
|
|
|
|
|
|
|
|
|
|
|
if not os.path.exists(self.checkout_path):
|
|
|
|
if not os.path.exists(self.checkout_path):
|
|
|
|
self._Clone(revision, url, options)
|
|
|
|
self._Clone(revision, url, options)
|
|
|
|
files = self._Capture(['ls-files']).split()
|
|
|
|
files = self._Capture(['ls-files']).splitlines()
|
|
|
|
file_list.extend([os.path.join(self.checkout_path, f) for f in files])
|
|
|
|
file_list.extend([os.path.join(self.checkout_path, f) for f in files])
|
|
|
|
if not verbose:
|
|
|
|
if not verbose:
|
|
|
|
# Make the output a little prettier. It's nice to have some whitespace
|
|
|
|
# Make the output a little prettier. It's nice to have some whitespace
|
|
|
|