Skip to content

Commit bb3d288

Browse files
committed
2 parents 15a90bc + 29bb129 commit bb3d288

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ Note: null passed as a branch name is considered as Master Branch. Any non-null
107107
- Returns short name of current IVCS implementation: "git", "svn" etc
108108
- `VCSCommit removeFile(String branchName, String filePath, String commitMessage)`
109109
- Removes the file with path `filePath` within branch `branchName`. Operation is executed as separate commit with `commitMessage` message attached. Note: filePath = "folder\file.txt" -> file.txt is removed, folder is kept. Returns resulting commit.
110-
- `List<VCSCommit> getCommitsRange(String branchName, String firstCommitId, String untilCommitId)`
111-
- Returns ordered list of all commits located between commits specified by `firstCommitId` and `untilCommitId` inclusively within branch `branchName`
112-
- If `firstCommitId` is null then all commits until commit specified by `untilCommitId` inclusively are fetched
113-
- If `untilCommitId` is null then all commits starting from commit specified by `firstCommitId` are fetched
114-
- If `firstCommitId` and `untilCommitId` are null then all commits are fetched
115-
- `List<VCSCommit> getCommitsRange(String branchName, String firstCommitId, WalkDirection direction, int limit)`
116-
- Returns ordered list of `limit` commits (0 is unlimited) starting from commit specified by `firstCommitId` in direction specified by `direction`
117-
- If `firstCommitId` is null then commits are starting at branch `branchName` first commit (for ASC direction) or at head of branch (for DESC direction)
110+
- `List<VCSCommit> getCommitsRange(String branchName, String startRevision, String endRevision)`
111+
- Returns ordered list of all commits located between commits specified by `startRevision` and `endRevision` inclusively within branch `branchName`
112+
- If `startRevision` is null then all commits up to commit specified by `endRevision` inclusively are fetched
113+
- If `endRevision` is null then all commits starting from commit specified by `startRevision` are fetched
114+
- If `startRevision` and `endRevision` are null then all commits are fetched
115+
- `List<VCSCommit> getCommitsRange(String branchName, String startRevision, WalkDirection direction, int limit)`
116+
- Returns ordered list of `limit` commits (0 is unlimited) starting from commit specified by `startRevision` in direction specified by `direction`
117+
- If `startRevision` is null then all commits are fetched
118118
- `VCSCommit getHeadCommit(String branchName)`
119119
- Returns `VCSCommit` instance pointing to the head (last) commit of the branch `branchName` or `null` if the requested branch does not exists
120120
- `Boolean fileExists(String branchName, String filePath)`

src/main/java/org/scm4j/vcs/api/IVCS.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import org.scm4j.vcs.api.exceptions.EVCSBranchExists;
44
import org.scm4j.vcs.api.exceptions.EVCSFileNotFound;
55
import org.scm4j.vcs.api.exceptions.EVCSTagExists;
6-
import org.scm4j.vcs.api.workingcopy.IVCSWorkspace;
76

87
import java.util.List;
98
import java.util.Set;
@@ -35,11 +34,9 @@ public interface IVCS {
3534

3635
VCSCommit removeFile(String branchName, String filePath, String commitMessage);
3736

38-
List<VCSCommit> getCommitsRange(String branchName, String firstCommitId, String untilCommitId);
37+
List<VCSCommit> getCommitsRange(String branchName, String startRevision, String endRevision);
3938

40-
List<VCSCommit> getCommitsRange(String branchName, String firstCommitId, WalkDirection direction, int limit);
41-
42-
IVCSWorkspace getWorkspace();
39+
List<VCSCommit> getCommitsRange(String branchName, String startRevision, WalkDirection direction, int limit);
4340

4441
VCSCommit getHeadCommit(String branchName);
4542

src/main/java/org/scm4j/vcs/api/exceptions/EVCSBranchExists.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class EVCSBranchExists extends EVCSException {
44

55
private static final long serialVersionUID = 1806733612822322930L;
66

7-
public EVCSBranchExists(Exception e) {
8-
super(e);
7+
public EVCSBranchExists(String branchName) {
8+
super("branch already exists: " + branchName);
99
}
1010
}

src/test/java/org/scm4j/vcs/api/exceptions/ExceptionsTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ public void testEVCSException() {
2121

2222
@Test
2323
public void testEVCSBranchExists() {
24-
Exception e = new Exception(TEST_MESSAGE);
25-
EVCSBranchExists e1 = new EVCSBranchExists(e);
26-
assertTrue(e1.getMessage().contains(TEST_MESSAGE));
27-
assertEquals(e1.getCause(), e);
24+
EVCSBranchExists e = new EVCSBranchExists(TEST_BRANCH_NAME);
25+
assertTrue(e.getMessage().contains(TEST_BRANCH_NAME));
2826
}
2927

3028
@Test

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.0-SNAPSHOT
1+
13.0-SNAPSHOT

0 commit comments

Comments
 (0)