Commit Graph

2444 Commits

Author SHA1 Message Date
Colby Ranger 154e3c886b Do not enforce DeltaWindow maxMemory when zero.
The maxMemory for a DeltaWindow can be optionally disabled when it is
less than or equal to zero. Respect this configuration when enforcing
the limits on object load.

Change-Id: Ic0f4ffcabf82105f8e690bd0eb5e6be485a313b3
2012-12-27 11:22:35 -08:00
Colby Ranger 5a3d35e9e2 Merge "Enforce max memory for DeltaWindow." 2012-12-27 12:33:13 -05:00
Colby Ranger 51beee5568 Enforce max memory for DeltaWindow.
Previously, memory limits were enforced at the start of each iteration
of the delta search, based on objects that were currently loaded in
memory. However, new objects added to the window may be expanded in a
future iteration of the search and thus were not accounted for correctly
at the start of the search. To fix this, memory limits are now enforced
before each object is loaded.

Change-Id: I898ab43e7bf5ee7189831f3a68bb9385ae694b8f
2012-12-27 09:23:30 -08:00
Robin Rosenberg 7314b6c2c0 Make jgit diff obey core.autocrlf
Change-Id: I0a756943d95ee20f189c154b27cd2972a116f550
2012-12-27 12:22:14 -05:00
Robin Rosenberg f71944ec76 Hide deprecation warnings in some test classes
These test classes heavily rely on Tree and associated classes. They
are convenient for building test cases and hence not yet replaced, but
there is a deprecation warning at about every line, which is not helpful.

Change-Id: Ia7cc8f3bb980dc03055b94748b6c7529a82ea5a5
2012-12-27 12:09:01 -05:00
Robin Rosenberg a57dd1c164 Declare essentially static methods as static
Change-Id: I83ca25fb569c0dbc36eb374d5437fcf2b65a6f68
2012-12-27 12:08:06 -05:00
Robin Rosenberg 04bc9b3ddc Add type argumente to some raw reclaration
Change-Id: Ief195fb5c55f75172f0428fdac8c8874292ae566
2012-12-27 11:57:34 -05:00
Robin Rosenberg 92893d1f92 Do not perform character translation on copies in patches
Translation is unnecessary and risks damaging the file. Also
ensure that we close the file if an I/O error occurs.

Change-Id: Ieae6eb941fdeaa61f2611f4cd14dd39117aa12f9
2012-12-27 17:29:13 +01:00
Robin Rosenberg c310fa0c80 Mark non-externalizable strings as such
A few classes such as Constanrs are marked with @SuppressWarnings, as are
toString() methods with many liternal, but otherwise $NLS-n$ is used for
string containing text that should not be translated. A few literals may
fall into the gray zone, but mostly I've tried to only tag the obvious
ones.

Change-Id: I22e50a77e2bf9e0b842a66bdf674e8fa1692f590
2012-12-27 16:57:38 +01:00
Tomasz Zarna 03d50dc50b Add org.eclipse.jgit.pgm.Reset to commands catalog
Change-Id: I7acfd051a07be889b27cfcfc1f396d86a9f86ab2
Signed-off-by: Tomasz Zarna <tzarna@gmail.com>
2012-12-22 13:01:22 +01:00
Matthias Sohn 706f8eb9fc Prepare 2.3.0 builds
Change-Id: I0ca539e8cfe444f96c64dc56d1f0ef33b66e0cff
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-21 00:48:45 +01:00
Matthias Sohn 60035eb249 Merge branch 'stable-2.2'
* stable-2.2:
  Prepare post 2.2.0.201212191850-r builds
  JGit v2.2.0.201212191850-r

Change-Id: Iebe7c45eacb8abee21d1900e27143ccaa2724e28
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-21 00:36:24 +01:00
Matthias Sohn 2d78a8da97 Prepare post 2.2.0.201212191850-r builds
Change-Id: I1a0fe51c71551fcfc98f5dd435eb283fd661b77a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-21 00:31:26 +01:00
Matthias Sohn aa357c2a9f JGit v2.2.0.201212191850-r
Change-Id: Idc49f17d03886b6a1e61a94ff81e32625c8675d9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-20 00:59:41 +01:00
Robin Rosenberg f4e8964e1f Merge remote-tracking branch 'gerrit/stable-2.2'
* gerrit/stable-2.2:
  Ensure that jgit p2 repository is self-contained
  Fix hidden field warning
  Fix empty control block warnings

Change-Id: Ifa0751be7db9401081a1a5c28a0102a2d0c692f9
2012-12-16 13:39:18 +01:00
Matthias Sohn 903ba8b8fd Ensure that jgit p2 repository is self-contained
Add a new feature for the 3rd party dependencies jgit needs and include
this in org.eclipse.jgit.feature. This ensures that the jgit p2
repository is self-contained and downstream consumers don't need to find
the dependencies elsewhere. We don't add the jetty dependencies needed
to install the test feature org.eclipse.jgit.junit since this is only
used by egit tests.

