本文整理汇总了Java中org.jetbrains.idea.svn.SvnVcs类的典型用法代码示例。如果您正苦于以下问题:Java SvnVcs类的具体用法?Java SvnVcs怎么用?Java SvnVcs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SvnVcs类属于org.jetbrains.idea.svn包,在下文中一共展示了SvnVcs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isEnabledImpl
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
private boolean isEnabledImpl(final SvnVcs vcs, final VirtualFile file) {
final ChangeListManager clManager = ChangeListManager.getInstance(vcs.getProject());
if (SvnStatusUtil.isIgnoredInAnySense(clManager, file)) {
myAllCanBeIgnored = false;
return myAllAreIgnored | myAllCanBeIgnored;
} else if (clManager.isUnversioned(file)) {
// check parent
final VirtualFile parent = file.getParent();
if (parent != null) {
if ((! SvnStatusUtil.isIgnoredInAnySense(clManager, parent)) && (! clManager.isUnversioned(parent))) {
myAllAreIgnored = false;
return myAllAreIgnored | myAllCanBeIgnored;
}
}
}
myAllCanBeIgnored = false;
myAllAreIgnored = false;
return false;
}
示例2: addToExternalProperty
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
public static boolean addToExternalProperty(@NotNull SvnVcs vcs, @NotNull File ioFile, String target, String url)
throws SVNException, VcsException {
ClientFactory factory = vcs.getFactory(ioFile);
PropertyValue propertyValue = factory.createPropertyClient().getProperty(SvnTarget.fromFile(ioFile), SvnPropertyKeys.SVN_EXTERNALS,
false, SVNRevision.UNDEFINED);
String newValue;
if (propertyValue != null && !StringUtil.isEmptyOrSpaces(propertyValue.toString())) {
Map<String, String> externalsMap = ExternalsDefinitionParser.parseExternalsProperty(propertyValue.toString());
String externalsForTarget = externalsMap.get(target);
if (externalsForTarget != null) {
AbstractVcsHelper.getInstance(vcs.getProject()).showError(
new VcsException("Selected destination conflicts with existing: " + externalsForTarget), "Create External");
return true;
}
final String string = createExternalDefinitionString(url, target);
newValue = propertyValue.toString().trim() + "\n" + string;
} else {
newValue = createExternalDefinitionString(url, target);
}
factory.createPropertyClient().setProperty(ioFile, SvnPropertyKeys.SVN_EXTERNALS, PropertyValue.create(newValue), Depth.EMPTY, false);
return false;
}
示例3: SvnFileRevision
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
public SvnFileRevision(SvnVcs vcs,
SVNRevision pegRevision,
LogEntry logEntry,
String url,
String copyFromPath) {
final SVNRevision revision = SVNRevision.create(logEntry.getRevision());
myRevisionNumber = new SvnRevisionNumber(revision);
myPegRevision = pegRevision;
myRevision = revision;
myAuthor = logEntry.getAuthor();
myDate = logEntry.getDate();
myCommitMessage = logEntry.getMessage();
myCopyFromPath = copyFromPath;
myVCS = vcs;
myURL = url;
myMergeSources = new ArrayList<SvnFileRevision>();
}
示例4: doMkdir
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
protected static void doMkdir(final SVNURL url, final String comment, final Project project) {
final Ref<Exception> exception = new Ref<Exception>();
Runnable command = new Runnable() {
public void run() {
ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
if (progress != null) {
progress.setText(SvnBundle.message("progress.text.browser.creating", url.toString()));
}
SvnVcs vcs = SvnVcs.getInstance(project);
SvnTarget target = SvnTarget.fromURL(url);
try {
vcs.getFactoryFromSettings().createBrowseClient().createDirectory(target, comment, false);
}
catch (VcsException e) {
exception.set(e);
}
}
};
ProgressManager.getInstance().runProcessWithProgressSynchronously(command, SvnBundle.message("progress.text.create.remote.folder"), false, project);
if (!exception.isNull()) {
Messages.showErrorDialog(exception.get().getMessage(), SvnBundle.message("message.text.error"));
}
}
示例5: execute
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
protected void execute(Project project,
final SvnVcs activeVcs,
final VirtualFile file,
DataContext context,
AbstractVcsHelper helper) throws VcsException {
if (file.isDirectory()) {
perform(project, activeVcs, file, context);
ApplicationManager.getApplication().runWriteAction(new Runnable() {
public void run() {
file.refresh(false, true);
}
});
doVcsRefresh(project, file);
}
else {
perform(project, activeVcs, file, context);
ApplicationManager.getApplication().runWriteAction(new Runnable() {
public void run() {
file.refresh(false, true);
}
});
doVcsRefresh(project, file);
}
}
示例6: update
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
public void update(final AnActionEvent e) {
final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
final Presentation presentation = e.getPresentation();
if (project == null) {
presentation.setEnabled(false);
presentation.setVisible(false);
return;
}
presentation.setText(SvnBundle.message("configure.branches.item"));
presentation.setDescription(SvnBundle.message("configure.branches.item"));
presentation.setIcon(SvnIcons.ConfigureBranches);
presentation.setVisible(true);
final ChangeList[] cls = e.getData(VcsDataKeys.CHANGE_LISTS);
presentation.setEnabled((cls != null) && (cls.length > 0) &&
(SvnVcs.getInstance(project).getName().equals(((CommittedChangeList) cls[0]).getVcs().getName())) &&
(((SvnChangeList) cls[0]).getRoot() != null));
}
示例7: getState
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
public ConfigurationBean getState() {
final ConfigurationBean result = new ConfigurationBean();
result.myVersion = myConfigurationBean.myVersion;
final UrlSerializationHelper helper = new UrlSerializationHelper(SvnVcs.getInstance(myProject));
for (VirtualFile root : myBunch.getMapCopy().keySet()) {
final String key = root.getPath();
final SvnBranchConfigurationNew configOrig = myBunch.getConfig(root);
final SvnBranchConfiguration configuration =
new SvnBranchConfiguration(configOrig.getTrunkUrl(), configOrig.getBranchUrls(), configOrig.isUserinfoInUrl());
result.myConfigurationMap.put(key, helper.prepareForSerialization(configuration));
}
result.mySupportsUserInfoFilter = true;
return result;
}
示例8: initRoot
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
@Nullable
private static SVNURL initRoot(final Project project, final SVNURL url) throws SvnBindException {
final Ref<SVNURL> result = new Ref<SVNURL>();
final Ref<SvnBindException> excRef = new Ref<SvnBindException>();
ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
public void run() {
try {
result.set(SvnUtil.getRepositoryRoot(SvnVcs.getInstance(project), url));
} catch (SvnBindException e) {
excRef.set(e);
}
}
}, "Detecting repository root", true, project);
if (! excRef.isNull()) {
throw excRef.get();
}
return result.get();
}
示例9: testRollbackRenameDir
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
@Test
public void testRollbackRenameDir() throws Exception {
final VirtualFile child = prepareDirectoriesForRename();
renameFileInCommand(child, "newchild");
final ChangeListManager changeListManager = ChangeListManager.getInstance(myProject);
changeListManager.ensureUpToDate(false);
final Change change = changeListManager.getChange(myWorkingCopyDir.findChild("newchild"));
Assert.assertNotNull(change);
final List<VcsException> exceptions = new ArrayList<VcsException>();
SvnVcs.getInstance(myProject).getRollbackEnvironment().rollbackChanges(Collections.singletonList(change), exceptions,
RollbackProgressListener.EMPTY);
Assert.assertTrue(exceptions.isEmpty());
Assert.assertFalse(new File(myWorkingCopyDir.getPath(), "newchild").exists());
Assert.assertTrue(new File(myWorkingCopyDir.getPath(), "child").exists());
}
示例10: getState
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
public MergeCheckResult getState(@NotNull WCInfoWithBranches info,
@NotNull SvnChangeList list,
@NotNull WCInfoWithBranches.Branch selectedBranch,
final String branchPath) {
MyCurrentUrlData rootMapping = myCurrentUrlMapping.get(info.getRootUrl());
BranchInfo mergeChecker = null;
if (rootMapping == null) {
rootMapping = new MyCurrentUrlData();
myCurrentUrlMapping.put(info.getRootUrl(), rootMapping);
} else {
mergeChecker = rootMapping.getBranchInfo(branchPath);
}
if (mergeChecker == null) {
mergeChecker = new BranchInfo(SvnVcs.getInstance(myProject), info, selectedBranch);
rootMapping.addBranchInfo(branchPath, mergeChecker);
}
return mergeChecker.checkList(list, branchPath);
}
示例11: isEnabled
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
private boolean isEnabled(AnActionEvent e) {
final DataContext dc = e.getDataContext();
final Project project = CommonDataKeys.PROJECT.getData(dc);
if (project == null || project.isDefault()) return false;
final VirtualFile[] files = ProjectLevelVcsManager.getInstance(project).getRootsUnderVcs(SvnVcs.getInstance(project));
return files != null && files.length > 0;
}
示例12: getDefaultConfiguration
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
@NotNull
private static SvnBranchConfigurationNew getDefaultConfiguration(@NotNull SvnVcs vcs, @NotNull SVNURL url)
throws SVNException, VcsException {
SvnBranchConfigurationNew result = new SvnBranchConfigurationNew();
result.setTrunkUrl(url.toString());
SVNURL branchLocationsParent = getBranchLocationsParent(url);
if (branchLocationsParent != null) {
SvnTarget target = SvnTarget.fromURL(branchLocationsParent);
vcs.getFactory(target).createBrowseClient().list(target, SVNRevision.HEAD, Depth.IMMEDIATES, createHandler(result, target.getURL()));
}
return result;
}
示例13: setUp
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
//System.setProperty(FileWatcher.PROPERTY_WATCHER_DISABLED, "false");
super.setUp();
clManager = (ChangeListManagerImpl) ChangeListManager.getInstance(myProject);
myVcsDirtyScopeManager = VcsDirtyScopeManager.getInstance(myProject);
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
myVcs = SvnVcs.getInstance(myProject);
}
示例14: setUp
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
super.setUp();
myDirtyScopeManager = VcsDirtyScopeManager.getInstance(myProject);
myChangeListManager = ChangeListManager.getInstance(myProject);
myVcs = SvnVcs.getInstance(myProject);
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
}
示例15: isEnabled
import org.jetbrains.idea.svn.SvnVcs; //导入依赖的package包/类
protected boolean isEnabled(final Project project, final SvnVcs vcs, final VirtualFile file) {
final boolean result = isEnabledImpl(vcs, file);
if (result) {
myListener.onFileEnabled(file);
}
return result;
}