summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorFicus Kirkpatrick <ficus@android.com>2009-05-04 12:45:11 -0700
committerShawn O. Pearce <sop@google.com>2009-05-05 15:01:18 -0700
commitbc7ef67d9bfcebe17c89eb57cb465d0d6d1d999d (patch)
treef5cb5e47c6d5ad8bc2ebfdcdef55df77f62349a9 /project.py
parent2f968c943b1c6f61f867fa9b87105836e0e5f354 (diff)
downloadgit-repo-bc7ef67d9bfcebe17c89eb57cb465d0d6d1d999d.tar.gz
Automatically guess Gerrit change number in "repo upload --replace"v1.6.7.4
This feature only works if you have one commit to replace right now (the common case).
Diffstat (limited to 'project.py')
-rw-r--r--project.py13
1 files changed, 13 insertions, 0 deletions
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):
155 self.replace_changes, 155 self.replace_changes,
156 people) 156 people)
157 157
158 def GetPublishedRefs(self):
159 refs = {}
160 output = self.project.bare_git.ls_remote(
161 self.branch.remote.SshReviewUrl(self.project.UserEmail),
162 'refs/changes/*')
163 for line in output.split('\n'):
164 try:
165 (sha, ref) = line.split()
166 refs[sha] = ref
167 except ValueError:
168 pass
169
170 return refs
158 171
159class StatusColoring(Coloring): 172class StatusColoring(Coloring):
160 def __init__(self, config): 173 def __init__(self, config):