diff options
author | Shawn O. Pearce <sop@google.com> | 2010-07-15 17:00:14 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2010-07-15 17:03:19 -0700 |
commit | 3575b8f8bdc5f15de23db82499e0ce152f634a19 (patch) | |
tree | d5938307c3a751e36be71653f1d902018dd1198f | |
parent | a5ece0e0505324218f38af02a1fe046ca2bcc278 (diff) | |
download | git-repo-3575b8f8bdc5f15de23db82499e0ce152f634a19.tar.gz |
upload: Allow review.HOST.username to override emailv1.6.10
Some users might need to use a different login name than the local
part of their email address for their Gerrit Code Review user
account. Allow it to be overridden with the review.HOST.username
configuration variable.
Change-Id: I714469142ac7feadf09fee9c26680c0e09076b75
Signed-off-by: Shawn O. Pearce <sop@google.com>
-rw-r--r-- | git_config.py | 5 | ||||
-rw-r--r-- | subcmds/upload.py | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/git_config.py b/git_config.py index dc209ba8..1382d5db 100644 --- a/git_config.py +++ b/git_config.py | |||
@@ -531,8 +531,11 @@ class Remote(object): | |||
531 | def SshReviewUrl(self, userEmail): | 531 | def SshReviewUrl(self, userEmail): |
532 | if self.ReviewProtocol != 'ssh': | 532 | if self.ReviewProtocol != 'ssh': |
533 | return None | 533 | return None |
534 | username = self._config.GetString('review.%s.username' % self.review) | ||
535 | if username is None: | ||
536 | username = userEmail.split("@")[0] | ||
534 | return 'ssh://%s@%s:%s/%s' % ( | 537 | return 'ssh://%s@%s:%s/%s' % ( |
535 | userEmail.split("@")[0], | 538 | username, |
536 | self._review_host, | 539 | self._review_host, |
537 | self._review_port, | 540 | self._review_port, |
538 | self.projectname) | 541 | self.projectname) |
diff --git a/subcmds/upload.py b/subcmds/upload.py index 569e31c1..b47b37b8 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -92,6 +92,11 @@ review.URL.autocopy can be set to a comma separated list of reviewers | |||
92 | who you always want copied on all uploads with a non-empty --re | 92 | who you always want copied on all uploads with a non-empty --re |
93 | argument. | 93 | argument. |
94 | 94 | ||
95 | review.URL.username: | ||
96 | |||
97 | Override the username used to connect to Gerrit Code Review. | ||
98 | By default the local part of the email address is used. | ||
99 | |||
95 | The URL must match the review URL listed in the manifest XML file, | 100 | The URL must match the review URL listed in the manifest XML file, |
96 | or in the .git/config within the project. For example: | 101 | or in the .git/config within the project. For example: |
97 | 102 | ||