use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.
the class SvnKitExportClient method export.
@Override
public void export(@NotNull SvnTarget from, @NotNull File to, @Nullable SVNRevision revision, @Nullable Depth depth, @Nullable String nativeLineEnd, boolean force, boolean ignoreExternals, @Nullable ProgressTracker handler) throws VcsException {
SVNUpdateClient client = myVcs.getSvnKitManager().createUpdateClient();
client.setEventHandler(toEventHandler(handler));
client.setIgnoreExternals(ignoreExternals);
try {
if (from.isFile()) {
client.doExport(from.getFile(), to, from.getPegRevision(), revision, nativeLineEnd, force, toDepth(depth));
} else {
client.doExport(from.getURL(), to, from.getPegRevision(), revision, nativeLineEnd, force, toDepth(depth));
}
} catch (SVNException e) {
throw new SvnBindException(e);
}
}
use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.
the class SvnKitCleanupClient method cleanup.
@Override
public void cleanup(@NotNull File path, @Nullable ProgressTracker handler) throws VcsException {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
client.setEventHandler(toEventHandler(handler));
try {
client.doCleanup(path);
} catch (SVNException e) {
throw new SvnBindException(e);
}
}
use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.
the class SvnChangeProvider method getChanges.
public void getChanges(@NotNull VcsDirtyScope dirtyScope, @NotNull ChangelistBuilder builder, @NotNull ProgressIndicator progress, @NotNull ChangeListManagerGate addGate) throws VcsException {
final SvnScopeZipper zipper = new SvnScopeZipper(dirtyScope);
zipper.run();
final Map<String, SvnScopeZipper.MyDirNonRecursive> nonRecursiveMap = zipper.getNonRecursiveDirs();
final ISVNStatusFileProvider fileProvider = createFileProvider(nonRecursiveMap);
try {
final SvnChangeProviderContext context = new SvnChangeProviderContext(myVcs, builder, progress);
final NestedCopiesBuilder nestedCopiesBuilder = new NestedCopiesBuilder(myVcs, mySvnFileUrlMapping);
final EventDispatcher<StatusReceiver> statusReceiver = EventDispatcher.create(StatusReceiver.class);
statusReceiver.addListener(context);
statusReceiver.addListener(nestedCopiesBuilder);
final SvnRecursiveStatusWalker walker = new SvnRecursiveStatusWalker(myVcs, statusReceiver.getMulticaster(), progress);
for (FilePath path : zipper.getRecursiveDirs()) {
walker.go(path, Depth.INFINITY);
}
walker.setFileProvider(fileProvider);
for (SvnScopeZipper.MyDirNonRecursive item : nonRecursiveMap.values()) {
walker.go(item.getDir(), Depth.IMMEDIATES);
}
statusReceiver.getMulticaster().finish();
processCopiedAndDeleted(context, dirtyScope);
processUnsaved(dirtyScope, addGate, context);
final Set<NestedCopyInfo> nestedCopies = nestedCopiesBuilder.getCopies();
mySvnFileUrlMapping.acceptNestedData(nestedCopies);
putAdministrative17UnderVfsListener(nestedCopies);
} catch (SvnExceptionWrapper e) {
LOG.info(e);
throw new VcsException(e.getCause());
} catch (SVNException e) {
if (e.getCause() != null) {
throw new VcsException(e.getMessage() + " " + e.getCause().getMessage(), e);
}
throw new VcsException(e);
}
}
use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.
the class Idea87218Test method main.
public static void main(String[] args) {
try {
SVNStatusClient client = new SVNStatusClient((ISVNRepositoryPool) null, new DefaultSVNOptions());
File src = new File(ourWcPath, "file1.txt");
SVNStatus status = client.doStatus(src, false);
assert status != null && SVNStatusType.STATUS_NORMAL.equals(status.getNodeStatus());
File dir = new File(ourWcPath, "unversioned");
SVNStatus dirStatus = client.doStatus(dir, false);
assert dirStatus != null && SVNStatusType.STATUS_UNVERSIONED.equals(dirStatus.getNodeStatus());
File dst = new File(dir, "file1.txt");
/*
final SVNCopyClient copyClient = new SVNCopyClient((ISVNRepositoryPool)null, new DefaultSVNOptions());
final SVNCopySource svnCopySource = new SVNCopySource(SVNRevision.UNDEFINED, SVNRevision.WORKING, src);
copyClient.doCopy(new SVNCopySource[]{svnCopySource}, dst, true, false, true);
*/
SVNMoveClient moveClient = new SVNMoveClient((ISVNRepositoryPool) null, new DefaultSVNOptions());
moveClient.doMove(src, dst);
} catch (SVNException e) {
e.printStackTrace();
}
}
use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.
the class Idea93475Test method main.
public static void main(String[] args) {
try {
SVNStatusClient client = new SVNStatusClient((ISVNRepositoryPool) null, new DefaultSVNOptions());
File src = new File(ourWcPath, "cde\\text1.txt");
assertStatus(client, src, SVNStatusType.STATUS_NORMAL);
File src1 = new File(ourWcPath, "cde\\text2.txt");
assertStatus(client, src, SVNStatusType.STATUS_NORMAL);
File dir = new File(ourWcPath, "abc");
assertStatus(client, dir, SVNStatusType.STATUS_ADDED);
File dst = new File(dir, "text1.txt");
File dst1 = new File(dir, "text2.txt");
SVNMoveClient moveClient = new SVNMoveClient((ISVNRepositoryPool) null, new DefaultSVNOptions());
moveClient.doMove(src, dst);
moveClient.doMove(src1, dst1);
assertStatus(client, dst, SVNStatusType.STATUS_ADDED);
assertStatus(client, dst1, SVNStatusType.STATUS_ADDED);
assert client.doStatus(dst, false).getCopyFromURL() != null;
assert client.doStatus(dst1, false).getCopyFromURL() != null;
// now rename the directory
final File renamedDir = new File(ourWcPath, "abc_renamed");
moveClient.doMove(dir, renamedDir);
File dstInRenamed = new File(renamedDir, "text1.txt");
File dst1InRenamed = new File(renamedDir, "text2.txt");
assertStatus(client, dstInRenamed, SVNStatusType.STATUS_ADDED);
assertStatus(client, dst1InRenamed, SVNStatusType.STATUS_ADDED);
assert client.doStatus(dstInRenamed, false).getCopyFromURL() != null;
assert client.doStatus(dst1InRenamed, false).getCopyFromURL() != null;
} catch (SVNException e) {
e.printStackTrace();
}
}
Aggregations