mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444
This commit is contained in:
parent
25e8bf69e6
commit
665817d2a6
35333 changed files with 1818077 additions and 16036 deletions
43
tests/wpt/web-platform-tests/css/tools/travis/vcs.py
Normal file
43
tests/wpt/web-platform-tests/css/tools/travis/vcs.py
Normal file
|
@ -0,0 +1,43 @@
|
|||
import subprocess
|
||||
import sys
|
||||
from functools import partial
|
||||
|
||||
def vcs(bin_name):
|
||||
def inner(command, *args, **kwargs):
|
||||
repo = kwargs.pop("repo", None)
|
||||
log_error = kwargs.pop("log_error", True)
|
||||
quiet = kwargs.pop("quiet", False)
|
||||
if kwargs:
|
||||
raise TypeError, kwargs
|
||||
|
||||
args = list(args)
|
||||
|
||||
proc_kwargs = {}
|
||||
if repo is not None:
|
||||
proc_kwargs["cwd"] = repo
|
||||
|
||||
command_line = [bin_name, command] + args
|
||||
if not quiet:
|
||||
print >> sys.stderr, " ".join(command_line[:10])
|
||||
try:
|
||||
return subprocess.check_output(command_line, stderr=subprocess.STDOUT, **proc_kwargs)
|
||||
except subprocess.CalledProcessError as e:
|
||||
if log_error:
|
||||
print >> sys.stderr, e.output
|
||||
raise
|
||||
return inner
|
||||
|
||||
git = vcs("git")
|
||||
hg = vcs("hg")
|
||||
|
||||
|
||||
def bind_to_repo(vcs_func, repo):
|
||||
return partial(vcs_func, repo=repo)
|
||||
|
||||
|
||||
def is_git_root(path):
|
||||
try:
|
||||
rv = git("rev-parse", "--show-cdup", repo=path)
|
||||
except subprocess.CalledProcessError:
|
||||
return False
|
||||
return rv == "\n"
|
Loading…
Add table
Add a link
Reference in a new issue