12886 Commits

Author SHA1 Message Date
David Pursehouse
30c35c8398 Merge branch 'stable-2.10'
* stable-2.10:
  Set 'line-height: normal' for lines in side-by-side diff
  Add missing documentation of the groups_members cache
  SideBySide2: Show file name in window title again
  Fix documentation of the default value for core.streamFileThreshold
  Bump version to 2.9.2

Change-Id: Ibea6f3291015f1dc707057537916e00d5a93c501
2014-11-19 19:15:17 +09:00
David Pursehouse
d98d375f45 Merge branch 'stable-2.9' into stable-2.10
* stable-2.9:
  Set 'line-height: normal' for lines in side-by-side diff
  Add missing documentation of the groups_members cache
  SideBySide2: Show file name in window title again
  Fix documentation of the default value for core.streamFileThreshold
  Bump version to 2.9.2

Conflicts:
	VERSION
	gerrit-extension-api/pom.xml
	gerrit-plugin-api/pom.xml
	gerrit-plugin-archetype/pom.xml
	gerrit-plugin-gwt-archetype/pom.xml
	gerrit-plugin-gwtui/pom.xml
	gerrit-plugin-js-archetype/pom.xml
	gerrit-war/pom.xml

Change-Id: Ie294e17f71d3df1ec3d52300e22ea5e83834f73f
2014-11-19 18:50:34 +09:00
Edwin Kempin
d6d9bf3439 Merge "Fix StackOverflowError during hash code computation" 2014-11-19 09:48:05 +00:00
David Pursehouse
1dbc53126c Set 'line-height: normal' for lines in side-by-side diff
On some browsers, accented characters are not displayed correctly
because the line is not high enough.

Bug: Issue 2970
Change-Id: I7a4e64f69f7d3c96a58d1bd1930d9f6c23896d14
2014-11-19 09:37:21 +00:00
David Ostrovsky
8e65434803 Clarify when to use final modifier and when not
Change-Id: I096b4f7b61757bdaba4b8045b2d8732e0a8f821d
2014-11-19 17:57:45 +09:00
Bruce Zu
825125a03b Add missing documentation of the groups_members cache
Change-Id: Ia2449cf4a04d4e0472d092431c5abbf7d6295ab2
2014-11-19 17:24:26 +09:00
David Ostrovsky
e2636a3b5a Fix StackOverflowError during hash code computation
I7659ae66b provided wrong implementation of hashCode(). Objects.hash()
calls Arrays.hashCode(values) on provided values, which in turn calls
hashCode() on its parameters, which in turn leads to endless recursion,
and in the end to StackOverflowError error.

Change-Id: I709239cbd27592765319b15c13044ab9aad738c0
2014-11-18 22:00:38 +01:00
David Pursehouse
d26e43f22f Don't use deprecated PGPPublicKeyRingCollection constructor
The PGPPublicKeyRingCollection constructor was deprecated in
Bouncycastle v1.51.

Use BcPGPPublicKeyRingCollection instead.

Change-Id: I5bc4fb4927ba37ecbf7d3763809acc2f53d7fd4e
2014-11-18 06:12:43 +00:00
David Pursehouse
52c55526d8 Remove declaration of unthrown IOException in PushOneCommit
Change-Id: If631a81a987c8e877d3484d7631422899322b39b
2014-11-18 04:13:25 +00:00
Edwin Kempin
a92861fb01 Show link on hover for headings and anchors in documentation
For supporting users it is often useful to send them links to a
certain section in the documentation. The Gerrit documenation contains
a lot of anchors, but they are not easily accessible. If the section
is linked from the TOC the link to the section can be gained by
clicking on the link in the TOC. To link to other elements it is often
needed to check the HTML source code to find out the link target.

Make the links to section headings and anchors easier accessible by
displaying a link icon when the mouse is hovered over the heading or
anchor. By clicking on the link icon the page anchor is set and the
link can be copied from the address bar of the browser.

Having this functionality for anchors is especially useful for linking
to certain configuration parameters in the config-gerrit.html page.

The link icon is taken from the 'Freebie: Application Icon Set' [1]
which is licensed under the Creative Commons Attribution 3.0 Unported
License [2].

[1] http://tympanus.net/codrops/2012/10/02/freebie-application-icon-set-png-psd-csh/
[2] http://creativecommons.org/licenses/by/3.0/deed.en_US

Change-Id: I4377ea23ad76143fd4caa78afc30b82690e533ff
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-11-18 01:30:46 +00:00
David Ostrovsky
a5caa9a49f Move Theme enum to extension API
Change-Id: I04b8c1ebbe373906cd7983f92d934eb56c2c47f8
2014-11-18 01:12:16 +00:00
David Pursehouse
1ca5f7f8af Merge "Update Lucene to version 4.10.2" 2014-11-18 00:52:22 +00:00
Dave Borowitz
b959612337 Add mergeable API, add acceptance test, and fix bugs
Move MergeableInfo into gerrit-extension-api so we can add a method to
RevisionAPI returning it. Add an acceptance test exercising this new
API, which also exercises Mergeable.

