本文整理汇总了Java中org.jetbrains.idea.svn.SvnVcs.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java SvnVcs.getInstance方法的具体用法?Java SvnVcs.getInstance怎么用?Java SvnVcs.getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jetbrains.idea.svn.SvnVcs
的用法示例。
在下文中一共展示了SvnVcs.getInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCopyDir
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
@Test
public void testCopyDir() throws Exception {
final File trunk = new File(myTempDirFixture.getTempDirPath(), "trunk");
trunk.mkdir();
Thread.sleep(100);
final File folder = new File(trunk, "folder");
folder.mkdir();
Thread.sleep(100);
new File(folder, "f1.txt").createNewFile();
new File(folder, "f2.txt").createNewFile();
Thread.sleep(100);
runInAndVerifyIgnoreOutput("import", "-m", "test", trunk.getAbsolutePath(), myRepoUrl + "/trunk");
runInAndVerifyIgnoreOutput("copy", "-m", "test", myRepoUrl + "/trunk", myRepoUrl + "/branch");
final SvnVcs vcs = SvnVcs.getInstance(myProject);
vcs.invokeRefreshSvnRoots();
final CommittedChangesProvider<SvnChangeList,ChangeBrowserSettings> committedChangesProvider = vcs.getCommittedChangesProvider();
final List<SvnChangeList> changeListList =
committedChangesProvider.getCommittedChanges(committedChangesProvider.createDefaultSettings(),
new SvnRepositoryLocation(myRepoUrl + "/branch"), 0);
checkList(changeListList, 2, new Data[] {new Data(new File(myWorkingCopyDir.getPath(), "branch").getAbsolutePath(), FileStatus.ADDED, "- copied from /trunk")});
}
示例2: isBinary
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
public boolean isBinary(@NotNull final VirtualFile file) {
SvnVcs vcs = SvnVcs.getInstance(myProject);
try {
File ioFile = new File(file.getPath());
PropertyClient client = vcs.getFactory(ioFile).createPropertyClient();
PropertyValue value = client.getProperty(SvnTarget.fromFile(ioFile), SvnPropertyKeys.SVN_MIME_TYPE, false, SVNRevision.WORKING);
if (value != null && isBinaryMimeType(value.toString())) {
return true;
}
}
catch (VcsException e) {
LOG.warn(e);
}
return false;
}
示例3: init
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
protected void init() {
super.init();
SvnVcs vcs = SvnVcs.getInstance(myProject);
String revStr = "";
Info info = vcs.getInfo(mySrcFile);
if (info != null) {
mySrcURL = info.getURL() == null ? null : info.getURL().toString();
revStr = String.valueOf(info.getRevision());
myURL = mySrcURL;
}
if (myURL == null) {
return;
}
myWorkingCopyField.setText(mySrcFile.toString());
myRepositoryField.setText(mySrcURL);
myToURLText.setText(myURL);
myRevisionPanel.setRevisionText(revStr);
updateControls();
myWorkingCopyRadioButton.setSelected(true);
}
示例4: setUp
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
@Override
protected void setUp() throws Exception {
EdtTestUtil.runInEdtAndWait((Runnable)() -> {
try {
SvnAuthenticationTest.super.setUp();
}
catch (Exception e) {
throw new RuntimeException(e);
}
});
myConfiguration = SvnConfiguration.getInstance(myProject);
final String configPath = myProject.getBaseDir().getPath() + File.separator + "Subversion";
myConfiguration.setConfigurationDirParameters(false, configPath);
final File configFile = new File(configPath);
myFilesToDelete.add(configFile);
SvnVcs vcs = SvnVcs.getInstance(myProject);
myAuthenticationManager = new SvnAuthenticationManager(myProject, configFile);
myInteractiveProvider = new SvnTestInteractiveAuthentication(myAuthenticationManager);
myAuthenticationManager.setAuthenticationProvider(new SvnAuthenticationProvider(vcs, myInteractiveProvider, myAuthenticationManager));
myAuthenticationManager.setRuntimeStorage(SvnConfiguration.RUNTIME_AUTH_CACHE);
myTestInteraction = new TestInteraction();
myAuthenticationManager.setInteraction(myTestInteraction);
SVNConfigFile.createDefaultConfiguration(configFile);
}
示例5: resolve
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
private void resolve(Project project, Ref<VcsException> exception, FilePath path) {
SvnVcs vcs = SvnVcs.getInstance(project);
try {
vcs.getFactory(path.getIOFile()).createConflictClient().resolve(path.getIOFile(), Depth.EMPTY, false, false, true);
}
catch (VcsException e) {
exception.set(e);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:MarkLocallyDeletedTreeConflictResolvedAction.java
示例6: loadContent
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
private List<PropertyData> loadContent() throws VcsException {
final SvnVcs vcs = SvnVcs.getInstance(myProject);
final Ref<List<PropertyData>> ref = new Ref<List<PropertyData>>();
final Ref<VcsException> exceptionRef = new Ref<VcsException>();
final Runnable runnable = new Runnable() {
@Override
public void run() {
try {
ref.set(AbstractShowPropertiesDiffAction.getPropertyList(vcs, myUrl, ((SvnRevisionNumber)myNumber).getRevision()));
}
catch (VcsException e) {
exceptionRef.set(e);
}
}
};
if (ApplicationManager.getApplication().isDispatchThread()) {
final boolean completed = ProgressManager.getInstance()
.runProcessWithProgressSynchronously(runnable, SvnBundle.message("progress.title.loading.file.properties"), true, myProject);
if (!completed) {
throw new VcsException("Properties load for revision " + getRevisionNumber().asString() + " was canceled.");
}
}
else {
runnable.run();
}
if (!exceptionRef.isNull()) throw exceptionRef.get();
return ref.get();
}
示例7: setUp
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
@Override
public void setUp() throws Exception {
super.setUp();
clManager = ChangeListManager.getInstance(myProject);
myVcs = SvnVcs.getInstance(myProject);
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
}
示例8: testMoveDirChangeFile
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
@Test
public void testMoveDirChangeFile() throws Exception {
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
VirtualFile d1 = createDirInCommand(myWorkingCopyDir, "d1");
VirtualFile d2 = createDirInCommand(myWorkingCopyDir, "d2");
VirtualFile f11 = createFileInCommand(d1, "f11.txt", "123\n456");
VirtualFile f12 = createFileInCommand(d1, "f12.txt", "----");
// r1, addition without history
checkin();
final String oldPath = absPath(d1);
final String oldF11Path = new File(f11.getPath()).getAbsolutePath();
moveFileInCommand(d1, d2);
VcsTestUtil.editFileInCommand(myProject, f11, "new");
Thread.sleep(100);
checkin();
final SvnVcs vcs = SvnVcs.getInstance(myProject);
vcs.invokeRefreshSvnRoots();
final CommittedChangesProvider<SvnChangeList,ChangeBrowserSettings> committedChangesProvider = vcs.getCommittedChangesProvider();
final List<SvnChangeList> changeListList =
committedChangesProvider.getCommittedChanges(committedChangesProvider.createDefaultSettings(),
new SvnRepositoryLocation(myRepoUrl), 0);
checkList(changeListList, 2, new Data[] {new Data(absPath(d1), FileStatus.MODIFIED, "- moved from .." + File.separatorChar + "d1"),
new Data(absPath(f11), FileStatus.MODIFIED, "- moved from " + oldF11Path)});
}
示例9: SetPropertyDialog
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
public SetPropertyDialog(Project project, File[] files, String name, boolean allowRecursion) {
super(project, true);
myFiles = files;
myPropertyName = name;
myIsRecursionAllowed = allowRecursion;
myVCS = SvnVcs.getInstance(project);
setResizable(true);
setTitle(SvnBundle.message("dialog.title.set.property"));
getHelpAction().setEnabled(true);
init();
}
示例10: resolveAllBranchPoints
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
@NotNull
private Set<Pair<VirtualFile, SvnBranchConfigurationNew>> resolveAllBranchPoints() {
final LocalFileSystem lfs = LocalFileSystem.getInstance();
final UrlSerializationHelper helper = new UrlSerializationHelper(SvnVcs.getInstance(myProject));
final Set<Pair<VirtualFile, SvnBranchConfigurationNew>> branchPointsToLoad = ContainerUtil.newHashSet();
for (Map.Entry<String, SvnBranchConfiguration> entry : myConfigurationBean.myConfigurationMap.entrySet()) {
final SvnBranchConfiguration configuration = entry.getValue();
final VirtualFile root = lfs.refreshAndFindFileByIoFile(new File(entry.getKey()));
if (root == null) {
LOG.info("root not found: " + entry.getKey());
continue;
}
final SvnBranchConfiguration configToConvert;
if ((! myConfigurationBean.mySupportsUserInfoFilter) || configuration.isUserinfoInUrl()) {
configToConvert = helper.afterDeserialization(entry.getKey(), configuration);
} else {
configToConvert = configuration;
}
final SvnBranchConfigurationNew newConfig = new SvnBranchConfigurationNew();
newConfig.setTrunkUrl(configToConvert.getTrunkUrl());
newConfig.setUserinfoInUrl(configToConvert.isUserinfoInUrl());
for (String branchUrl : configToConvert.getBranchUrls()) {
List<SvnBranchItem> stored = getStored(branchUrl);
if (stored != null && ! stored.isEmpty()) {
newConfig.addBranches(branchUrl, new InfoStorage<List<SvnBranchItem>>(stored, InfoReliability.setByUser));
} else {
branchPointsToLoad.add(Pair.create(root, newConfig));
newConfig.addBranches(branchUrl, new InfoStorage<List<SvnBranchItem>>(new ArrayList<SvnBranchItem>(), InfoReliability.empty));
}
}
myBunch.updateForRoot(root, new InfoStorage<SvnBranchConfigurationNew>(newConfig, InfoReliability.setByUser), false);
}
return branchPointsToLoad;
}
示例11: setUp
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
@Override
@Before
public void setUp() throws Exception {
super.setUp();
myVcs = SvnVcs.getInstance(myProject);
myChangeListManager = ChangeListManager.getInstance(myProject);
myDirtyScopeManager = VcsDirtyScopeManager.getInstance(myProject);
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
enableSilentOperation(VcsConfiguration.StandardConfirmation.REMOVE);
myIsClosed = false;
myIsClosed1 = false;
}
示例12: reloadBranches
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
public void reloadBranches(@NotNull VirtualFile root, @Nullable SvnBranchConfigurationNew prev, @NotNull SvnBranchConfigurationNew next) {
final Set<String> oldUrls = (prev == null) ? Collections.<String>emptySet() : new HashSet<String>(prev.getBranchUrls());
final SvnVcs vcs = SvnVcs.getInstance(myProject);
if (!vcs.isVcsBackgroundOperationsAllowed(root)) return;
for (String newBranchUrl : next.getBranchUrls()) {
// check if cancel had been put
if (!vcs.isVcsBackgroundOperationsAllowed(root)) return;
if (!oldUrls.contains(newBranchUrl)) {
reloadBranches(root, newBranchUrl, InfoReliability.defaultValues, true);
}
}
}
示例13: prepareBranchesStructure
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
public String prepareBranchesStructure() throws Exception {
final SvnVcs vcs = SvnVcs.getInstance(myProject);
final String mainUrl = myRepoUrl + "/trunk";
runInAndVerifyIgnoreOutput("mkdir", "-m", "mkdir", mainUrl);
runInAndVerifyIgnoreOutput("mkdir", "-m", "mkdir", myRepoUrl + "/branches");
runInAndVerifyIgnoreOutput("mkdir", "-m", "mkdir", myRepoUrl + "/tags");
final ChangeListManagerImpl clManager = (ChangeListManagerImpl)ChangeListManager.getInstance(myProject);
clManager.stopEveryThingIfInTestMode();
sleep(100);
boolean deleted = false;
for (int i = 0; i < 5; i++) {
deleted = FileUtil.delete(new File(myWorkingCopyDir.getPath() + File.separator + ".svn"));
if (deleted) break;
sleep(200);
}
assertTrue(deleted);
sleep(200);
myWorkingCopyDir.refresh(false, true);
runInAndVerifyIgnoreOutput("co", mainUrl, myWorkingCopyDir.getPath());
enableSilentOperation(VcsConfiguration.StandardConfirmation.ADD);
final SubTree tree = new SubTree(myWorkingCopyDir);
checkin();
final String branchUrl = myRepoUrl + "/branches/b1";
runInAndVerifyIgnoreOutput("copy", "-q", "-m", "coppy", mainUrl, branchUrl);
clManager.forceGoInTestMode();
refreshSvnMappingsSynchronously();
//clManager.ensureUpToDate(false);
//clManager.ensureUpToDate(false);
return branchUrl;
}
示例14: testCopyAndModify
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
@Test
public void testCopyAndModify() throws Exception {
final File trunk = new File(myTempDirFixture.getTempDirPath(), "trunk");
trunk.mkdir();
Thread.sleep(100);
final File folder = new File(trunk, "folder");
folder.mkdir();
Thread.sleep(100);
new File(folder, "f1.txt").createNewFile();
new File(folder, "f2.txt").createNewFile();
Thread.sleep(100);
runInAndVerifyIgnoreOutput("import", "-m", "test", trunk.getAbsolutePath(), myRepoUrl + "/trunk");
update();
runInAndVerifyIgnoreOutput("copy", myWorkingCopyDir.getPath() + "/trunk", myWorkingCopyDir.getPath() + "/branch");
runInAndVerifyIgnoreOutput("propset", "testprop", "testval", myWorkingCopyDir.getPath() + "/branch/folder");
checkin();
final SvnVcs vcs = SvnVcs.getInstance(myProject);
vcs.invokeRefreshSvnRoots();
final CommittedChangesProvider<SvnChangeList,ChangeBrowserSettings> committedChangesProvider = vcs.getCommittedChangesProvider();
final List<SvnChangeList> changeListList =
committedChangesProvider.getCommittedChanges(committedChangesProvider.createDefaultSettings(),
new SvnRepositoryLocation(myRepoUrl + "/branch"), 0);
checkList(changeListList, 2, new Data[] {new Data(new File(myWorkingCopyDir.getPath(), "branch").getAbsolutePath(), FileStatus.ADDED, "- copied from /trunk"),
new Data(new File(myWorkingCopyDir.getPath(), "branch/folder").getAbsolutePath(), FileStatus.MODIFIED, "- copied from /trunk/folder")});
}
示例15: getRepositoryBrowser
import org.jetbrains.idea.svn.SvnVcs; //导入方法依赖的package包/类
protected RepositoryBrowserComponent getRepositoryBrowser() {
if (myRepositoryBrowser == null) {
myRepositoryBrowser = new RepositoryBrowserComponent(SvnVcs.getInstance(myProject));
myRepositoryBrowser.setPreferredSize(new Dimension(300, 300));
}
return myRepositoryBrowser;
}