aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk
Commit message (Collapse)AuthorAgeFilesLines
* Enable loading history until a given commitMatthias Sohn2012-05-211-0/+140
| | | | | | | This is needed to allow jumping to a selected commit when loading history incrementally. Change-Id: Id3b97d88d3b4b2d67561b11f8810cb88fe040823 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Add RevWalkUtils with count(start, end) methodRobin Stocker2012-01-161-0/+103
| | | | | | | | It returns the number of commits that are in start and not in end. Useful for calculating how much a branch is ahead of another one. Change-Id: I09f7d9b049beea417da7ff32c9f8bf0d4ed46a7f Signed-off-by: Robin Stocker <robin@nibor.org> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Skip a number commits before starting to show the commit outputTomasz Zarna2012-01-021-0/+84
| | | | Change-Id: Id2666d897d29b6371f7a6cf241cfda02964b4971 Signed-off-by: Kevin Sawicki <kevin@github.com>
* Limit the number of commits in LogCommand outputTomasz Zarna2011-12-231-0/+84
| | | | | Bug: 316680 Change-Id: I88cf7aac6b5763cc94421433dd4bbd42f81e0e69
* Allow detecting which files were renamed during a revwalkCarsten Pfeiffer2011-10-252-0/+179
| | | | | | | | | | | | The egit history view shows the files associated with a commit by using a PathFilter. When following renames with a FollowFilter, the PathFilter cannot be configured anymore because the affected files are simply not known. Thus, it should be possible to get to know which files are renamed. Bug: 302549 Change-Id: I4761e9f5cfb4f0ef0b0e1e38991401a1d5003bea
* Fix IndexOutOfBoundsException when parsing PersonIdentMarc Strapetz2011-06-141-0/+15
| | | | | | IndexOutOfBoundsException could occur when parsing PersonIdent for which no name is present, as part of a RevCommit (nameB > 0).
* RevWalk: Avoid unnecessary re-parsing of commit bodiesShawn O. Pearce2011-02-132-0/+9
| | | | | | | | | | | | If the RevFilter doesn't actually require the commit body, we shouldn't reparse it if the body was disposed. This happens often inside of UploadPack during common ancestor negotation, the RevWalk is reset and re-run over roughly the same commit space, but the bodies are discarded because the commit message is not relevant to the process. Change-Id: I87b6b6a5fb269669867047698abf718d366bd002 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Parse RevCommit bodies before calling RevFilter.include()Jesse Greenwald2011-01-251-0/+117
| | | | | | | | | | RevFilter.include()'s documentation promises the RevCommit's body is parsed before include is invoked. This wasn't always true if the commit was parsed once, had its body discarded, the RevWalk was reset() and started a new traversal. Change-Id: Ie5cafde09ae870712b165d8a97a2c9daf90b1dbd Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Convert all JGit unit tests to JUnit 4Robin Rosenberg2010-12-3118-0/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | Eclipse has some problem re-running single JUnit tests if the tests are in Junit 3 format, but the JUnit 4 launcher is used. This was quite unnecessary and the move was not completed. We still have no JUnit4 test. This completes the extermination of JUnit3. Most of the work was global searce/replace using regular expression, followed by numerous invocarions of quick-fix and organize imports and verification that we had the same number of tests before and after. - Annotations were introduced. - All references to JUnit3 classes removed - Half-good replacement for getting the test name. This was needed to make the TestRngs work. The initialization of TestRngs was also made lazily since we can not longer find out the test name in runtime in the @Before methods. - Renamed test classes to end with Test, with the exception of TestTranslateBundle, which fails from Maven - Moved JGitTestUtil to the junit support bundle Change-Id: Iddcd3da6ca927a7be773a9c63ebf8bb2147e2d13 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Correct CommitBuilder, TagBuilder method to be build()Shawn O. Pearce2010-12-032-2/+2
| | | | | | | | | | The correct names for these is build(), as that is what a Java developer will expect given the "builder" pattern. Bug: 323541 Change-Id: I35042bdc95a955beeaee29e54bde10e4240b2a71 Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Reviewed-by: Chris Aniszczyk <caniszczyk@gmail.com>
* Fix parsing of multiple authors in PersonIdent.Marc Strapetz2010-08-261-2/+13
| | | | | | | | | PersonIdent should be parsable for an invalid commit which contains multiple authors, like "A <a@a.org>, B <b@b.org>". PersonIdent(String) constructor now delegates to RawParseUtils.parsePersonIdent(). Change-Id: Ie9798d36d9ecfcc0094ca795f5a44b003136eaf7
* Delete deprecated ObjectWriterShawn O. Pearce2010-08-231-6/+12
| | | | | | | | ObjectWriter is a deprecated API that people shouldn't be using. So get rid of it in favor of the ObjectInserter API. Change-Id: I6218bcb26b6b9ffb64e3e470dba5dca2e0a62fd4 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Move commit and tag formatting to CommitBuilder, TagBuilderShawn O. Pearce2010-08-232-2/+2
| | | | | | | | | | | | These objects should be responsible for their own formatting, rather than delegating it to some obtuse type called ObjectInserter. While we are at it, simplify the way we insert these into a database. Passing in the type and calling format in application code turned out to be a huge mistake in terms of ease-of-use of the insert API. Change-Id: Id5bb95ee56aa2a002243e9b7853b84ec8df1d7bf Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Rename Commit, Tag to CommitBuilder, TagBuilderShawn O. Pearce2010-08-232-4/+4
| | | | | | | | | Since these types no longer support reading, calling them a Builder is a better description of what they do. They help the caller to build a commit or a tag object. Change-Id: I53cae5a800a66ea1721b0fe5e702599df31da05d Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Add a public RevTag.parse() methodShawn O. Pearce2010-08-201-0/+20
| | | | | | | | | | Callers might have a canonical tag encoding on hand that they wish to convert into a clean structure for presentation purposes, and the object may not be available in a repository. (E.g. maybe its a "draft" tag being written in an editor.) Change-Id: I387a462afb70754aa7ee20891e6c0262438fdf32 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Add a public RevCommit.parse() methodShawn O. Pearce2010-08-201-0/+21
| | | | | | | | | | Callers might have a canonical commit encoding on hand that they wish to convert into a clean structure for presentation purposes, and the object may not be available in a repository. (E.g. maybe its a "draft" commit being written in an editor.) Change-Id: I21759cff337cbbb34dbdde91aec5aa4448a1ef37 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Remove unnecessary ObjectId.copy() callsShawn O. Pearce2010-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | When RevObject overrode equals() to provide only reference equality we used to need to convert a RevObject into an ObjectId by copy() just to use standard Java tools like JUnit assertEquals(), or to use contains() or get() on standard java.util collection types. Now that we have removed this override and made ObjectId's equals() final (preventing any of this mess in the future), some copy() calls are unnecessary. Anytime the value is being used as an input to a lookup routine, or to an equals, we can avoid the copy(). However we still want to use copy() anytime we are given an ObjectId that may exist long-term, where we don't want the high cost of the additional storage from a RevCommit extension. So we can't remove all uses of copy(), just some of them. Change-Id: Ief275dace435c0ddfa362ac8e5d93558bc7e9fc3 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Backout RevObject's object-identity based equals implementationMatthias Sohn2010-08-151-5/+5
| | | | | | | | | | | | | | This restores the transitivity and symmetry properties of the equals methods on the AnyObjectId type hierarchy as defined in [1]. Following [2] we declare these equals methods final to ensure that semantics of equals are consistent across AnyObjectId's type hierarchy. [1] http://download-llnw.oracle.com/javase/6/docs/api/java/lang/Object.html#equals(java.lang.Object) [2] http://www.angelikalanger.com/Articles/JavaSolutions/SecretsOfEquals/Equals.html Bug: 321502 Change-Id: Ibace21fa268c4aa15da6c65d42eb705ab1aa24b3 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Use FileRepository where we assume other file semanticsShawn O. Pearce2010-06-251-2/+3
| | | | | | | | | | | When the surrounding code is already heavily based upon the assumption that we have a FileRepository (e.g. because it created that type of repository) keep the type around and use it directly. This permits us to continue to do things like save the configuration file. Change-Id: Ib783f0f6a11acd6aa305c16d61ccc368b46beecc Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Fix FooterLine.matches(FooterKey) on same length keysShawn O. Pearce2010-05-041-0/+20
| | | | | | | | | | | | | | If two keys are the same length, but don't share the same sequence of characters, we were incorrectly claiming they still matched due to a bug in the for loop condition. I used the wrong variable and the loop never executed, resulting in equality anytime the two keys being compared were the same length. Use the proper local variable to loop through the arrays, and add a JUnit test to verify equality works as expected. Change-Id: I4a02400e65a9b2e0da925b05a2cc4b579e1dd33a Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Fix ObjectWalk corruption when skipping over empty treesShawn O. Pearce2010-02-021-0/+44
| | | | | | | | | | | | | | | | | | | The supplied test case comes out of the example tree identified by Robert de Wilde and Ilari on #git: $ git ls-tree -rt a54f1a85ebf6a7f53aa60a45a1be33f8b078fb7e 040000 tree bfe058ad536cdb12e127cde63b01472c960ea105 A 040000 tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 A/A 040000 tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 A/B 100644 blob abbbfafe3129f85747aba7bfac992af77134c607 B In this tree, "B" was being skipped because "A/A" as an empty tree was immediately followed by "A/B", also an empty tree, but the ObjectWalk broke out too early and never visited "B". Bug: 286653 Change-Id: I25bcb0bc99d0cbbbdd9c2bd625ad6a691a6d0335 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Relax ObjectChecker to permit missing tagger linesShawn O. Pearce2010-01-231-1/+46
| | | | | | | | | | | | | | | | | | | | | | | Annotated tags created with C Git versions before the introduction of c818566 ([PATCH] Update tags to record who made them, 2005-07-14), do not have a "tagger" line present in the object header. This line did not appear in C Git until v0.99.1~9. Ancient projects such as the Linux kernel contain such tags, for example Linux 2.6.12 is older than when this feature first appeared in C Git. Linux v2.6.13-rc4 in late July 2005 is the first kernel version tag to actually contain a tagger line. It is therefore acceptable for the header to be missing, and for the RevTag.getTaggerIdent() method to return null. Since the Javadoc for getTaggerIdent() already explained that the identity may be null, we just need to test that this is true when the header is missing, and allow the ObjectChecker to pass anyway. Change-Id: I34ba82e0624a0d1a7edcf62ffba72260af6f7e5d See: http://code.google.com/p/gerrit/issues/detail?id=399 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Abstract out utility functions for creating test commitsShawn O. Pearce2010-01-128-102/+54
| | | | | | | | | These routines create a fairly clean DSL for writing out the structure of a repository in a test case. Abstract them into a helper class that we can reuse in other test environments. Change-Id: I55cce3d557e1a28afe2fdf37b3a5b67e2651c9f1 Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Refactor RepositoryTestCase to use LocalDiskRepository insteadShawn O. Pearce2009-11-021-3/+3
| | | | | Change-Id: I07014d1b8cc2fab0761d644a12e4ae04f0adf3ef Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* Initial JGit contribution to eclipse.orgGit Development Community2009-09-2918-0/+3193
Per CQ 3448 this is the initial contribution of the JGit project to eclipse.org. It is derived from the historical JGit repository at commit 3a2dd9921c8a08740a9e02c421469e5b1a9e47cb. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>