Mergeable had never been exercised in acceptance tests, so this
flushed out some bugs. For one thing, we were passing nulls to the
MergeabilityCacheImpl.LoadHelper constructor, which checks for
non-nulls. For another, particularly galling, we failed to set the
mergeable field in the result of /mergeable in case of a cache hit.

Change-Id: Ib77d994b65af439e56ebc112f3000a71b4222c9b
2014-11-17 16:41:08 -08:00
Dave Borowitz
aa93d026da Don't manually create Change-Ids for acceptance tests
There was a bug in the commit creation code where it used the parent
tree ID in the hash to compute the Change-Id. (This is somewhat
understandable since it was using CommitCommand, which looks in the
work tree/index and thus does not know the new tree SHA-1 when
constructing the commit message.) This means that when creating two
changes against the same parent in rapid succession, e.g. to test
behavior of a side branch merging back to master, we might
nondeterministically end up with the same Change-Id, depending on
whether the clock in the PersonIdent advanced.

There is already a setInsertChangeId(boolean) method in CommitCommand,
so just use that instead, and parse the resulting Change-Id out of the
message.

Change-Id: Ie87524d324a14a949a14aada963a6de0b3df0b99
2014-11-17 16:41:07 -08:00
Dave Borowitz
d84a373ea2 Fix racy read in ReindexAfterUpdate when merging
As soon as the GitReferenceUpdatedListener is fired, the GetChanges
task reads all open changes on the branch from the DB. There may be
many of these, and they may be stuck in the queue for a while, during
which time some of these changes may be submitted. Therefore we should
be rereading the changes from the DB when the index task starts, but
we weren't, we were using the previously-read Change entities.

Instead, pass a Change.Id into the Index task and reread it on task
execution time. We need another argument to pass the account ID for
the request context, but we choose this slight ugliness over holding a
tantalizing reference to a stale object.

Change-Id: I63f4b874d09d3e6fa35b7d3a82d0089982526f62
2014-11-17 16:35:18 -08:00
David Pursehouse
9ac0746423 Update Lucene to version 4.10.2
Version 4.10.2 includes a couple of bug fixes [1], but these are not
necessarily needed by Gerrit.

This update is needed because Elasticsearch 1.4.0 has a dependency
on this version [2].

There is no change in the index format since 4.10.1 so we reuse the
same version number for the Lucene backed change index.

[1] http://lucene.apache.org/core/4_10_2/changes/Changes.html#v4.10.2.bug_fixes
[2] http://mvnrepository.com/artifact/org.elasticsearch/elasticsearch/1.4.0

Change-Id: Ie47dd2238493da44659c73c7f97f0caa2f7fdfa4
2014-11-18 09:15:07 +09:00
David Pursehouse
99c6c1fd32 Merge "Use SchemaFactory instead of Provider in DbGroupMemberAuditListener" 2014-11-18 00:13:17 +00:00
Dave Borowitz
b568a374d8 PatchSetInserter: Index updated change rather than original
Change-Id: Ic2f7a3193805371e53521969304c21fae9a0fd62
2014-11-17 15:54:13 -08:00
Dave Borowitz
0fc4e9a030 MergeOp: Don't double-index in setMerged
This appears to have been introduced by a clean auto-merge of 75472334
and 22e43cc8, the latter of which was merged into master from
stable-2.9.

While reordering, move the post-processing out of the transaction
block. We don't want to index or send emails if the DB update fails.

Change-Id: I0fd855062f0c3ed118e537ef80358863d4f61284
2014-11-17 14:46:19 -08:00
David Pursehouse
2ac00ae55a Use SchemaFactory instead of Provider in DbGroupMemberAuditListener
Using Provider<ReviewDb> causes ProvisionException when running the
tests:

 Automatic ReviewDb only available in request scope

Change it to SchemaFactory<ReviewDb>.

Change-Id: I342bce45ac66a5d6c602f92059bed15abdbf4f11
2014-11-17 23:35:32 +09:00
David Pursehouse
4eff78d76a Fix argument order in call to checkNotNull
Change-Id: I09c681c8732089a33349ef45027a850ee2cf66e2
2014-11-13 10:43:46 +09:00
Richard Möhn
2b68c20a2a SideBySide2: Show file name in window title again
In the old side by side diff screen, the name of the file being diffed
was shown in the window title. For some reason the code that set the
window title wasn't adopted from PatchScreen into SideBySide2.

