Commit Graph

1988 Commits

Author SHA1 Message Date
Matthias Sohn 43543e79a4 Update tycho version to 0.14.1
Tycho 0.14.1 enforces that artifactId and feature/bundle SymbolicName
must match, hence follow recommended migration practice and change
groupId of feature projects in order not to change the feature names as
this would require a feature migration.

Also migrate the p2 repository build from the deprecated packaging type
eclipse-update-site to packaging type eclipse-repository.

Change-Id: I99fc6c2bbb20efbd6514bdd9940f3535707c21bc
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-10 00:48:59 +02:00
Matthias Sohn c3709f4ef0 Update packaging project to build using Indigo platform
Change-Id: I4c07112a6723d90d3677761f5476af00ead58282
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-10 00:48:59 +02:00
Kevin Sawicki d72a459f93 Remove throws IOException declaration on filterClean
This method only creates an EolCanonicalizingInputStream
which does not throw an IOException and so the throws
declaration on the method is unneeded.

Change-Id: Icae8b80006c5e3ffcf3b69790a1a45c505be0f05
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-10 00:33:03 +02:00
Kevin Sawicki a9133e55a4 Add Object type to Comparable implements declaration
This removes unchecked warnings when a List of
AnyObjectId objects or any of its subclasses are
passed to Collections.sort such as in PackWriter

Change-Id: I806732cee24349c75c0357a655df55b070f2f213
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-10 00:32:47 +02:00
Kevin Sawicki e3335cfa6b Remove 4 unboxed warnings
Use Integer.intValue to explicitly convert to an int

Change-Id: I1135ed01af4e274b26d6b07d1a50f48ef0a30d91
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-10 00:32:27 +02:00
Kevin Sawicki 6ebc477c0b Make output stream optional in DiffCommand
Use the NullOutputStream.INSTANCE value when the
configured output stream is null or the command is
configured to only show name and status.

Also only set the context and prefix options if
formatting is actually being performed.

Bug: 377157
Change-Id: I333cfcc82ee746f3c6a8e94c09dcc803ffbb4b3a
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-05-10 00:19:04 +02:00
Kevin Sawicki c403d0b187 Compare modes before comparing ids in ResolveMerger
Comparing ids can be more expensive so do the cheap
mode check first and short circuit the id comparison
when modes are non-equal

Change-Id: I671eda51c74a411cc27de9d6077cc76e816ebe2b
2012-05-09 14:31:59 -07:00
Kevin Sawicki 17fb542e9e Remove 86 boxing warnings
Use Integer, Character, and Long valueOf methods when
passing parameters to MessageFormat and other places
that expect objects instead of primitives

Change-Id: I5942fbdbca6a378136c00d951ce61167f2366ca4
2012-05-08 21:42:53 -07:00
Kevin Sawicki e4effd25c5 Remove unnecessary boxing SuppressWarnings annotation
Change-Id: Id8a6d9f96860742f9094efdb4f31a952be7d3025
2012-05-08 20:42:19 -07:00
Kevin Sawicki 6f432673c1 Remove unneeded catch block and null checks
The catched exception was just rethrown and the
null check of the locked dir cache was unneeded if
the assignment was done outside the try block.

Change-Id: If2ee1f3eff3849f8da51eab825057fc56e166a94
2012-05-04 14:37:40 -07:00
Tomasz Zarna e5633ba2d3 Fix two typos in CLIText.properties
Change-Id: Id1429d52c88a9e2b888e6c6906cf8148945bd2ca
2012-05-02 11:35:13 +02:00
Matthias Sohn 92991aeee9 Merge "Update README regarding CRLF conversion, /etc and $HOME" 2012-04-30 16:07:38 -04:00
Robin Rosenberg bf41eb0aed Update README regarding CRLF conversion, /etc and $HOME
Change-Id: I3c41a8ee7f500e2c39df94eaf5d87c234934b741
2012-04-29 00:37:54 +02:00
Robin Rosenberg 42d7565ba9 Validate paths during DirCheckout
DirCacheCheckout and CanonicalTreeParser cooperate. CanonicalTreeParser
can detect malformed, potentially malicious tree entries and sets a
flag, while DirCacheCheckout refuses to work with such paths.

