Make git-nav-downstream synchronous

Currently git-nav-downstream invokes 'git checkout' in a subprocess, but
exits without waiting for the checkout to complete. Instead wait for the
subprocess to complete.

BUG=376101

Review URL: https://codereview.chromium.org/509163002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291701 0039d316-1c4b-4281-b951-d872f2087c98
changes/01/332501/1
asanka@chromium.org 11 years ago
parent 52d224a24e
commit 39e72a4411

@ -12,7 +12,7 @@ which branch.
import argparse
import sys
from git_common import current_branch, branches, upstream, run_stream, hash_one
from git_common import current_branch, branches, upstream, run, hash_one
def main(args):
@ -36,7 +36,7 @@ def main(args):
if not downstreams:
return "No downstream branches"
elif len(downstreams) == 1:
run_stream('checkout', downstreams[0], stdout=sys.stdout, stderr=sys.stderr)
run('checkout', downstreams[0], stdout=sys.stdout, stderr=sys.stderr)
else:
high = len(downstreams) - 1
while True:
@ -52,8 +52,8 @@ def main(args):
if not r.isdigit() or (0 > int(r) > high):
print "Invalid choice."
else:
run_stream('checkout', downstreams[int(r)], stdout=sys.stdout,
stderr=sys.stderr)
run('checkout', downstreams[int(r)], stdout=sys.stdout,
stderr=sys.stderr)
break

Loading…
Cancel
Save