use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.
the class SvnKitDeleteClient method delete.
@Override
public void delete(@NotNull File path, boolean force, boolean dryRun, @Nullable ProgressTracker handler) throws VcsException {
SVNWCClient client = myVcs.getSvnKitManager().createWCClient();
client.setEventHandler(toEventHandler(handler));
try {
client.doDelete(path, force, dryRun);
} catch (SVNException e) {
throw new VcsException(e);
}
}
use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.
the class RepositoryBrowserDialog method createBrowserComponent.
public JComponent createBrowserComponent(final boolean toolWindow) {
JPanel panel = new JPanel();
panel.setLayout(new GridBagLayout());
GridBagConstraints gc = new GridBagConstraints();
gc.gridx = 0;
gc.gridwidth = 1;
gc.gridy = 0;
gc.gridheight = 1;
gc.gridx = 0;
gc.gridwidth = 2;
gc.gridy += 1;
gc.gridheight = 1;
gc.weightx = 1;
gc.weighty = 1;
gc.fill = GridBagConstraints.BOTH;
gc.anchor = GridBagConstraints.WEST;
panel.add(getRepositoryBrowser(), gc);
gc.gridy += 1;
gc.weighty = 0;
gc.fill = GridBagConstraints.HORIZONTAL;
panel.add(new JLabel(), gc);
Collection<String> urls = SvnApplicationSettings.getInstance().getCheckoutURLs();
ArrayList<SVNURL> svnURLs = new ArrayList<>();
for (final String url : urls) {
try {
svnURLs.add(SVNURL.parseURIEncoded(url));
} catch (SVNException e) {
//
}
}
getRepositoryBrowser().setRepositoryURLs(svnURLs.toArray(new SVNURL[svnURLs.size()]), myShowFiles);
getRepositoryBrowser().getRepositoryTree().addMouseListener(new PopupHandler() {
@Override
public void invokePopup(Component comp, int x, int y) {
JTree tree = getRepositoryBrowser().getRepositoryTree();
int row = tree.getRowForLocation(x, y);
if (row >= 0) {
tree.setSelectionRow(row);
}
JPopupMenu popupMenu = createPopup(toolWindow);
if (popupMenu != null) {
popupMenu.show(comp, x, y);
}
}
});
return panel;
}
use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.
the class DiffContentRevision method getContentAsBytes.
@NotNull
@Override
public byte[] getContentAsBytes() throws VcsException {
if (myContents == null) {
BufferExposingByteArrayOutputStream bos = new BufferExposingByteArrayOutputStream(2048);
try {
myRepository.getFile(myPath, -1, null, bos);
myRepository.closeSession();
} catch (SVNException e) {
throw new VcsException(e);
}
myContents = bos.toByteArray();
}
return myContents;
}
use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.
the class ElementWithBranchComparer method run.
public void run() {
new Task.Modal(myProject, getTitle(), true) {
@Override
public void run(@NotNull ProgressIndicator indicator) {
try {
beforeCompare();
myElementUrl = resolveElementUrl();
if (myElementUrl == null) {
reportNotFound();
} else {
compare();
}
} catch (SVNCancelException ex) {
ElementWithBranchComparer.this.onCancel();
} catch (SVNException ex) {
reportException(new SvnBindException(ex));
} catch (SvnBindException ex) {
reportException(ex);
} catch (VcsException ex) {
reportGeneralException(ex);
}
}
}.queue();
showResult();
}
use of org.tmatesoft.svn.core.SVNException in project intellij-community by JetBrains.
the class SvnAuthenticationTest method testSavedAndRead.
public void testSavedAndRead() throws Exception {
final TestListener listener = new TestListener(mySynchObject);
myAuthenticationManager.addListener(listener);
final SavedOnceListener savedOnceListener = new SavedOnceListener();
myAuthenticationManager.addListener(savedOnceListener);
final SVNURL url = SVNURL.parseURIEncoded("http://some.host.com/repo");
final SVNException[] exception = new SVNException[1];
final boolean[] result = { false };
synchronousBackground(() -> {
try {
listener.addStep(new Trinity<>(ProviderType.persistent, url, Type.request));
listener.addStep(new Trinity<>(ProviderType.interactive, url, Type.request));
if (SystemInfo.isWindows) {
listener.addStep(new Trinity<>(ProviderType.persistent, url, Type.save));
} else {
listener.addStep(new Trinity<>(ProviderType.persistent, url, Type.without_pasword_save));
}
commonScheme(url, false, null);
Assert.assertEquals(3, listener.getCnt());
//long start = System.currentTimeMillis();
//waitListenerStep(start, listener, 3);
listener.reset();
if (!SystemInfo.isWindows)
savedOnceListener.reset();
SvnConfiguration.RUNTIME_AUTH_CACHE.clear();
listener.addStep(new Trinity<>(ProviderType.persistent, url, Type.request));
if (!SystemInfo.isWindows) {
listener.addStep(new Trinity<>(ProviderType.interactive, url, Type.request));
listener.addStep(new Trinity<>(ProviderType.persistent, url, Type.without_pasword_save));
}
commonScheme(url, false, null);
//start = System.currentTimeMillis();
//waitListenerStep(start, listener, 4);
Assert.assertEquals(SystemInfo.isWindows ? 1 : 3, listener.getCnt());
} catch (SVNException e) {
exception[0] = e;
}
result[0] = true;
});
Assert.assertTrue(result[0]);
Assert.assertEquals(SystemInfo.isWindows ? 0 : 2, myTestInteraction.getNumPlaintextPrompt());
Assert.assertEquals(0, myTestInteraction.getNumAuthWarn());
Assert.assertEquals(0, myTestInteraction.getNumPasswordsWarn());
Assert.assertEquals(0, myTestInteraction.getNumSSLPlaintextPrompt());
Assert.assertEquals(0, myTestInteraction.getNumSSLWarn());
Assert.assertEquals(SystemInfo.isWindows ? 1 : 3, listener.getCnt());
listener.assertForAwt();
savedOnceListener.assertForAwt();
savedOnceListener.assertSaved(url, ISVNAuthenticationManager.PASSWORD);
if (exception[0] != null) {
throw exception[0];
}
}
Aggregations