The download commands are returned as part of the FetchInfo of a
revision, but only if the download commands are requested by setting
the option DOWNLOAD_COMMANDS.
This allows to completely customize the download commands on a Gerrit
installation.
This change only effects the download commands that are shown on
ChangeScreen2.
For non-anonymous download commands the username is now again included
into the displayed download commands. Also the HTTP scheme and the
Anonymous HTTP scheme can be used at the same time.
With this change the patch download (base64 & zipped) is still
hard-coded in Gerrit core and does not come from a plugin.
Bug: issue 2116
Change-Id: I8fb21fdeb1a98548ce9027655e1b5e467ee2d27e
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
The comment in AbstractQueryChangesTest incorrectly claimed the SQL
implementation was broken when it was actually the index
implementation.
Change-Id: I63b46a893937176ae02cd8141da9dc97db1d9e54
Exposing getName() to the derived SSH command implementation class allows us to
implement generic SSH commands.
For example Gerrit Shell plugin can now bind multiple commands to the same
class, which retrieves the shell command passed and executes it:
public class SshShellModule extends PluginCommandModule {
@Override
protected void configureCommands() {
command("ls").to(ShellCommand.class);
command("ps").to(ShellCommand.class);
[...]
}
}
With the possible implementation:
public class ShellCommand extends SshCommand {
@Override
protected void run() throws UnloggedFailure {
String cmd = getName().substring(getPluginName().length() + 1);
ProcessBuilder proc = new ProcessBuilder(cmd);
Process cmd = proc.start();
[...]
}
}
And the call:
davido@wizball:>ssh gerrit shell ls
davido@wizball:>ssh gerrit shell ps
Change-Id: I43be66a99340e839b70c07e93752278cee5f039d
Implementing the new extension points doesn't have any effect yet.
This is also why they are not yet documented. The documentation will
be added later once Gerrit makes use of them.
Change-Id: I30f46a1a4188d31a0aa825ad64cd794253932053
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
The REST endpoint that updates the project option is supposed to
return the updated project options, however at the moment it returns
the project options as they were before the update. As result
after changing the project options in the WebUI one needs to refresh
the screen in order to see the new values.
The problem was that ProjectControl was created for the project with
the old values and after the configuration was updated, this old
project control instance with the outdated project instance was used
to create the project options that are returned.
Change-Id: Ib3b94639364ef1ddb96772989937043c4251a30f
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
For deleting a branch by pushing to Gerrit it is required to have
force push permissions. For convenience project owners are allowed to
delete branches through WebUI/REST/SSH without force push permission
(because they anyway can assign this permission themselves). However
force push can be blocked on a parent project to prevent project
owners from deleting branches. In this case assigning force push on a
project has no effect. The problem is that project owners can still
delete the branches through WebUI/REST/SSH although force push is
actually blocked for them.
With this change project owners are only allowed to delete branches if
force push is not blocked for them. Administrators can still delete
branches even if force push is blocked.
Change-Id: I9ec712907e6f6f5a3cf33648d59340eaa72548f6
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Instead of relying on string names for Gerrit's top menu items,
provide an enumeration that contains definitions of all top items.
It also adds GWT Extensions module to fulfill compilation dependency
for gwtui.
Change-Id: I7a109885b9a65b132e7119851cd76be527f75364
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Setting only the change timestamp based on a counter is not
sufficient; other callers elsewhere also call
DateTimeUtils.currentTimeMillis().
Change-Id: I897a6413a0d3f94cbab276bfc24468ee21458fdd
Unlike pure server code, reviewdb.client is used from GWT, so we
cannot just use joda's DateTimeUtils.currentTimeMillis(). Instead,
just introduce arguments where necessary. Passing TimeUtil.nowTs() is
a bit cumbersome but usually short enough to type.
Change-Id: I87ef09b0920bc36851bca893a2a37348ffc6bf3a
This method from joda-time supports replacing the system time provider
with a custom provider for tests. Since it is verbose, and we expect
more related methods, put it in the more succinct TimeUtil.nowMs().
This commit covers the trivial cases in the server side; client-side
code still uses System.currentTimeMillis().
Change-Id: I6c56e8c5bbb0cf7b0271e431d1ebdb532967b9e8
The unspecified units were confusing when writing tests around these
values, so be explicit about units in variable names and quantities
for conversion.
Use Ints.checkedCast so we fail fast when inserting a change 4000+
years in the future rather than having it not show up in search
results.
Correct the sort key epoch time, which likely had a timezone error
when initially calculated:
$ python -c 'import datetime; print datetime.datetime.fromtimestamp(1222819200L)'
2008-09-30 17:00:00
This mistake does not affect any data; the comment in the code was
just confusingly incorrect.
Change-Id: I6d8bcf4985e91c3d115002db42642049da8c708f
Adds general information about global capabilities, how the server
ownership is administered and what it looks like underneath, i.e.
refs/meta/config.
Change-Id: Ia0da5d692b7f3c43c4471668944bdcc9de3b3cd6
Signed-off-by: Fredrik Luthander <fredrik.luthander@sonymobile.com>
Signed-off-by: David Pursehouse <david.pursehouse@sonymobile.com>
Signed-off-by: David Ostrovsky <david@ostrovsky.org>
Getting change details includes detailed account information, but the
example didn't show the username for the AccountInfos.
Change-Id: If0ff49924e3aa57cee087f16f3087304488f957b
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
We always returned detailed account information even if it wasn't
requested.
Change-Id: I8bf7c05feee659259b7a239facc50d96c3bae395
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
The documentation of AccountInfo claims that the username is included
if detailed account information is requested but this was not the
case.
Change-Id: Ic28cadb6b7236ce69b60cb9d237fe18eae01e8e0
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
Some fields in AccountInfo are only included if detailed account
information is requested. Link to the option that includes detailed
account information so that readers know how these fields can be
retrieved.
Change-Id: I6d209469942549ffe4e5626ebc8604963899f29a
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
On each save of the project options on the ProjectInfoScreen the
project commands are added once more to screen so that they are
displayed multiple times.
Change-Id: I5d9729d7a9870780c550429d841fae14396ef203
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This updates the plugins to versions that are adapted to the
simplified GitReferenceUpdatedListener.Event API.
Change-Id: I0d01639c4738945aafd3920acdfbe26cf23c176b