use of org.jetbrains.idea.svn.info.Info in project intellij-community by JetBrains.
the class CreateBranchOrTagDialog method isOKActionEnabled.
public boolean isOKActionEnabled() {
myErrorLabel.setText(" ");
if (myURL == null) {
return false;
}
if (myBranchOrTagRadioButton.isSelected() && myBranchTagBaseComboBox.getComboBox().getSelectedItem() == null) {
myErrorLabel.setText(SvnBundle.message("create.branch.no.base.location.error"));
return false;
}
String url = getToURL();
if (url != null && url.trim().length() > 0) {
if (myRepositoryRadioButton.isSelected()) {
SVNRevision revision;
try {
revision = myRevisionPanel.getRevision();
} catch (ConfigurationException e) {
revision = SVNRevision.UNDEFINED;
}
if (!revision.isValid() || revision.isLocal()) {
myErrorLabel.setText(SvnBundle.message("create.branch.invalid.revision.error", myRevisionPanel.getRevisionText()));
return false;
}
return true;
} else if (myWorkingCopyRadioButton.isSelected()) {
Info info = SvnVcs.getInstance(myProject).getInfo(mySrcFile);
String srcUrl = info != null && info.getURL() != null ? info.getURL().toString() : null;
if (srcUrl == null) {
myErrorLabel.setText(SvnBundle.message("create.branch.no.working.copy.error", myWorkingCopyField.getText()));
return false;
}
return true;
}
}
return false;
}
use of org.jetbrains.idea.svn.info.Info in project intellij-community by JetBrains.
the class RootsToWorkingCopies method calculateRoot.
@Nullable
private WorkingCopy calculateRoot(@NotNull VirtualFile root) {
File workingCopyRoot = SvnUtil.getWorkingCopyRootNew(virtualToIoFile(root));
WorkingCopy workingCopy = null;
if (workingCopyRoot != null) {
final Info svnInfo = myVcs.getInfo(workingCopyRoot);
if (svnInfo != null && svnInfo.getURL() != null) {
workingCopy = new WorkingCopy(workingCopyRoot, svnInfo.getURL(), true);
}
}
return registerWorkingCopy(root, workingCopy);
}
use of org.jetbrains.idea.svn.info.Info in project intellij-community by JetBrains.
the class SvnFileUrlMappingImpl method fillMapping.
private void fillMapping(final SvnMapping mapping, final List<SvnCopyRootSimple> list) {
final LocalFileSystem lfs = LocalFileSystem.getInstance();
for (SvnCopyRootSimple simple : list) {
final VirtualFile copyRoot = lfs.findFileByIoFile(new File(simple.myCopyRoot));
final VirtualFile vcsRoot = lfs.findFileByIoFile(new File(simple.myVcsRoot));
if (copyRoot == null || vcsRoot == null)
continue;
final SvnVcs vcs = SvnVcs.getInstance(myProject);
final Info svnInfo = vcs.getInfo(copyRoot);
if ((svnInfo == null) || (svnInfo.getRepositoryRootURL() == null))
continue;
Node node = new Node(copyRoot, svnInfo.getURL(), svnInfo.getRepositoryRootURL());
final RootUrlInfo info = new RootUrlInfo(node, SvnFormatSelector.findRootAndGetFormat(svnInfo.getFile()), vcsRoot);
mapping.add(info);
}
}
use of org.jetbrains.idea.svn.info.Info in project intellij-community by JetBrains.
the class SvnParseCommandLineParseTest method testInfo.
public void testInfo() throws Exception {
final String s = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<info>\n" + "<entry\n" + " path=\"ReduceReturnOrYieldBreakTransformation.cs\"\n" + " revision=\"91603\"\n" + " kind=\"file\">\n" + "<url>http://svn.labs.intellij.net/resharper/trunk/ReSharper/src/Decompiler.Core/Src/Transformations/StatementStructure/ReduceReturnOrYieldBreakTransformation.cs</url>\n" + "<repository>\n" + "<root>http://svn.labs.intellij.net/resharper</root>\n" + "<uuid>ed0594e5-7722-0410-9c76-949374689613</uuid>\n" + "</repository>\n" + "<wc-info>\n" + "<wcroot-abspath>C:/TestProjects/sortedProjects/Subversion/Resharper17short</wcroot-abspath>\n" + "<schedule>normal</schedule>\n" + "<depth>infinity</depth>\n" + "<text-updated>2012-01-20T11:25:32.625000Z</text-updated>\n" + "<checksum>7af8adacb93afaa48b2cfb76de605824c220983a</checksum>\n" + "</wc-info>\n" + "<commit\n" + " revision=\"87972\">\n" + "<author>Slava.Trenogin</author>\n" + "<date>2011-10-06T21:27:41.539022Z</date>\n" + "</commit>\n" + "</entry>\n" + "</info>";
final Info[] info = new Info[1];
final SvnInfoHandler handler = new SvnInfoHandler(new File("C:/base/"), info1 -> info[0] = info1);
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
parser.parse(new ByteArrayInputStream(s.getBytes(CharsetToolkit.UTF8_CHARSET)), handler);
Assert.assertNotNull(info[0]);
}
use of org.jetbrains.idea.svn.info.Info in project intellij-community by JetBrains.
the class SvnMergeInfoTest method testMixedWorkingRevisions.
@Test
public void testMixedWorkingRevisions() throws Exception {
createOneFolderStructure();
// rev 3
editAndCommit(trunk, f1);
// rev 4: record non inheritable merge
setMergeInfo(myBranchVcsRoot, "/trunk:3");
commitFile(myBranchVcsRoot);
// ! no update!
assertMergeInfo(myBranchVcsRoot, "/trunk:3");
final Info f1info = myVcs.getInfo(new File(myBranchVcsRoot, "folder/f1.txt"));
assert f1info.getRevision().getNumber() == 2;
final List<SvnChangeList> changeListList = getTrunkChangeLists();
final SvnChangeList changeList = changeListList.get(0);
assertMergeResult(changeList, SvnMergeInfoCache.MergeCheckResult.NOT_MERGED);
// and after update
updateFile(myBranchVcsRoot);
myMergeChecker.clear();
assertMergeResult(changeList, SvnMergeInfoCache.MergeCheckResult.MERGED);
}
Aggregations