Change-Id: I60425c746cd50f1875ef8597a8bbefb598b8c982
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-16 00:58:05 +01:00
Robin Rosenberg 3f7909b6cb Merge "Fix hidden field warning" into stable-2.2 2012-12-15 08:10:09 -05:00
Robin Rosenberg 3154f3c5bb Merge "Fix empty control block warnings" into stable-2.2 2012-12-15 08:09:14 -05:00
Robin Rosenberg fbdf76d1cc Merge branch 'stable-2.2'
* stable-2.2:
  DirCacheIterator: Fix reset() and back()
  Cleanup unused import and Java 6 syntax in Archive

Change-Id: Icc59b28a4066c4781ea8d6270dfe20eb63b4185e
2012-12-15 11:26:55 +01:00
Robin Rosenberg af54f16635 DirCacheIterator: Fix reset() and back()
reset() was broken and probably only worked when the position was
at the beginning. More serious was that back() sometimes descended
into the tree rather than skipping backward at the same level. Sometimes
this would result in false conflicts, but one could suspect silent
errors too. back() is called by the NamingConflictTreeWalk when looking
for directory/file conflicts.

Also added toString to DirCacheTree to simplify debugging.

Bug: 396127
Change-Id: Iaa1b4e20e623d84c2e5ac26748f42e991080dbcd
2012-12-15 11:00:55 +01:00
Matthias Sohn bf0dc41362 Fix hidden field warning
Change-Id: Ic52527c32f8167db3c7bb7fa0297c86fee21da27
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-12 08:32:33 +01:00
Matthias Sohn 7b1d7ac90e Fix empty control block warnings
Change-Id: I7c546fa89f5e1933cff6648b2e03e07db61273e8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-12 08:31:45 +01:00
Robin Rosenberg 138a2b06c8 Cleanup unused import and Java 6 syntax in Archive
@Override for implementation of interface is Java 6. JGit's execution
environment is still Java 5.

Change-Id: I48d10b3bf81a60938da86e026053b2f3d5e24ad3
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-12-12 08:30:17 +01:00
Shawn Pearce 20e3779e10 Disable response compression on /git-receive-pack URLs
Compressing the response with gzip causes the stream to delay
flushing until gzip has seen the entire response message, or buffers
fill up and the compressed data has to be sent. This hides the
resolving progress monitor from the client, as well as any other
progress messages the server might be trying to send.

Disable compression in receive, matching what /git-upload-pack has.

Change-Id: Ic8d8abe1f43c3f540d1ee7c43a8947a555307d94
2012-12-07 12:28:36 -08:00
Shawn Pearce 76830dff4c Merge "archive: Add tar support" 2012-12-05 20:13:14 -05:00
Shawn Pearce c9a8844586 Merge "archive: Add --format option that switches between formats" 2012-12-05 20:11:25 -05:00
Shawn Pearce 7096f6f8ba Merge "archive: Record executable and symlink bits" 2012-12-05 20:10:02 -05:00
Matthias Sohn 8d062dec0c [findBugs] Don't pass null for non-null parameter in RebaseCommand
Change-Id: Iee4d50aa9c6b75f9906d2c51a940ddc90a944192
2012-12-05 18:16:57 -05:00
Jonathan Nieder 78009782cd archive: Add tar support
Unlike ZIP files, tar files do not treat symlinks as ordinary files
with a different mode, so tar support involves a little more code than
would be ideal.

Change-Id: Ica2568f4a0e443bf4b955ef0c029bc8eec62d369
2012-12-04 15:37:42 -08:00
Jonathan Nieder 345ab401ce archive: Add --format option that switches between formats
Prepare for .tar support.

Change-Id: Ieb07702da1a54b41ae764fbb425f70826907b593
Improved-by: Shawn O. Pearce <spearce@spearce.org>
2012-12-04 15:36:32 -08:00
Jonathan Nieder 7123cbf470 archive: Record executable and symlink bits
Setting the mode for a zip entry is now as simple as
"entry.setUnixMode(mode)", so do that.

The test checks using the system's "zipinfo" command (from InfoZIP)
that the mode has been recorded correctly on systems that happen to
have a "zipinfo" command, using org.junit.Assume to distinguish them.

Change-Id: I4236c102fd76f18d01b2dc926eeb9b9fa11a61b7
2012-12-04 15:34:07 -08:00
Shawn Pearce 72ee3280e0 Merge "[RFC] archive: Switch to commons-compress as ZIP archiver" 2012-12-04 18:28:20 -05:00
Shawn Pearce e9a1df6c56 Merge "Commit message may not necessarily be in UTF-8" 2012-12-04 10:00:30 -05:00
Colby Ranger b9e485661d Fix DeltaWindow.clear() to release loaded buffer bytes.
It is possible for the buffer to be set but not the index. It
ocurrs when an exception occurs during creating an index, but
after the buffer is loaded. Furthermore, the cleared DeltaWindowEntry
should have been ent and not res.

