mirror of
https://git.codelinaro.org/clo/tools/repo.git
synced 2025-06-17 16:37:40 +08:00
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).
This commit is contained in:

committed by
Shawn O. Pearce

parent
2f968c943b
commit
bc7ef67d9b
13
project.py
13
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):
|
||||
|
Reference in New Issue
Block a user