Bug 1124181 - Update to latest wptrunner, r=Ms2ger

This commit is contained in:
James Graham 2015-02-04 15:49:43 +00:00
parent a74d986e7d
commit 8d98504c66
2 changed files with 17 additions and 5 deletions

View File

@ -158,7 +158,8 @@ class CreateSyncPatch(Step):
local_tree.add_new(os.path.relpath(state.tests_path,
local_tree.root))
updated = local_tree.update_patch(include=[state.tests_path,
state.metadata_path])
state.metadata_path])
local_tree.commit_patch()
if not updated:
self.logger.info("Nothing to sync")

View File

@ -237,20 +237,24 @@ class GitTree(object):
of filenames (which must already be in the repo)
to commit
"""
assert self.message is not None
if include is not None:
args = tuple(include)
else:
args = ()
if self.git("status", "-uno", "-z", *args).strip():
self.git("commit", "-m", self.message, *args)
self.git("add", *args)
return True
return False
def commit_patch(self):
pass
assert self.message is not None
if self.git("diff", "--name-only", "--staged", "-z").strip():
self.git("commit", "-m", self.message)
return True
return False
def init(self):
self.git("init")
@ -320,6 +324,13 @@ class GitTree(object):
rv.append(parts[1])
return rv
def contains_commit(self, commit):
try:
self.git("rev-parse", "--verify", commit.sha1)
return True
except subprocess.CalledProcessError:
return False
class CommitMessage(object):
def __init__(self, text):