Change-Id: I2e0d79540316635bf7aa43efd225e4eb38230844
2012-12-03 12:46:53 -08:00
Jonathan Nieder 1547eaf7c5 [RFC] archive: Switch to commons-compress as ZIP archiver
The Apache Commons Compress library provides a similar interface to
java.util.zip with some features not found in java.util.zip, including
support for inclusion of metadata (file mode and symlink targets) and
support for multiple file formats (zip, .tar.xz, etc).

Use it, in preparation for making use of these features.  No
functional change intended yet.

A previous version of this patch used plexus-archiver.  That is a
heavier-weight dependency and offers a less convenient interface.

Thanks to James Moger and Chris Aniszczyk for advice.

Change-Id: Id01146950bb9c18dae0169311e3cde2c3bfa675e
2012-12-03 10:49:06 -08:00
Robin Stocker 4213a91c97 Enable reuse of FileTreeIterator and FileEntry for non subclasses
For EGit change I2c41d86b8b74c2a334433de1bbfed5b36af872bf,
ContainerTreeIterator also needs to create entries for File objects in
case of filtered resources. Instead of reimplementing FileEntry there,
make the constructor public so that it can be reused.

Also allow to pass a WorkingTreeIterator instead of a FileTreeIterator
in FileTreeIterator's constructor, which is enough and allows to pass
other subclasses.

Bug: 358901
Change-Id: Ie0f9c9434ef7d73a8d73d4fe46db4147ded1d267
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-12-03 11:26:39 -06:00
Chris Aniszczyk 55e8f2a433 Merge "Support --cached in RmCommand" 2012-12-03 11:56:12 -05:00
Robin Stocker beb16cec26 Support --cached in RmCommand
Also extend documentation and add examples.

Bug: 395599
Change-Id: Id1ddbc9da787472f82e58834092bc073224b262b
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-12-03 10:40:54 -06:00
Jonathan Nieder c9a857a60a Add basic "jgit add" tests
Change-Id: I056c2556c7db98bf57e2527dec11af7c3daf472a
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-11-29 16:38:07 -08:00
Jonathan Nieder b46b27e389 add: Fix bad metaVar reference in <filepattern> help
Without this patch, "jgit add --help" throws two exceptions
(NoSuchFieldException: metavar_filepattern; MissingResourceException:
Can't find resource for bundle java.util.PropertyResourceBundle, key
metavar_filepattern) instead of printing a usage message, due to a
small typo and a missing declaration.

Change-Id: I4b848b3a8c7b1a49d8b9582809375daa4aca6b50
2012-11-28 17:48:25 -08:00
Robin Rosenberg 257f3fe4a1 Commit message may not necessarily be in UTF-8
Trying different encoding makes presentation nicer
to user.

Change-Id: I2d2c2a95d0b5cd709855d7a67cbc247478434d2f
2012-11-27 08:34:40 +01:00
Chris Aniszczyk 3537f3cc2d Merge "Do not warn about non-translated strings in the ant library" 2012-11-25 15:46:42 -05:00
Chris Aniszczyk c3aecadd1d Merge "Do not warn about non-translated strings in the iplog generator" 2012-11-25 15:46:31 -05:00
Chris Aniszczyk 9fffa19ca2 Merge "Do not warn about non-translated strings in the http library" 2012-11-25 15:46:16 -05:00
Robin Rosenberg 8b06c46e30 Add a case statement for fast-forward merge
This case was ommitted. Treat the same as a non-fastworwad
merge.

Change-Id: Ia81e2430dfe04c3ce9b6e2f8fb4b6c646293a174
2012-11-25 21:11:28 +01:00
Robin Rosenberg efdfd1babf Do not warn about non-translated strings in the ant library
Ant tasks are generally not translated, hence don't warn about
untranslated strings

Change-Id: I60920ccdaf3c0139979bb4ef19eb42036bb7e07f
2012-11-25 17:20:27 +01:00
Robin Rosenberg 0791a9c3e7 Do not warn about non-translated strings in the iplog generator
This module is used by very few people so translation is not a priority
and hence we need no warnings about untranslated strings.

Change-Id: I11be2e9903583d1a3dade7bf3d5eb77a30152b7c
2012-11-25 17:20:23 +01:00
Robin Rosenberg e365265ad7 Do not warn about non-translated strings in the http library
The strings here are for machine-to-machine communications.

Change-Id: Ia0d19fce3d9843d18d329d9bc5b10d62c4125db8
2012-11-25 17:20:17 +01:00
Marc Strapetz 67edd3eda7 RevWalk support for shallow clones
StartGenerator now processes .git/shallow to have the
RevWalk stop for shallow commits.

See RevWalkShallowTest for tests.

Bug: 394543
CQ: 6908
Change-Id: Ia5af1dab3fe9c7888f44eeecab1e1bcf2e8e48fe
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-11-21 10:46:02 -06:00
Dariusz Luksza 8eb4d92637 Add support for rebase interactive 'edit' command
The 'edit' command allows you to change arbitrary commit
content and the message of any commit in the repository.

Bug: 394577
Change-Id: I43a44782cdb10b29f13784fa75ab37fe5d4da01b
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-11-19 10:02:25 -06:00