Skip to content

Commit

Permalink
let svn fetches print to stdout
Browse files Browse the repository at this point in the history
Summary:
As we've done recently for hg and curl, let svn print its fetch progress
to stdout, so that the fancy display can show it.

Reviewers: sean

Differential Revision: https://phabricator.buildinspace.com/D96
  • Loading branch information
oconnor663 committed Oct 1, 2014
1 parent f294542 commit 55406a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion peru/resources/plugins/svn/reup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


def remote_head_rev(url):
info = svn('info', url).split('\n')
info = svn('info', url, capture_output=True).split('\n')
for item in info:
if item.startswith('Revision: '):
return item.split()[1]
Expand Down
8 changes: 5 additions & 3 deletions peru/resources/plugins/svn/svn_plugin_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
import subprocess


def svn(*args, svn_dir=None):
def svn(*args, svn_dir=None, capture_output=False):
# Avoid forgetting this arg.
assert svn_dir is None or os.path.isdir(svn_dir)

command = ['svn', '--non-interactive']
command.extend(args)

stdout = subprocess.PIPE if capture_output else None
stderr = subprocess.STDOUT if capture_output else None
process = subprocess.Popen(
command, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, cwd=svn_dir, universal_newlines=True)
command, stdin=subprocess.PIPE, stdout=stdout, stderr=stderr,
cwd=svn_dir, universal_newlines=True)
output, _ = process.communicate()
if process.returncode != 0:
raise RuntimeError(
Expand Down

0 comments on commit 55406a7

Please sign in to comment.