/** passed dir must be under VC control (it is assumed) */ @Nullable public String getRepositoryUUID(final Project project, final VirtualFile dir) { try { final SVNInfo info1 = new RepeatSvnActionThroughBusy() { @Override protected void executeImpl() throws SVNException { myT = myVcs.getInfo(new File(dir.getPath())); } }.compute(); if (info1 == null || info1.getRepositoryUUID() == null) { // go deeper if current parent was added (if parent was added, it theoretically could NOT // know its repo UUID) final VirtualFile parent = dir.getParent(); if (parent == null) { return null; } if (isPendingAdd(project, parent)) { return getRepositoryUUID(project, parent); } } else { return info1.getRepositoryUUID(); } } catch (SVNException e) { // go to return default } return null; }
public SVNInfo getInfo(File ioFile) { try { SVNWCClient wcClient = createWCClient(); SVNInfo info = wcClient.doInfo(ioFile, SVNRevision.UNDEFINED); if (info == null || info.getRepositoryRootURL() == null) { info = wcClient.doInfo(ioFile, SVNRevision.HEAD); } return info; } catch (SVNException e) { return null; } }