diff options
author | Ficus Kirkpatrick <ficus@android.com> | 2009-05-04 12:45:11 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2009-05-05 15:01:18 -0700 |
commit | bc7ef67d9bfcebe17c89eb57cb465d0d6d1d999d (patch) | |
tree | f5cb5e47c6d5ad8bc2ebfdcdef55df77f62349a9 /project.py | |
parent | 2f968c943b1c6f61f867fa9b87105836e0e5f354 (diff) | |
download | git-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.py | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 | ||
159 | class StatusColoring(Coloring): | 172 | class StatusColoring(Coloring): |
160 | def __init__(self, config): | 173 | def __init__(self, config): |