Skip to content

Commit 6fac65b

Browse files
committed
unnecessary getWorkspace() removed
sinceCommit and untilCommit -> startRevision and endRevision
1 parent 60f6d57 commit 6fac65b

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

src/main/java/org/scm4j/vcs/svn/SVNVCS.java

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.scm4j.vcs.api.exceptions.*;
77
import org.scm4j.vcs.api.workingcopy.IVCSLockedWorkingCopy;
88
import org.scm4j.vcs.api.workingcopy.IVCSRepositoryWorkspace;
9-
import org.scm4j.vcs.api.workingcopy.IVCSWorkspace;
109
import org.tmatesoft.svn.core.*;
1110
import org.tmatesoft.svn.core.auth.BasicAuthenticationManager;
1211
import org.tmatesoft.svn.core.auth.SVNAuthentication;
@@ -15,7 +14,10 @@
1514
import org.tmatesoft.svn.core.io.SVNRepository;
1615
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
1716
import org.tmatesoft.svn.core.wc.*;
18-
import org.tmatesoft.svn.core.wc2.*;
17+
import org.tmatesoft.svn.core.wc2.SvnDiff;
18+
import org.tmatesoft.svn.core.wc2.SvnDiffSummarize;
19+
import org.tmatesoft.svn.core.wc2.SvnOperationFactory;
20+
import org.tmatesoft.svn.core.wc2.SvnTarget;
1921

2022
import java.io.ByteArrayOutputStream;
2123
import java.io.File;
@@ -474,21 +476,21 @@ public VCSCommit removeFile(String branchName, String filePath, String commitMes
474476
}
475477

476478
@Override
477-
public List<VCSCommit> getCommitsRange(String branchName, String firstCommitId, WalkDirection direction, int limit) {
479+
public List<VCSCommit> getCommitsRange(String branchName, String startRevision, WalkDirection direction, int limit) {
478480
final List<VCSCommit> res = new ArrayList<>();
479481
try {
480-
Long sinceCommit;
481-
Long untilCommit;
482+
Long startRevisionLong;
483+
Long endRevisionLong;
482484
if (direction == WalkDirection.ASC) {
483-
sinceCommit = firstCommitId == null ? getBranchFirstCommit(branchName).getRevision() :
484-
Long.parseLong(firstCommitId);
485-
untilCommit = Long.parseLong(getHeadCommit(branchName).getRevision());
485+
startRevisionLong = startRevision == null ? getBranchFirstCommit(branchName).getRevision() :
486+
Long.parseLong(startRevision);
487+
endRevisionLong = Long.parseLong(getHeadCommit(branchName).getRevision());
486488
} else {
487-
sinceCommit = firstCommitId == null ? Long.parseLong(getHeadCommit(branchName).getRevision()) :
488-
Long.parseLong(firstCommitId);
489-
untilCommit = getBranchFirstCommit(branchName).getRevision();
489+
startRevisionLong = startRevision == null ? Long.parseLong(getHeadCommit(branchName).getRevision()) :
490+
Long.parseLong(startRevision);
491+
endRevisionLong = getBranchFirstCommit(branchName).getRevision();
490492
}
491-
repository.log(new String[] { getBranchName(branchName) }, sinceCommit, untilCommit, true, true, limit,
493+
repository.log(new String[] { getBranchName(branchName) }, startRevisionLong, endRevisionLong, true, true, limit,
492494
logEntry -> {
493495
VCSCommit commit = svnLogEntryToVCSCommit(logEntry);
494496
res.add(commit);
@@ -505,26 +507,21 @@ private VCSCommit svnLogEntryToVCSCommit(SVNLogEntry logEntry) {
505507
}
506508

507509
@Override
508-
public List<VCSCommit> getCommitsRange(String branchName, String firstCommitId, String untilCommitId) {
510+
public List<VCSCommit> getCommitsRange(String branchName, String startRevision, String endRevision) {
509511
final List<VCSCommit> res = new ArrayList<>();
510512
try {
511-
Long sinceCommit = firstCommitId == null ?
513+
Long startRevisionLong = startRevision == null ?
512514
getBranchFirstCommit(branchName).getRevision() :
513-
Long.parseLong(firstCommitId);
514-
Long untilCommit = untilCommitId == null ? -1L : Long.parseLong(untilCommitId);
515-
repository.log(new String[] { getBranchName(branchName) }, sinceCommit, untilCommit, true, true, 0 /* limit */,
515+
Long.parseLong(startRevision);
516+
Long endRevisionLong = endRevision == null ? -1L : Long.parseLong(endRevision);
517+
repository.log(new String[] { getBranchName(branchName) }, startRevisionLong, endRevisionLong, true, true, 0 /* limit */,
516518
logEntry -> res.add(svnLogEntryToVCSCommit(logEntry)));
517519
return res;
518520
} catch (SVNException e) {
519521
throw new EVCSException(e);
520522
}
521523
}
522524

523-
@Override
524-
public IVCSWorkspace getWorkspace() {
525-
return repo.getWorkspace();
526-
}
527-
528525
@Override
529526
public VCSCommit getHeadCommit(String branchName) {
530527
try {

0 commit comments

Comments
 (0)