Put the setting of the window title back in. Put it into onInitUI(),
since this was the place where it had first stood in PatchScreen.
SideBySide2 already displays the path on the page, so leave out the
setPageTitle() from PatchScreen, because this would display that path
again.

Also don't obtain the file name by finding the last slash with
lastIndexOf() and then taking the substring from there, but use
FileInfo.getFileName() instead. Searching for "lastIndexOf('/')" in the
whole project gives quite some occurences. I thought reusing something
might be a good idea.

Bug: Issue 2960
Change-Id: I12a280b8a437b60e4e2f779b81072117d45a1505
2014-11-13 01:16:38 +00:00
David Pursehouse
08314c5fcb Merge "Fix documentation of the default value for core.streamFileThreshold" into stable-2.9 2014-11-13 00:41:23 +00:00
David Pursehouse
f8fd16b135 Merge "Bump version to 2.9.2" into stable-2.9 2014-11-13 00:40:50 +00:00
Stefan Beller
de0d62194e Fix a typo in Documentation/prolog-cookbook.txt
Change-Id: I54e6fbfd36ede07f6a83994451c068b90ee700cf
2014-11-12 15:11:48 -08:00
Shawn Pearce
d090f49ba1 Merge "Enable streaming large files put to an edit" 2014-11-12 23:02:58 +00:00
Shawn Pearce
28588e70a8 Enable streaming large files put to an edit
If the browser/user-agent sends a Content-Length header in the
request, JGit can stream the payload into the compressed object
format without holding the entire payload inside the server's
heap. This can reduce memory pressure when the user edits a
large XML file.

Push the RawInput down into the ChangeEditModifier, giving it access
to the expected length. If the length is defined (>= 0), JGit can
stream the payload from the input.  If the user agent failed to
supply a length, the payload must be buffered to compute it.

Cleanup the ChangeEditModifier management of the tree by doing blob
insertion before the tree is updated. This allows passing in only
the ObjectId, which is cleaner for the Git style code.

When restoring an entry with RESTORE_ENTRY, reset the file mode to
the original mode. This preserves the execute bit or symlink mode,
instead of resetting them to regular file.

When editing an entry, try to keep the existing mode instead of
forcing to a regular file. This allows editing an executable script
file and keeping the file executable.

Change-Id: I8f45fd4a4a45cef266d994c2457d3e100231c312
2014-11-12 14:29:51 -08:00
Dave Borowitz
21485c8115 Simplify ChangeIndex by removing delete(ChangeData)
Since indexing is generally done after any modification operations,
using a deleted ChangeData when indexing a deleted change is just
asking for trouble; most ChangeData methods (reasonably) assume that
the change exists. Instead, just use the form of the method that
passes in the ID.

Change the method that takes an integer ID to take a Change.Id object.
In almost all cases we already have one of these handy, and this is
more consistent with public interfaces elsewhere in Gerrit.

A fortunate side effect is that async deletes should happen slightly
faster, since we no longer need to open a DB connection and produce a
ChangeData in the delete codepath.

Change-Id: I353522b52188de11353ca26a7ba90a2ca462e404
2014-11-12 10:35:02 -08:00
Dave Borowitz
cb72e26daf Remove unused import in Daemon
Change-Id: If7d83e89a38a3ad397e22053eb3a48c718735379
2014-11-12 10:35:02 -08:00
Dave Borowitz
552293b20d Merge branch 'stable-2.10'
* stable-2.10:
  Remove uneeded dependency in ChangesCollection
  Delete a change from the index when it is not in the DB

Change-Id: I02a4773dd581c29704a7cc45c5225258d657f836
2014-11-12 10:13:32 -08:00
Dave Borowitz
fdb09997b5 Merge branch 'stable-2.9' into stable-2.10
* stable-2.9:
  Remove uneeded dependency in ChangesCollection
  Delete a change from the index when it is not in the DB

Change-Id: Ifed2fc5073071e9d4f457aa02b73caa2b6173599
2014-11-12 10:12:26 -08:00
Hugo Arès
1faef9018d Remove uneeded dependency in ChangesCollection
Change I1db5373e31585e99c5f45e05274d86d69b4f24e6 added an unneeded
dependency in ChangesCollection.

Change-Id: I2f8609416518495624eda9e08309a6e14863fbe8
2014-11-12 12:51:08 -05:00
Olga Grinberg
903be04b02 Delete a change from the index when it is not in the DB
If for some reason the secondary index is out of date, i.e. the  change
was deleted from the database but wasn't deleted from the secondary
index, it was impossible to re-index (remove) that change.

Add logic to automatically remove the change from the secondary index
if this change is requested through the Change REST API endpoint and
doesn't exist in the database.

If a user click on search result from a stale change, he will a get a
404 page and the change will be removed from the index.

