Update to JGit 0.8.4.378-g2aa4196

This fixes a bug in the path quoting in the patch cache, which caused
"@2" in a filename to disappear in the web UI.

We can also now take advantage of DiffFormatter's ability to
do rename detection for us, as well as configure the streaming
threshold from gerrit.config (via the WindowCache).

Bug: issue 706
Change-Id: Id45676bdeb5a73035472ea5e27c2c4ec94d4b9dc
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce 2010-09-03 15:44:23 -07:00
parent c9ef5e4db2
commit 329fe79e4e
3 changed files with 25 additions and 7 deletions

View File

@ -578,6 +578,27 @@ repository data manipulation.
+
Default on JGit is 128 file descriptors on all platforms.
[[core.streamFileThreshold]]core.streamFileThreshold::
+
Largest object size, in bytes, that JGit will allocate as a
contiguous byte array. Any file revision larger than this threshold
will have to be streamed, typically requiring the use of temporary
files under '$GIT_DIR/objects' to implement psuedo-random access
during delta decompression.
+
Servers with very high traffic should set this to be larger than
the size of their common big files. For example a server managing
the Android platform typically has to deal with ~10-12 MiB XML
files, so `15 m` would be a reasonable setting in that environment.
Setting this too high may cause the JVM to run out of heap space
when handling very big binary files, such as device firmware or
CD-ROM ISO images.
+
Default is 5 MiB on all platforms. Prior to Gerrit 2.1.6,
this value was effectively 2047 MiB.
+
Common unit suffixes of 'k', 'm', or 'g' are supported.
[[core.packedGitMmap]]core.packedGitMmap::
+
When true, JGit will use `mmap()` rather than `malloc()+read()`

View File

@ -87,7 +87,6 @@ import org.eclipse.jgit.diff.RawText;
import org.eclipse.jgit.diff.RawTextIgnoreAllWhitespace;
import org.eclipse.jgit.diff.RawTextIgnoreTrailingWhitespace;
import org.eclipse.jgit.diff.RawTextIgnoreWhitespaceChange;
import org.eclipse.jgit.diff.RenameDetector;
import org.eclipse.jgit.diff.ReplaceEdit;
import org.eclipse.jgit.errors.MissingObjectException;
import org.eclipse.jgit.lib.Config;
@ -247,17 +246,15 @@ public class PatchListCacheImpl implements PatchListCache {
DiffFormatter df = new DiffFormatter(DisabledOutputStream.INSTANCE);
df.setRepository(repo);
df.setRawTextFactory(rawTextFactory);
RenameDetector rd = new RenameDetector(repo);
rd.addAll(DiffEntry.scan(walk));
List<DiffEntry> diffEntries = rd.compute();
df.setDetectRenames(true);
List<DiffEntry> diffEntries = df.scan(aTree, bTree);
final int cnt = diffEntries.size();
final PatchListEntry[] entries = new PatchListEntry[1 + cnt];
entries[0] = newCommitMessage(rawTextFactory, repo, reader, //
againstParent ? null : aCommit, b);
for (int i = 0; i < cnt; i++) {
FileHeader fh = df.createFileHeader(diffEntries.get(i));
FileHeader fh = df.toFileHeader(diffEntries.get(i));
entries[1 + i] = newEntry(reader, aTree, bTree, fh);
}
return new PatchList(a, b, computeIntraline, againstParent, entries);

View File

@ -46,7 +46,7 @@ limitations under the License.
</issueManagement>
<properties>
<jgitVersion>0.8.4.329-g9239c10</jgitVersion>
<jgitVersion>0.8.4.378-g2aa4196</jgitVersion>
<gwtormVersion>1.1.4</gwtormVersion>
<gwtjsonrpcVersion>1.2.2</gwtjsonrpcVersion>
<gwtexpuiVersion>1.2.2</gwtexpuiVersion>