Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(591)

Unified Diff: tools/push-to-trunk/git_recipes.py

Issue 607893004: Add tag write access to merge script. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: More docu. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/push-to-trunk/git_recipes.py
diff --git a/tools/push-to-trunk/git_recipes.py b/tools/push-to-trunk/git_recipes.py
index a1e6256df29db1b26e7ea5676f584c72700e39d5..8944f7ca092d80b06451f358e8f2df2f8165f599 100644
--- a/tools/push-to-trunk/git_recipes.py
+++ b/tools/push-to-trunk/git_recipes.py
@@ -101,6 +101,18 @@ class GitRecipesMixin(object):
def GitBranch(self, **kwargs):
return self.Git("branch", **kwargs)
+ @Strip
+ def GitRemoteContains(self, hsh, **kwargs):
agable 2014/09/29 09:49:12 I'd be scared that someone might use this who does
Michael Achenbach 2014/09/29 10:46:25 I'll rename the function as it should be just used
+ """Returns the remote branch for a given commit.
+
+ Returns an empty string in case the commit doesn't exist on any remote
agable 2014/09/29 09:49:11 None is a better sentinel value than "".
Michael Achenbach 2014/09/29 10:46:25 Done. Was because of the @Strip wrapper. But I mak
+ branch.
+ Returns the last remote branch in case the commit exists on more than one.
+ """
+ branches = self.Git(MakeArgs(["branch -r --contains", hsh]),
+ **kwargs).strip().splitlines()
+ return (branches or [""])[-1]
+
def GitCreateBranch(self, name, branch="", **kwargs):
assert name
self.Git(MakeArgs(["checkout -b", name, branch]), **kwargs)

Powered by Google App Engine
This is Rietveld 408576698