Merge branch 'stable-2.9'

* stable-2.9:
  Fix GitWeb link for parent commits
  Move gerrit.war from api_{install,deploy} to war_{install,deploy}
  New review UI: Fix display of large avatar image in user popup panel

Conflicts:
	.buckconfig

Change-Id: I3ec139fb5b95fc443be834fba8866528e7a51ab2
This commit is contained in:
David Pursehouse 2014-05-21 15:39:04 +09:00
commit 14bdaef845
6 changed files with 82 additions and 32 deletions

View File

@ -1,8 +1,10 @@
[alias]
all = //:all
api = //:api
api_deploy = //tools/maven:deploy
api_install = //tools/maven:install
api_deploy = //tools/maven:api_deploy
api_install = //tools/maven:api_install
war_deploy = //tools/maven:war_deploy
war_install = //tools/maven:war_install
chrome = //:chrome
docs = //Documentation:html
firefox = //:firefox

View File

@ -129,18 +129,30 @@ project directories in `buck-out/gen`, here as example for plugin API:
buck-out/gen/gerrit-plugin-api/plugin-api-javadoc.jar
----
Install {extension,plugin,gwt}-api and gerrit.war to the local maven repository:
Install {extension,plugin,gwt}-api to the local maven repository:
----
buck build api_install
----
Deploy {extension,plugin,gwt}-api and gerrit.war to the remote maven repository:
Deploy {extension,plugin,gwt}-api to the remote maven repository:
----
buck build api_deploy
----
Install gerrit.war to the local maven repository:
----
buck build war_install
----
Deploy gerrit.war to the remote maven repository:
----
buck build war_deploy
----
The type of the repo is induced from the Gerrit version name, i.e.
* `2.9-SNAPSHOT`: snapshot repo

View File

@ -156,6 +156,12 @@ configuration needed for deployment]
* The WAR file to upload is `buck-out/gen/release.war`
* Upload WAR to the storage bucket via `https://cloud.google.com/console` (manual via web browser)
* Push the WAR file to the Maven storage bucket:
+
----
buck build war_deploy
----
[[push-stable]]

View File

@ -80,27 +80,33 @@ public class AvatarImage extends Image implements LoadHandler {
setHeight(info.height() > 0 ? info.height() + "px" : "");
setUrl(info.url());
popup(account, addPopup);
} else if (account.email() != null) {
loadAvatar(account, size, addPopup);
}
} else if (account.email() != null) {
// TODO Kill /accounts/*/avatar URL.
String u = account.email();
if (Gerrit.isSignedIn()
&& u.equals(Gerrit.getUserAccount().getPreferredEmail())) {
u = "self";
}
RestApi api = new RestApi("/accounts/").id(u).view("avatar");
if (size > 0) {
api.addParameter("s", size);
setSize("", size + "px");
}
setVisible(false);
setUrl(api.url());
popup(account, addPopup);
loadAvatar(account, size, addPopup);
} else {
setVisible(false);
}
}
private void loadAvatar(AccountInfo account, int size, boolean addPopup) {
// TODO Kill /accounts/*/avatar URL.
String u = account.email();
if (Gerrit.isSignedIn()
&& u.equals(Gerrit.getUserAccount().getPreferredEmail())) {
u = "self";
}
RestApi api = new RestApi("/accounts/").id(u).view("avatar");
if (size > 0) {
api.addParameter("s", size);
setSize("", size + "px");
}
setVisible(false);
setUrl(api.url());
popup(account, addPopup);
}
private void popup(AccountInfo account, boolean addPopup) {
if (addPopup) {
PopupHandler popupHandler = new PopupHandler(account, this);

View File

@ -154,7 +154,7 @@ class CommitBox extends Composite {
GitwebLink gw = Gerrit.getGitwebLink();
if (gw != null) {
Anchor a =
new Anchor(gw.toRevision(project, c.commit()), gw.getLinkName());
new Anchor(gw.getLinkName(), gw.toRevision(project, c.commit()));
a.setStyleName(style.parentWebLink());
parentWebLinks.add(a);
}

View File

@ -21,27 +21,51 @@ def maven_package(
doc = {},
war = {}):
cmd = ['$(exe //tools/maven:mvn)', '-v', version, '-o', '$OUT']
dep = []
for type,d in [('jar', jar), ('java-source', src), ('javadoc', doc), ('war', war)]:
api_cmd = []
api_deps = []
for type,d in [('jar', jar), ('java-source', src), ('javadoc', doc)]:
for a,t in d.iteritems():
cmd.append('-s %s:%s:$(location %s)' % (a,type,t))
dep.append(t)
api_cmd.append('-s %s:%s:$(location %s)' % (a,type,t))
api_deps.append(t)
genrule(
name = 'install',
cmd = ' '.join(cmd + ['-a', 'install']),
deps = dep + ['//tools/maven:mvn'],
out = 'install.info',
name = 'api_install',
cmd = ' '.join(cmd + api_cmd + ['-a', 'install']),
deps = api_deps + ['//tools/maven:mvn'],
out = 'api_install.info',
)
if repository and url:
genrule(
name = 'deploy',
cmd = ' '.join(cmd + [
name = 'api_deploy',
cmd = ' '.join(cmd + api_cmd + [
'-a', 'deploy',
'--repository', repository,
'--url', url]),
deps = dep + ['//tools/maven:mvn'],
out = 'deploy.info',
deps = api_deps + ['//tools/maven:mvn'],
out = 'api_deploy.info',
)
war_cmd = []
war_deps = []
for a,t in war.iteritems():
war_cmd.append('-s %s:war:$(location %s)' % (a,t))
war_deps.append(t)
genrule(
name = 'war_install',
cmd = ' '.join(cmd + war_cmd + ['-a', 'install']),
deps = war_deps + ['//tools/maven:mvn'],
out = 'war_install.info',
)
if repository and url:
genrule(
name = 'war_deploy',
cmd = ' '.join(cmd + war_cmd + [
'-a', 'deploy',
'--repository', repository,
'--url', url]),
deps = war_deps + ['//tools/maven:mvn'],
out = 'war_deploy.info',
)