From bc7ef67d9bfcebe17c89eb57cb465d0d6d1d999d Mon Sep 17 00:00:00 2001 From: Ficus Kirkpatrick Date: Mon, 4 May 2009 12:45:11 -0700 Subject: Automatically guess Gerrit change number in "repo upload --replace" This feature only works if you have one commit to replace right now (the common case). --- project.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'project.py') diff --git a/project.py b/project.py index a698b316..1d908e7f 100644 --- a/project.py +++ b/project.py @@ -155,6 +155,19 @@ class ReviewableBranch(object): self.replace_changes, people) + def GetPublishedRefs(self): + refs = {} + output = self.project.bare_git.ls_remote( + self.branch.remote.SshReviewUrl(self.project.UserEmail), + 'refs/changes/*') + for line in output.split('\n'): + try: + (sha, ref) = line.split() + refs[sha] = ref + except ValueError: + pass + + return refs class StatusColoring(Coloring): def __init__(self, config): -- cgit v1.2.3-54-g00ecf