mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-02 11:35:57 +01:00
Remove unnecessary interfaces
This commit is contained in:
@@ -41,10 +41,10 @@ import java.io.File;
|
|||||||
* implemented:
|
* implemented:
|
||||||
*
|
*
|
||||||
* <dl>
|
* <dl>
|
||||||
* <dt>{@link #getInitializer(C)}</dt>
|
* <dt>{@link #initialize(C, File, String)}</dt>
|
||||||
* <dd>Creates a new clone of the repository for the given context in the given
|
* <dd>Creates a new clone of the repository for the given context in the given
|
||||||
* directory with the given branch checked out (if branches are supported).</dd>
|
* directory with the given branch checked out (if branches are supported).</dd>
|
||||||
* <dt>{@link #getReclaimer(C)}</dt>
|
* <dt>{@link #reclaim(C, File, String)}</dt>
|
||||||
* <dd>Reclaim the working directory with a already checked out clone of the
|
* <dd>Reclaim the working directory with a already checked out clone of the
|
||||||
* repository given in the context, so that the directory is not modified in
|
* repository given in the context, so that the directory is not modified in
|
||||||
* respect to the repository and the given branch is checked out (if branches
|
* respect to the repository and the given branch is checked out (if branches
|
||||||
@@ -215,19 +215,9 @@ public abstract class SimpleWorkingCopyFactory<R, W, C extends RepositoryProvide
|
|||||||
// nothing to do
|
// nothing to do
|
||||||
}
|
}
|
||||||
|
|
||||||
@FunctionalInterface
|
protected abstract ParentAndClone<R, W> initialize(C context, File target, String initialBranch);
|
||||||
public interface WorkingCopyInitializer<R, W> {
|
|
||||||
ParentAndClone<R, W> initialize(File target, String initialBranch);
|
|
||||||
}
|
|
||||||
|
|
||||||
@FunctionalInterface
|
protected abstract ParentAndClone<R, W> reclaim(C context, File target, String initialBranch) throws ReclaimFailedException;
|
||||||
public interface WorkingCopyReclaimer<R, W> {
|
|
||||||
ParentAndClone<R, W> reclaim(File target, String initialBranch) throws ReclaimFailedException;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected abstract WorkingCopyInitializer<R, W> getInitializer(C context);
|
|
||||||
|
|
||||||
protected abstract WorkingCopyReclaimer<R, W> getReclaimer(C context);
|
|
||||||
|
|
||||||
@SuppressWarnings("squid:S00112")
|
@SuppressWarnings("squid:S00112")
|
||||||
// We do allow implementations to throw arbitrary exceptions here, so that we can handle them in closeCentral
|
// We do allow implementations to throw arbitrary exceptions here, so that we can handle them in closeCentral
|
||||||
@@ -289,11 +279,11 @@ public abstract class SimpleWorkingCopyFactory<R, W, C extends RepositoryProvide
|
|||||||
}
|
}
|
||||||
|
|
||||||
public WorkingCopy<R, W> reclaim(File workdir) throws SimpleWorkingCopyFactory.ReclaimFailedException {
|
public WorkingCopy<R, W> reclaim(File workdir) throws SimpleWorkingCopyFactory.ReclaimFailedException {
|
||||||
return createWorkingCopyFromParentAndClone(getReclaimer(repositoryContext).reclaim(workdir, requestedBranch));
|
return createWorkingCopyFromParentAndClone(SimpleWorkingCopyFactory.this.reclaim(repositoryContext, workdir, requestedBranch));
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorkingCopy<R, W> initialize(File workdir) {
|
public WorkingCopy<R, W> initialize(File workdir) {
|
||||||
return createWorkingCopyFromParentAndClone(getInitializer(repositoryContext).initialize(workdir, requestedBranch));
|
return createWorkingCopyFromParentAndClone(SimpleWorkingCopyFactory.this.initialize(repositoryContext, workdir, requestedBranch));
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorkingCopy<R, W> createWorkingCopyFromParentAndClone(ParentAndClone<R, W> parentAndClone) {
|
public WorkingCopy<R, W> createWorkingCopyFromParentAndClone(ParentAndClone<R, W> parentAndClone) {
|
||||||
|
|||||||
@@ -84,23 +84,20 @@ public class SimpleWorkingCopyFactoryTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected WorkingCopyReclaimer<
|
protected ParentAndClone<Closeable, Closeable> initialize(Context context, File target, String initialBranch) {
|
||||||
Closeable, Closeable> getReclaimer(Context context) {
|
initialBranchForLastCloneCall = initialBranch;
|
||||||
return (target, initialBranch) -> {throw new UnsupportedOperationException();};
|
return new ParentAndClone<>(parent, clone, target);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ParentAndClone<Closeable, Closeable> reclaim(Context context, File target, String initialBranch) throws ReclaimFailedException {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void closeWorkingCopy(Closeable workingCopy) throws Exception {
|
protected void closeWorkingCopy(Closeable workingCopy) throws Exception {
|
||||||
workingCopy.close();
|
workingCopy.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected WorkingCopyInitializer<Closeable, Closeable> getInitializer(Context context) {
|
|
||||||
return (target, initialBranch) -> {
|
|
||||||
initialBranchForLastCloneCall = initialBranch;
|
|
||||||
return new ParentAndClone<>(parent, clone, target);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import org.eclipse.jgit.lib.Repository;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import sonia.scm.repository.InternalRepositoryException;
|
import sonia.scm.repository.InternalRepositoryException;
|
||||||
import sonia.scm.repository.work.SimpleWorkingCopyFactory;
|
|
||||||
import sonia.scm.repository.work.SimpleWorkingCopyFactory.ParentAndClone;
|
import sonia.scm.repository.work.SimpleWorkingCopyFactory.ParentAndClone;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -41,7 +40,7 @@ import java.io.IOException;
|
|||||||
import static sonia.scm.ContextEntry.ContextBuilder.entity;
|
import static sonia.scm.ContextEntry.ContextBuilder.entity;
|
||||||
import static sonia.scm.NotFoundException.notFound;
|
import static sonia.scm.NotFoundException.notFound;
|
||||||
|
|
||||||
class GitWorkingCopyInitializer implements SimpleWorkingCopyFactory.WorkingCopyInitializer<Repository, Repository> {
|
class GitWorkingCopyInitializer {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(GitWorkingCopyInitializer.class);
|
private static final Logger LOG = LoggerFactory.getLogger(GitWorkingCopyInitializer.class);
|
||||||
|
|
||||||
@@ -53,7 +52,6 @@ class GitWorkingCopyInitializer implements SimpleWorkingCopyFactory.WorkingCopyI
|
|||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ParentAndClone<Repository, Repository> initialize(File target, String initialBranch) {
|
public ParentAndClone<Repository, Repository> initialize(File target, String initialBranch) {
|
||||||
LOG.trace("clone repository {}", context.getRepository().getId());
|
LOG.trace("clone repository {}", context.getRepository().getId());
|
||||||
long start = System.nanoTime();
|
long start = System.nanoTime();
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ import sonia.scm.repository.work.SimpleWorkingCopyFactory.ParentAndClone;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
class GitWorkingCopyReclaimer implements SimpleWorkingCopyFactory.WorkingCopyReclaimer<Repository, Repository> {
|
class GitWorkingCopyReclaimer {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(GitWorkingCopyReclaimer.class);
|
private static final Logger LOG = LoggerFactory.getLogger(GitWorkingCopyReclaimer.class);
|
||||||
|
|
||||||
@@ -47,7 +47,6 @@ class GitWorkingCopyReclaimer implements SimpleWorkingCopyFactory.WorkingCopyRec
|
|||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ParentAndClone<Repository, Repository> reclaim(File target, String initialBranch) throws SimpleWorkingCopyFactory.ReclaimFailedException {
|
public ParentAndClone<Repository, Repository> reclaim(File target, String initialBranch) throws SimpleWorkingCopyFactory.ReclaimFailedException {
|
||||||
LOG.trace("reclaim repository {}", context.getRepository().getId());
|
LOG.trace("reclaim repository {}", context.getRepository().getId());
|
||||||
long start = System.nanoTime();
|
long start = System.nanoTime();
|
||||||
|
|||||||
@@ -26,18 +26,14 @@ package sonia.scm.repository.spi;
|
|||||||
|
|
||||||
import org.eclipse.jgit.lib.Repository;
|
import org.eclipse.jgit.lib.Repository;
|
||||||
import org.eclipse.jgit.transport.ScmTransportProtocol;
|
import org.eclipse.jgit.transport.ScmTransportProtocol;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import sonia.scm.repository.GitWorkingCopyFactory;
|
import sonia.scm.repository.GitWorkingCopyFactory;
|
||||||
import sonia.scm.repository.work.WorkingCopyPool;
|
|
||||||
import sonia.scm.repository.work.SimpleWorkingCopyFactory;
|
import sonia.scm.repository.work.SimpleWorkingCopyFactory;
|
||||||
|
import sonia.scm.repository.work.WorkingCopyPool;
|
||||||
import sonia.scm.util.SystemUtil;
|
import sonia.scm.util.SystemUtil;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import static sonia.scm.ContextEntry.ContextBuilder.entity;
|
|
||||||
|
|
||||||
public class SimpleGitWorkingCopyFactory extends SimpleWorkingCopyFactory<Repository, Repository, GitContext> implements GitWorkingCopyFactory {
|
public class SimpleGitWorkingCopyFactory extends SimpleWorkingCopyFactory<Repository, Repository, GitContext> implements GitWorkingCopyFactory {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@@ -46,13 +42,13 @@ public class SimpleGitWorkingCopyFactory extends SimpleWorkingCopyFactory<Reposi
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WorkingCopyInitializer<Repository, Repository> getInitializer(GitContext context) {
|
public ParentAndClone<Repository, Repository> initialize(GitContext context, File target, String initialBranch) {
|
||||||
return new GitWorkingCopyInitializer(this, context);
|
return new GitWorkingCopyInitializer(this, context).initialize(target, initialBranch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected WorkingCopyReclaimer<Repository, Repository> getReclaimer(GitContext context) {
|
public ParentAndClone<Repository, Repository> reclaim(GitContext context, File target, String initialBranch) throws SimpleWorkingCopyFactory.ReclaimFailedException {
|
||||||
return new GitWorkingCopyReclaimer(context);
|
return new GitWorkingCopyReclaimer(context).reclaim(target, initialBranch);
|
||||||
}
|
}
|
||||||
|
|
||||||
String createScmTransportProtocolUri(File bareRepository) {
|
String createScmTransportProtocolUri(File bareRepository) {
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ public class SimpleGitWorkingCopyFactoryTest extends AbstractGitCommandTestBase
|
|||||||
SimpleGitWorkingCopyFactory factory = new SimpleGitWorkingCopyFactory(new NoneCachingWorkingCopyPool(workdirProvider));
|
SimpleGitWorkingCopyFactory factory = new SimpleGitWorkingCopyFactory(new NoneCachingWorkingCopyPool(workdirProvider));
|
||||||
File workdir = createExistingClone(factory);
|
File workdir = createExistingClone(factory);
|
||||||
|
|
||||||
factory.getReclaimer(createContext()).reclaim(workdir, "master");
|
factory.reclaim(createContext(), workdir, "master");
|
||||||
|
|
||||||
assertBranchCheckedOutAndClean(workdir, "master");
|
assertBranchCheckedOutAndClean(workdir, "master");
|
||||||
}
|
}
|
||||||
@@ -152,7 +152,7 @@ public class SimpleGitWorkingCopyFactoryTest extends AbstractGitCommandTestBase
|
|||||||
SimpleGitWorkingCopyFactory factory = new SimpleGitWorkingCopyFactory(new NoneCachingWorkingCopyPool(workdirProvider));
|
SimpleGitWorkingCopyFactory factory = new SimpleGitWorkingCopyFactory(new NoneCachingWorkingCopyPool(workdirProvider));
|
||||||
File workdir = createExistingClone(factory);
|
File workdir = createExistingClone(factory);
|
||||||
|
|
||||||
factory.getReclaimer(createContext()).reclaim(workdir, "test-branch");
|
factory.reclaim(createContext(), workdir, "test-branch");
|
||||||
|
|
||||||
assertBranchCheckedOutAndClean(workdir, "test-branch");
|
assertBranchCheckedOutAndClean(workdir, "test-branch");
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,7 @@ public class SimpleGitWorkingCopyFactoryTest extends AbstractGitCommandTestBase
|
|||||||
File workdir = createExistingClone(factory);
|
File workdir = createExistingClone(factory);
|
||||||
Git.open(workdir).rm().addFilepattern("a.txt").call();
|
Git.open(workdir).rm().addFilepattern("a.txt").call();
|
||||||
|
|
||||||
factory.getReclaimer(createContext()).reclaim(workdir, "master");
|
factory.reclaim(createContext(), workdir, "master");
|
||||||
|
|
||||||
assertBranchCheckedOutAndClean(workdir, "master");
|
assertBranchCheckedOutAndClean(workdir, "master");
|
||||||
}
|
}
|
||||||
@@ -174,7 +174,7 @@ public class SimpleGitWorkingCopyFactoryTest extends AbstractGitCommandTestBase
|
|||||||
File workdir = createExistingClone(factory);
|
File workdir = createExistingClone(factory);
|
||||||
Files.delete(workdir.toPath().resolve("a.txt"));
|
Files.delete(workdir.toPath().resolve("a.txt"));
|
||||||
|
|
||||||
factory.getReclaimer(createContext()).reclaim(workdir, "master");
|
factory.reclaim(createContext(), workdir, "master");
|
||||||
|
|
||||||
assertBranchCheckedOutAndClean(workdir, "master");
|
assertBranchCheckedOutAndClean(workdir, "master");
|
||||||
}
|
}
|
||||||
@@ -187,7 +187,7 @@ public class SimpleGitWorkingCopyFactoryTest extends AbstractGitCommandTestBase
|
|||||||
Files.createDirectories(newDirectory);
|
Files.createDirectories(newDirectory);
|
||||||
Files.createFile(newDirectory.resolve("newFile"));
|
Files.createFile(newDirectory.resolve("newFile"));
|
||||||
|
|
||||||
factory.getReclaimer(createContext()).reclaim(workdir, "master");
|
factory.reclaim(createContext(), workdir, "master");
|
||||||
|
|
||||||
assertBranchCheckedOutAndClean(workdir, "master");
|
assertBranchCheckedOutAndClean(workdir, "master");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,8 +55,7 @@ public class SimpleHgWorkingCopyFactory extends SimpleWorkingCopyFactory<Reposit
|
|||||||
this.hgRepositoryEnvironmentBuilder = hgRepositoryEnvironmentBuilder;
|
this.hgRepositoryEnvironmentBuilder = hgRepositoryEnvironmentBuilder;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public WorkingCopyInitializer<Repository, Repository> getInitializer(HgCommandContext context) {
|
public ParentAndClone<Repository, Repository> initialize(HgCommandContext context, File target, String initialBranch) {
|
||||||
return (target, initialBranch) -> {
|
|
||||||
Repository centralRepository = openCentral(context);
|
Repository centralRepository = openCentral(context);
|
||||||
CloneCommand cloneCommand = CloneCommandFlags.on(centralRepository);
|
CloneCommand cloneCommand = CloneCommandFlags.on(centralRepository);
|
||||||
if (initialBranch != null) {
|
if (initialBranch != null) {
|
||||||
@@ -71,18 +70,10 @@ public class SimpleHgWorkingCopyFactory extends SimpleWorkingCopyFactory<Reposit
|
|||||||
BaseRepository clone = Repository.open(target);
|
BaseRepository clone = Repository.open(target);
|
||||||
|
|
||||||
return new ParentAndClone<>(centralRepository, clone, target);
|
return new ParentAndClone<>(centralRepository, clone, target);
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public Repository openCentral(HgCommandContext context) {
|
|
||||||
BiConsumer<sonia.scm.repository.Repository, Map<String, String>> repositoryMapBiConsumer =
|
|
||||||
(repository, environment) -> hgRepositoryEnvironmentBuilder.get().buildFor(repository, null, environment);
|
|
||||||
return context.openWithSpecialEnvironment(repositoryMapBiConsumer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected WorkingCopyReclaimer<Repository, Repository> getReclaimer(HgCommandContext context) {
|
protected ParentAndClone<Repository, Repository> reclaim(HgCommandContext context, File target, String initialBranch) throws ReclaimFailedException {
|
||||||
return (target, initialBranch) -> {
|
|
||||||
Repository centralRepository = openCentral(context);
|
Repository centralRepository = openCentral(context);
|
||||||
try {
|
try {
|
||||||
BaseRepository clone = Repository.open(target);
|
BaseRepository clone = Repository.open(target);
|
||||||
@@ -94,7 +85,12 @@ public class SimpleHgWorkingCopyFactory extends SimpleWorkingCopyFactory<Reposit
|
|||||||
} catch (ExecutionException | IOException e) {
|
} catch (ExecutionException | IOException e) {
|
||||||
throw new ReclaimFailedException(e);
|
throw new ReclaimFailedException(e);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
public Repository openCentral(HgCommandContext context) {
|
||||||
|
BiConsumer<sonia.scm.repository.Repository, Map<String, String>> repositoryMapBiConsumer =
|
||||||
|
(repository, environment) -> hgRepositoryEnvironmentBuilder.get().buildFor(repository, null, environment);
|
||||||
|
return context.openWithSpecialEnvironment(repositoryMapBiConsumer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void delete(File directory, String unknownFile) throws IOException {
|
private void delete(File directory, String unknownFile) throws IOException {
|
||||||
|
|||||||
@@ -25,8 +25,8 @@
|
|||||||
package sonia.scm.repository.spi;
|
package sonia.scm.repository.spi;
|
||||||
|
|
||||||
import sonia.scm.repository.SvnWorkingCopyFactory;
|
import sonia.scm.repository.SvnWorkingCopyFactory;
|
||||||
import sonia.scm.repository.work.WorkingCopyPool;
|
|
||||||
import sonia.scm.repository.work.SimpleWorkingCopyFactory;
|
import sonia.scm.repository.work.SimpleWorkingCopyFactory;
|
||||||
|
import sonia.scm.repository.work.WorkingCopyPool;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@@ -39,13 +39,13 @@ public class SimpleSvnWorkingCopyFactory extends SimpleWorkingCopyFactory<File,
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected WorkingCopyInitializer<File, File> getInitializer(SvnContext context) {
|
protected ParentAndClone<File, File> initialize(SvnContext context, File workingCopy, String initialBranch) {
|
||||||
return new SvnWorkingCopyInitializer(context);
|
return new SvnWorkingCopyInitializer(context).initialize(workingCopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected WorkingCopyReclaimer<File, File> getReclaimer(SvnContext context) {
|
protected ParentAndClone<File, File> reclaim(SvnContext context, File target, String initialBranch) throws SimpleWorkingCopyFactory.ReclaimFailedException {
|
||||||
return new SvnWorkingCopyReclaimer(context);
|
return new SvnWorkingCopyReclaimer(context).reclaim(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -30,20 +30,18 @@ import org.tmatesoft.svn.core.wc2.SvnCheckout;
|
|||||||
import org.tmatesoft.svn.core.wc2.SvnOperationFactory;
|
import org.tmatesoft.svn.core.wc2.SvnOperationFactory;
|
||||||
import org.tmatesoft.svn.core.wc2.SvnTarget;
|
import org.tmatesoft.svn.core.wc2.SvnTarget;
|
||||||
import sonia.scm.repository.InternalRepositoryException;
|
import sonia.scm.repository.InternalRepositoryException;
|
||||||
import sonia.scm.repository.work.SimpleWorkingCopyFactory;
|
|
||||||
import sonia.scm.repository.work.SimpleWorkingCopyFactory.ParentAndClone;
|
import sonia.scm.repository.work.SimpleWorkingCopyFactory.ParentAndClone;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
class SvnWorkingCopyInitializer implements SimpleWorkingCopyFactory.WorkingCopyInitializer<File, File> {
|
class SvnWorkingCopyInitializer {
|
||||||
private final SvnContext context;
|
private final SvnContext context;
|
||||||
|
|
||||||
public SvnWorkingCopyInitializer(SvnContext context) {
|
public SvnWorkingCopyInitializer(SvnContext context) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public ParentAndClone<File, File> initialize(File workingCopy) {
|
||||||
public ParentAndClone<File, File> initialize(File workingCopy, String initialBranch) {
|
|
||||||
final SvnOperationFactory svnOperationFactory = new SvnOperationFactory();
|
final SvnOperationFactory svnOperationFactory = new SvnOperationFactory();
|
||||||
|
|
||||||
SVNURL source;
|
SVNURL source;
|
||||||
|
|||||||
@@ -34,15 +34,14 @@ import java.io.File;
|
|||||||
|
|
||||||
import static org.tmatesoft.svn.core.SVNDepth.INFINITY;
|
import static org.tmatesoft.svn.core.SVNDepth.INFINITY;
|
||||||
|
|
||||||
class SvnWorkingCopyReclaimer implements SimpleWorkingCopyFactory.WorkingCopyReclaimer<File, File> {
|
class SvnWorkingCopyReclaimer {
|
||||||
private final SvnContext context;
|
private final SvnContext context;
|
||||||
|
|
||||||
public SvnWorkingCopyReclaimer(SvnContext context) {
|
public SvnWorkingCopyReclaimer(SvnContext context) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public ParentAndClone<File, File> reclaim(File target) throws SimpleWorkingCopyFactory.ReclaimFailedException {
|
||||||
public ParentAndClone<File, File> reclaim(File target, String initialBranch) throws SimpleWorkingCopyFactory.ReclaimFailedException {
|
|
||||||
SVNClientManager clientManager = SVNClientManager.newInstance();
|
SVNClientManager clientManager = SVNClientManager.newInstance();
|
||||||
try {
|
try {
|
||||||
clientManager.getWCClient().doRevert(new File[] {target}, INFINITY, null);
|
clientManager.getWCClient().doRevert(new File[] {target}, INFINITY, null);
|
||||||
|
|||||||
Reference in New Issue
Block a user