Malicious tree entries are ".", "..", ".git" (case insensitive), any
name containing '/' and (on Windows '\') and also (on Windows)
any paths ending in a combination of '.' or space or containing a ':'.
We also forbid all special names like "con" etc on Windows.

Some of the test can execute on any platform by enabling partial
platform emulation.

A new runtime exception, InvalidPathException, is introduced. For
backwards compatibility it extends InvalidArgumentException.

Change-Id: I86199105814b63d4340e5de0e471d0da6b579ead
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-04-23 22:37:50 +02:00
Robin Rosenberg 9c5b31703f Enable large file support
Allow adding files with size over 2 GB. The drawback is that the tests
for huge file support adds roughly 10 minutes of execution time.
For that reason we @Ignore the test in the standard test execution.

Change-Id: I5788e8009899203b346f353297166825b3744575
2012-04-18 21:59:15 +02:00
Tomasz Zarna a2dac2c78d Allow to write tests with CLI syntax
CQ: 6385
Bug: 365444
Change-Id: I2d5164cd92429673fe3c37e9f5f9bc565192cc12
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-04-18 18:57:36 +02:00
Robin Rosenberg 95ed300b04 Enable DirCacheEntry's copyMetaData to not copy stage info
When there is a conflict sometimes we did not set the stage of
the conflict entries properly for the STAGE_1 entry.

Change-Id: I1c28ff6251fdbc95f7c40fc3e401f1b41157a9f6
2012-04-17 09:51:03 +02:00
Christian Halstrick dd1e66e1d7 Merge "Fix tests for Ant task "git-clone"" 2012-04-17 03:38:12 -04:00
Robin Rosenberg bf33a6eeed Hide two warnings about boxing
Change-Id: I1cb7cdb81481019f4a55221d38d771fcc9451529
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-04-16 23:34:47 +02:00
Robin Rosenberg 0e8f3a6234 Fix constructor for SafeBufferedOutputStream
The size shoould be passed to BufferedOutputStream's constructor.
All callers seem to use the default, but that could change.

Change-Id: I874afee6a9114698805e36813781547e6aa328a5
2012-04-14 12:26:34 +02:00
Robin Rosenberg 32be70d209 Merge "UnsupportedCredentialItem with password authentication" 2012-04-09 10:40:28 -04:00
Robin Rosenberg 2047eaa4c2 UnsupportedCredentialItem with password authentication
If the server prompts for password, it comes as a StringType prompt.

Bug: 360862
Change-Id: Ic758456c21c8d68d1b3d7f56228beb7535b11735
2012-04-09 16:34:40 +02:00
Robin Rosenberg e951b407fa Merge "Fix broken TagCommand API" 2012-04-06 05:34:00 -04:00
Matthias Sohn fcacfdeaf7 Merge "Cleanup possiblyFilteredInputStream() in WorkingTreeIterator" 2012-04-05 20:32:03 -04:00
Robin Rosenberg b7e881e625 Merge "Handle content length in WorkingTreeIterator" 2012-04-05 19:29:08 -04:00
Robin Rosenberg fd53b454f2 Fix broken TagCommand API
Tags can be un-annotated whereby there is no RevTag object, only
a ref pointing to the tagged object.

Bug: 360650
Change-Id: I06309c45c0a896fe2a0a874700febf78c9fb87e8
2012-04-06 00:52:20 +02:00
Robin Rosenberg 8f9c4ee41d Cleanup possiblyFilteredInputStream() in WorkingTreeIterator
Use early return instead of nested if/else

Change-Id: I3b5048f9f5cfdfd01f916af550722532db3f9bb3
2012-04-06 00:26:06 +02:00
Matthias Sohn 6a1a80aa4c Merge "Recurse into cloned submodules" 2012-04-03 18:42:03 -04:00
Jens Baumgart 0a84ad2d2a Unlock DirCache in case of occurring exception
A DirCache was not unlocked if an exception occurred in the
DirCacheCheckout constructor.

Bug: 365449
Change-Id: I231d902d52e3e5e9a7748eedaa63a2bb889ebb13
Signed-off-by: Jens Baumgart <jens.baumgart@sap.com>
2012-04-03 17:25:32 +02:00
Robin Rosenberg 86db05602f Merge "Index config section and subsection names in one pass" 2012-04-02 17:59:34 -04:00
Robin Rosenberg 159533c4cf Merge "Add @Override annotations to enums" 2012-04-02 17:53:07 -04:00
Matthias Sohn 1b73db77ef Merge "Externalize parsing exception message for RebaseCommand#Action" 2012-04-02 16:02:39 -04:00
Shawn O. Pearce c0b1443926 Index config section and subsection names in one pass
Instead of indexing the subsection names on each request for a given
section name, index both the section and subsection names in a single
scan through the entry list. This should improve lookup time for
reading the section names out of the configuration, especially for the
url.*.insteadof type of processing performed in RemoteConfig.

Change-Id: I7b3269565b1308f69d20dc3f3fe917aea00f8a73
2012-04-02 11:44:45 -07:00
Tomasz Zarna 622232b936 Externalize parsing exception message for RebaseCommand#Action
Change-Id: Id0d7801e4de98bf118dbecadf623c9ffd7ab7554
2012-04-02 11:36:29 +02:00
Tomasz Zarna 4e1de30809 Add @Override annotations to enums
Change-Id: I8fa3b89a6349c1231251b346cae12c1c4f095929
2012-04-02 11:24:05 +02:00
Markus Duft 2ba67bedae Don't use java.nio channel for file size determination
Java NIO has some problems (like files closing unexpectedly because the
thread was interrupted). To avoid those problems, don't use a NIO
channel to determine the size of a file, but rather ask the File itself.

We have to be prepared to handle wrong/outdated information in this case
too, as the inode of the File may change between opening and determining
file size.

Change-Id: Ic7aa6c3337480879efcce4a3058b548cd0e2cef0
2012-04-02 07:27:25 +02:00
Kevin Sawicki 543c5238ae Recurse into cloned submodules
Iterate over all successfully cloned submodules recursively
and continue initializing and updating until no more are found.

Bug: 375426
Change-Id: Ifb99e41e2deb0c369442bca3c0f5f072dd006816
2012-04-01 18:36:42 -07:00
Matthias Sohn ee90d6afba Fix tests for Ant task "git-clone"
If project.init() isn't called GitCloneTaskTest fails when started from
Eclipse, according to [1] calling init() is necessary to properly
initialize the Ant project programmatically.

Always set the destination folder in order to ensure that all test
resources are created under the project's target folder and do not
pollute the project's source tree with test data.

[1]
http://ant.1045680.n5.nabble.com/project-createTask-not-working-with-ant-1-8-2-td3385716.html

Change-Id: Icbeb62680b018a92673faa58828b5e850564c7a8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-04-02 01:20:31 +02:00
Robin Rosenberg 6189a68d1d Merge changes Ic8907231,I693148a5
* changes:
  Sort Config entries and use O(log N) lookup
  Extract inner classes from Config
2012-03-30 12:25:47 -04:00
Shawn O. Pearce 6c0d300a54 Fix loading packed objects >2G
Parsing the size from a packed object header was incorrectly computing
the total inflated length when the length exceeded the range of a Java
int. The next 7 bits of size information was shifted left as an int
using a shift of 25 bits, placing the higher bits of the size into the
sign position. When this size was extended to a long to be added to
the current size accumulator the size went negative, resulting in
NegativeArraySizeException being thrown.

Fix all places where this particular pattern of code is used to read a
pack size field, or a binary delta header, as they both use the same
variable length encoding scheme.

Change-Id: I04008728ed828f18202652c3d5401cf95a441d0a
2012-03-28 10:36:51 -04:00
Shawn O. Pearce 552682dc6a Sort Config entries and use O(log N) lookup
Decrease running time for getStringList (and all other get methods) by
looking for configuration entries using binary search rather than
linear search through the configuration file.

Configuration lines are sorted by section, subsection, name in a
sorted list whenever the snapshot is rebuilt. Binary search is used to
locate an index in the middle of the values, then walk backwards to
find the first value in the range.

Given a configuration of file of 5000 distinct section/subsection/name
triplets (e.g. a Gerrit Code Review project.config configuration file
with 5000 unique access control rules), this new code is faster to
lookup each rule individually using getStringList():

  old setStringList() 194 usec avg
      getStringList() 196 usec avg

  new setStringList() 188 usec avg
      getStringList()  24 usec avg

Change-Id: Ic8907231868c18eb946b72f341a6b58666b70324
2012-03-27 14:23:36 -04:00
Shawn O. Pearce 581e6ca2fe Extract inner classes from Config
The Config class is getting very large. Extract two of its inner
classes into new top level types to reduce the size of Config.
Rename them slightly in the process.

Change-Id: I693148a5ae2977378789bf455c880a6fd856c0f0
2012-03-27 10:43:02 -04:00
Robin Rosenberg 3f4725c179 Handle content length in WorkingTreeIterator
Content length is computed and cached (short term) in the working
tree iterator when core.autocrlf is set.

Hopefully this is a cleaner fix than my previous attempt to make
autocrlf work.

Change-Id: I1b6bbb643101a00db94e5514b5e2b069f338907a
2012-03-27 00:47:17 +02:00
Dave Borowitz 55bf06b43d Allow RepositoryResolver to throw ServiceMayNotContinueException
Implementations may want to send an error message to the user, which
doesn't really fit with any of the existing exception types.
ServiceMayNotContinueException, on the other hand, is documented as
always containing a user-visible error string, so use that.

Modify the git and HTTP transport mechanisms to properly relay this
message to the end user.

Change-Id: I362e67ea46102a145bf2c6284d38788537c9735f
2012-03-26 10:19:40 -07:00
Dave Borowitz d794a4fde3 Clarify documentation of exceptions in RepositoryResolver
Change-Id: Idf805f76f24bfa1f3552366197e0ed4e45cb2b74
2012-03-26 09:53:32 -07:00
Dave Borowitz e0531ace35 Properly parse first line in ReceivePack with no '\0'
Change-Id: Ic98e17aff4e4b3c3fa0359082bab689e4522e3d7
2012-03-23 14:38:06 -07:00
Matthias Sohn 9dd6e6cd29 Revert "Allow to write tests with CLI syntax"
This reverts commit bf845c126d since this
change needs to go through a formal IP review and Chris missed to file a
CQ for that.

Change-Id: I303515d78116f0591a2911dbfb9f857738f086a9
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-03-23 00:30:46 +01:00
Christian Halstrick 473139bbf6 Merge "Allow to write tests with CLI syntax" 2012-03-22 07:39:14 -04:00
Tomasz Zarna bf845c126d Allow to write tests with CLI syntax
Bug: 365444
Change-Id: I86f382913bc47665c5b9a2827b878e7dbedce7b1
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
2012-03-22 11:29:18 +01:00
Kevin Sawicki b37b7e69cd Add command support for dropping a stashed commit
This extracts the logic for writing to the reflog from
RefDirectory into a new ReflogWriter class.  This class
creates a public API for writing reflog entries similar
to ReflogReader for reading reflog entries.

The new command supports rewriting the stash's log to remove
a configured entry followed by updating the stash ref to
the value at the bottom of the newly written log.

Change-Id: Icfcbc70e838666769a742a94196eb8dc9c7efcc7
Signed-off-by: Chris Aniszczyk <zx@twitter.com>
2012-03-21 14:16:14 -07:00