To fix the problem without opening the change page, run a command like:
curl --user <user name>  -X POST http://<host>:<port>/a/changes/<change id>/index

Issue: 2996
Change-Id: I1db5373e31585e99c5f45e05274d86d69b4f24e6
2014-11-12 17:03:41 +00:00
Edwin Kempin
7f5a4afdb3 Fix documentation of the default value for core.streamFileThreshold
Since commit bfe9eec1 the default value for core.streamFileThreshold
is 25% of the available JVM heap, limited to 2048m.

Change-Id: I9308875e30470dc33bf9b437909842e87f974141
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
2014-11-12 14:10:59 +01:00
David Pursehouse
3e7054a4c7 Convert project REST API acceptance tests to use Google Truth
Change-Id: Iacc1ef1fc8bcdabf2931d0aad2aca06eee284aeb
2014-11-12 21:52:32 +09:00
David Pursehouse
b9dfff0748 Convert git acceptance tests to use Google Truth
Change-Id: Id6c05410874bcfd21a005857baf2276a14b2f083
2014-11-12 21:10:09 +09:00
David Pursehouse
a0e79b74db Convert inline edit acceptance tests to use Google Truth
Change-Id: I742be0528bdbabd4536cf2c5d559391e0f33491a
2014-11-12 18:00:22 +09:00
David Pursehouse
1990487f34 Fix up usage of Google Truth in previously converted acceptance tests
Use:

 assertThat(results).hasSize(2)
and
 assertThat(results).isEmpty();

Instead of:

 assertThat(results.size()).is(2);
and
 assertThat(results.isEmpty()).isTrue();

Change-Id: Ie3ef2e330a010a2135994be7b9b2af6bb2aabd3f
2014-11-12 17:56:11 +09:00
David Pursehouse
ddb8d6b9df Fix warning about redundant argument in BaseInit
Change-Id: Ib60f4fb8de341a5470d38d5a62c65502910e1dd8
2014-11-12 17:56:11 +09:00
David Pursehouse
474bd3db29 Merge "Clean up stale GWT Dev Mode documentation" 2014-11-12 08:43:16 +00:00
Edwin Kempin
8c6bae6025 Merge "Convert server acceptance tests to use Google Truth" 2014-11-12 08:10:22 +00:00
David Pursehouse
d454ad35ab Merge "RebuildNotedb: Fix guice bindings" 2014-11-12 06:50:32 +00:00
David Pursehouse
8fe518cd42 Bump version to 2.9.2
Change-Id: I017362b20aa53684fc46acdfed6d3162405dbbc2
2014-11-12 15:27:53 +09:00
David Pursehouse
e85105a21a Convert server acceptance tests to use Google Truth
Change-Id: I12cb75d43361f7cdc6c9350a76d5301a1c288406
2014-11-12 09:07:48 +09:00
David Ostrovsky
ea44cb6f82 Clean up stale GWT Dev Mode documentation
Dev mode was deleted in If541bc48b. Clean up documentation as well.

Bug: issue 3008
Change-Id: Ifc98e81e1a07e39afb43c771f4b8e5ad00717a2d
2014-11-12 01:04:21 +01:00
Shawn Pearce
29b1a4a101 Merge "gerrit-pgm: Align Buck rules with package boundaries" 2014-11-11 18:44:52 +00:00
Shawn Pearce
bb88de22be Merge branch 'stable-2.10'
* stable-2.10:
  Inject InitStep members again before calling postRun.
  SSHD: Update to 0.13.0
  Bump SSHD Mina version to 2.0.8
  Bump Bouncycastle version to 1.51
  Update EncryptedContactStore to not use deprecated/removed methods

Change-Id: I7853def28109357e8629f1384f90d4630da00483
2014-11-11 10:28:39 -08:00
Shawn Pearce
8071a4f014 Merge branch 'stable-2.9' into stable-2.10
* stable-2.9:
  Inject InitStep members again before calling postRun.
  SSHD: Update to 0.13.0
  Bump SSHD Mina version to 2.0.8
  Bump Bouncycastle version to 1.51
  Update EncryptedContactStore to not use deprecated/removed methods

Change-Id: I4d67f79b9614289f222f9adcc8c513813ab3035c
2014-11-11 10:23:32 -08:00
Shawn Pearce
04ef5f717d Merge changes from topic 'sshd-upgrade' into stable-2.9
* changes:
  SSHD: Update to 0.13.0
  Bump SSHD Mina version to 2.0.8
  Bump Bouncycastle version to 1.51
  Update EncryptedContactStore to not use deprecated/removed methods
2014-11-11 18:20:54 +00:00
David Pursehouse
4ea945eb5e Convert ssh acceptance tests to use Google Truth
Change-Id: I6b087f877ae0004ca4e591c602df84b6bf1f6eb2
2014-11-11 19:04:56 +09:00