Chromium Code Reviews| Index: fetch.py |
| diff --git a/fetch.py b/fetch.py |
| index 04be95fa48ea0d095692a321c0e6b14ec5fedb57..d2fbf7382c4e606908908f7e8cf314c80e91347a 100755 |
| --- a/fetch.py |
| +++ b/fetch.py |
| @@ -63,7 +63,7 @@ class Checkout(object): |
| print 'Running: %s' % (' '.join(pipes.quote(x) for x in cmd)) |
| if self.options.dry_run: |
| return 0 |
| - return subprocess.check_call(cmd, **kwargs) |
| + return subprocess.check_output(cmd, **kwargs) |
| class GclientCheckout(Checkout): |
| @@ -121,6 +121,13 @@ class GclientGitCheckout(GclientCheckout, GitCheckout): |
| return gclient_spec |
| def exists(self): |
|
agable
2015/06/10 17:54:28
Rather than doing this, I would define exists() on
Michael Moss
2015/06/10 18:10:47
Yeah, I wasn't sure how strict we wanted to be, so
agable
2015/06/10 18:22:16
We don't have any GclientSVN-based fetch recipes a
|
| + solution_urls = [s.get('url') for s in self.spec.get('solutions', [])] |
| + try: |
| + current_remote = self.run_git('config', '--get', 'remote.origin.url') |
| + if current_remote.strip() in solution_urls: |
| + return True |
| + except subprocess.CalledProcessError: |
| + pass |
| return os.path.exists(os.path.join(os.getcwd(), self.root)) |
| def init(self): |
| @@ -315,8 +322,9 @@ def run(options, spec, root): |
| except KeyError: |
| return 1 |
| if checkout.exists(): |
| - print 'You appear to already have a checkout. "fetch" is used only' |
| - print 'to get new checkouts. Use "gclient sync" to update the checkout.' |
| + print 'Your current directory appears to already contain, or be part of, ' |
| + print 'a checkout. "fetch" is used only to get new checkouts. Use ' |
| + print '"gclient sync" to update existing checkouts.' |
| print 'Fetch also does not yet deal with partial checkouts, so if fetch' |
| print 'failed, delete the checkout and start over (crbug.com/230691).' |