aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-11-09 15:59:24 +0100
committerQt by Nokia <qt-info@nokia.com>2011-11-11 17:14:02 +0100
commit4cbe91304a5d1cbd26bffc0fb65333670a068de4 (patch)
treeaf12008a5bbfb5c4e7f0597316d756515ea6ac89
parenteba69e730fb9b6663b1865087dd4b09a250a1dcd (diff)
always make ssh-based gerrit remotes
there is no point in making read-only gerrit remotes. use gitorious for that. instead, create remotes which rely on proper ssh configuration if --codereview-username is not passed. Change-Id: I08812fd26f1de6df22cd952211f620f36f069e51 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
-rwxr-xr-xinit-repository26
1 files changed, 11 insertions, 15 deletions
diff --git a/init-repository b/init-repository
index fcb05f67..396b42ed 100755
--- a/init-repository
+++ b/init-repository
@@ -150,14 +150,11 @@ The `--http' option does not affect the gerrit remotes.
=item --codereview-username <Gerrit/JIRA username>
-Adds a (potentially) writable remote named `gerrit' for each module,
-for use with the Gerrit code review tool.
-This requires a username for SSH access to the codereview.qt-project.org
-server, which will be the same username you have for the bugtracker at
-bugreports.qt.nokia.com.
+Specify the user name for the (potentially) writable `gerrit' remote
+for each module, for use with the Gerrit code review tool.
-If this option is omitted, the gerrit remote is created with read-only
-access (using HTTP protocol).
+If this option is omitted, the gerrit remote is created without a username
+and port number, and thus relies on a correct SSH configuration.
=item --alternates <path to other Qt5 repo>
@@ -257,10 +254,7 @@ my %PROTOCOL_REPOS = (
);
my $GERRIT_SSH_BASE
- = 'ssh://codereview.qt-project.org:29418/';
-
-my $GERRIT_HTTP_BASE
- = 'http://codereview.qt-project.org/p/';
+ = 'ssh://@USER@codereview.qt-project.org@PORT@/';
my $BNE_MIRROR_URL_BASE
= 'git://bq-git.apac.nokia.com/qtsoftware/';
@@ -529,14 +523,16 @@ sub git_add_remotes
if ($gerrit_repo_basename && !$current_remotes{'gerrit'}) {
my $gerrit_repo_url;
- # If given a username, we use writable remote (ssh).
- # Otherwise, we use read-only (http).
+ # If given a username, make a "verbose" remote.
+ # Otherwise, rely on proper SSH configuration.
if ($self->{'codereview-username'}) {
$gerrit_repo_url = $GERRIT_SSH_BASE;
- $gerrit_repo_url =~ s[^ssh://][ssh://$self->{'codereview-username'}@];
+ $gerrit_repo_url =~ s,\@USER\@,$self->{'codereview-username'}\@,;
+ $gerrit_repo_url =~ s,\@PORT\@,:29418,;
}
else {
- $gerrit_repo_url = $GERRIT_HTTP_BASE;
+ $gerrit_repo_url = $GERRIT_SSH_BASE;
+ $gerrit_repo_url =~ s,\@[^\@]+\@,,g;
}
$gerrit_repo_url .= $gerrit_repo_basename;