当前位置: 首页>>代码示例>>Java>>正文


Java SvnUtil类代码示例

本文整理汇总了Java中org.jetbrains.idea.svn.SvnUtil的典型用法代码示例。如果您正苦于以下问题:Java SvnUtil类的具体用法?Java SvnUtil怎么用?Java SvnUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

SvnUtil类属于org.jetbrains.idea.svn包,在下文中一共展示了SvnUtil类的39个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: updateInfo

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Override
protected void updateInfo(Attributes attributes, SvnInfoStructure structure) throws SAXException {
  final String kind = attributes.getValue("kind");
  assertSAX(! StringUtil.isEmptyOrSpaces(kind));
  structure.myKind = NodeKind.from(kind);

  if (myBase != null) {
    final String path = attributes.getValue("path");
    assertSAX(!StringUtil.isEmptyOrSpaces(path));
    structure.myFile = SvnUtil.resolvePath(myBase, path);
  }

  final String revision = attributes.getValue("revision");
  assertSAX(! StringUtil.isEmptyOrSpaces(revision));
  try {
    final long number = Long.parseLong(revision);
    structure.myRevision = number;
  } catch (NumberFormatException e) {
    structure.myRevision = -1;
    //throw new SAXException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:SvnInfoHandler.java


示例2: checkPath

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@NotNull
public SvnMergeInfoCache.MergeCheckResult checkPath(@NotNull String repositoryRelativePath, long revisionNumber) {
  String sourceRelativePath =
    SVNPathUtil.getRelativePath(myMergeContext.getRepositoryRelativeSourcePath(), SvnUtil.ensureStartSlash(repositoryRelativePath));
  SvnMergeInfoCache.MergeCheckResult result;

  if (sourceRelativePath == null) {
    // TODO: SVNPathUtil.getRelativePath() is @NotNull - probably we need to check also isEmpty() here?
    result = SvnMergeInfoCache.MergeCheckResult.NOT_EXISTS;
  }
  else {
    InfoProcessor processor = new InfoProcessor(sourceRelativePath, myMergeContext.getRepositoryRelativeSourcePath(), revisionNumber);

    synchronized (myMergeInfoLock) {
      myMergeInfoMap.getSimiliar(toKey(sourceRelativePath), processor);
    }

    result = SvnMergeInfoCache.MergeCheckResult.getInstance(processor.isMerged());
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:OneShotMergeInfoHelper.java


示例3: parseForPath

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Nullable
private File parseForPath(@NotNull String line) {
  File result = null;
  int start = line.indexOf('\'');

  if (start != -1) {
    int end = line.indexOf('\'', start + 1);

    if (end != -1) {
      String path = line.substring(start + 1, end);
      result = SvnUtil.resolvePath(myBase, path);
    }
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:UpdateOutputLineConverter.java


示例4: cleanup

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
private void cleanup(@NotNull CommandExecutor executor, @NotNull File workingDirectory) throws SvnBindException {
  if (executor.getCommandName().isWriteable()) {
    File wcRoot = SvnUtil.getWorkingCopyRootNew(workingDirectory);

    // not all commands require cleanup - for instance, some commands operate only with repository - like "svn info <url>"
    // TODO: check if we could "configure" commands (or make command to explicitly ask) if cleanup is required - not to search
    // TODO: working copy root each time
    if (wcRoot != null) {
      Command cleanupCommand = new Command(SvnCommandName.cleanup);
      cleanupCommand.setWorkingDirectory(wcRoot);

      newExecutor(cleanupCommand).run();
    } else {
      LOG.info("Could not execute cleanup for command " + executor.getCommandText());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:CommandRuntime.java


示例5: serializeUrl

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
private static String serializeUrl(final String url, final Ref<Boolean> withUserInfo) {
  if (Boolean.FALSE.equals(withUserInfo.get())) {
    return url;
  }
  try {
    final SVNURL svnurl = SVNURL.parseURIEncoded(url);
    if (withUserInfo.isNull()) {
      final String userInfo = svnurl.getUserInfo();
      withUserInfo.set((userInfo != null) && (userInfo.length() > 0));
    }
    if (withUserInfo.get()) {
      return SVNURL.create(svnurl.getProtocol(), null, svnurl.getHost(), SvnUtil.resolvePort(svnurl), svnurl.getURIEncodedPath(), true)
        .toString();
    }
  }
  catch (SVNException e) {
    //
  }
  return url;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:UrlSerializationHelper.java


示例6: openDialog

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Nullable
private static SelectLocationDialog openDialog(Project project,
                                               String url,
                                               String dstLabel,
                                               String dstName,
                                               boolean showFiles,
                                               boolean allowActions,
                                               String errorMessage) {
  try {
    SVNURL svnUrl = SvnUtil.createUrl(url);
    final SVNURL repositoryUrl = initRoot(project, svnUrl);
    if (repositoryUrl == null) {
      Messages.showErrorDialog(project, "Can not detect repository root for URL: " + url,
                               SvnBundle.message("dialog.title.select.repository.location"));
      return null;
    }
    SelectLocationDialog dialog = new SelectLocationDialog(project, repositoryUrl, dstLabel, dstName, showFiles, allowActions);
    dialog.show();
    return dialog;
  }
  catch (SvnBindException e) {
    Messages.showErrorDialog(project, errorMessage != null ? errorMessage : e.getMessage(),
                             SvnBundle.message("dialog.title.select.repository.location"));
    return null;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SelectLocationDialog.java


示例7: initRoot

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SelectLocationDialog.java


示例8: refreshChangeListsFindConflicts

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
private void refreshChangeListsFindConflicts(final UpdatedFiles updatedFiles) {
  UpdateFilesHelper.iterateFileGroupFiles(updatedFiles,
                                          new UpdateFilesHelper.Callback() {
                                            public void onFile(final String filePath, final String groupId) {
                                              final VirtualFile vf = SvnUtil.getVirtualFile(filePath);
                                              if (vf != null) {
                                                // refresh base directory so that conflict files should be detected
                                                // file itself is already refreshed
                                                vf.getParent().refresh(false, false);
                                                myDirtyScopeManager.fileDirty(vf);
                                              }
                                              if (FileGroup.MERGED_WITH_CONFLICT_ID.equals(groupId)) {
                                                myConflictedVirtualFiles.add(vf);
                                              }
                                            }
                                          });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ResolveWorker.java


示例9: createInfo

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Nullable
private WCInfoWithBranches createInfo(@NotNull WCInfo info) {
  if (!info.getFormat().supportsMergeInfo()) {
    return null;
  }

  final String url = info.getUrl().toString();
  if (myLocation != null && !myLocation.toPresentableString().startsWith(url) && !url.startsWith(myLocation.toPresentableString())) {
    return null;
  }
  if (!SvnUtil.checkRepositoryVersion15(myVcs, url)) {
    return null;
  }

  // check of WC version
  RootUrlInfo rootForUrl = myVcs.getSvnFileUrlMapping().getWcRootForUrl(url);
  return rootForUrl != null ? createInfoWithBranches(info, rootForUrl) : null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:WcInfoLoader.java


示例10: handleEvent

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
public void handleEvent(SVNEvent event, double p) {
  final String path = SvnUtil.getPathForProgress(event);
  if (path == null) {
    return;
  }
  if (event.getAction() == SVNEventAction.COMMIT_ADDED) {
    myProgress.setText2(SvnBundle.message("progress.text2.adding", path));
  }
  else if (event.getAction() == SVNEventAction.COMMIT_DELETED) {
    myProgress.setText2(SvnBundle.message("progress.text2.deleting", path));
  }
  else if (event.getAction() == SVNEventAction.COMMIT_MODIFIED) {
    myProgress.setText2(SvnBundle.message("progress.text2.sending", path));
  }
  else if (event.getAction() == SVNEventAction.COMMIT_REPLACED) {
    myProgress.setText2(SvnBundle.message("progress.text2.replacing", path));
  }
  else if (event.getAction() == SVNEventAction.COMMIT_DELTA_SENT) {
    myProgress.setText2(SvnBundle.message("progress.text2.transmitting.delta", path));
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:CopyEventHandler.java


示例11: run

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Override
public void run(ContinuationContext context) {
  try {
    final List<TaskDescriptor> tasks = new LinkedList<TaskDescriptor>();
    final boolean supportsMergeinfo = myWcInfo.getFormat().supportsMergeInfo() &&
                                      SvnUtil.doesRepositorySupportMergeInfo(myVcs, SVNURL.parseURIEncoded(mySourceUrl));
    if (! supportsMergeinfo) {
      insertMergeAll(tasks);
    } else {
      tasks.add(new MergeAllOrSelectedChooser());
    }
    context.next(tasks);
  }
  catch (SVNException e) {
    finishWithError(context, e.getMessage(), true);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:QuickMerge.java


示例12: checkForOutsideCopies

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
public void checkForOutsideCopies() {
  boolean canceled = false;
  for (Iterator<WCInfo> iterator = myWcInfos.iterator(); iterator.hasNext();) {
    final WCInfo wcInfo = iterator.next();
    if (! wcInfo.isIsWcRoot()) {
      File path = new File(wcInfo.getPath());
      path = SvnUtil.getWorkingCopyRoot(path);
      int result = Messages.showYesNoCancelDialog(SvnBundle.message("upgrade.format.clarify.for.outside.copies.text", path),
                                                  SvnBundle.message("action.change.wcopy.format.task.title"),
                                                  Messages.getWarningIcon());
      if (DialogWrapper.CANCEL_EXIT_CODE == result) {
        canceled = true;
        break;
      } else if (DialogWrapper.OK_EXIT_CODE != result) {
        // no - for this copy only. maybe other
        iterator.remove();
      }
    }
  }
  if (canceled) {
    myWcInfos.clear();
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:SvnFormatWorker.java


示例13: SvnRepositoryContentRevision

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
SvnRepositoryContentRevision(final SvnVcs vcs, final String repositoryRoot, final String path, @Nullable final FilePath localPath,
                                    final long revision) {
  myVcs = vcs;
  myPath = path;
  myRepositoryRoot = repositoryRoot;
  if (localPath != null) {
    myFilePath = localPath;
  }
  else {
    FilePath local;
    try {
      final String fullPath = SvnUtil.appendMultiParts(repositoryRoot, myPath);
      local = VcsContextFactory.SERVICE.getInstance().createFilePathOnNonLocal(fullPath, false);
    }
    catch (SVNException e) {
      // todo what to do safely?
      local = VcsContextFactory.SERVICE.getInstance().createFilePathOnNonLocal(repositoryRoot, false);
    }
    myFilePath = local;
  }
  myRevision = revision;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:SvnRepositoryContentRevision.java


示例14: run

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Override
public void run(@NotNull ProgressIndicator indicator) {
  final SVNWCClient client = myVcs.createWCClient();
  final String url = myLocation.getURL();
  final SVNURL root;
  try {
    root = SvnUtil.getRepositoryRoot(myVcs, SVNURL.parseURIEncoded(url), true);
    if (root == null) {
      myException = new VcsException("Can not determine repository root for URL: " + url);
      return;
    }
    client.doSetRevisionProperty(root, SVNRevision.create(myNumber), "svn:log",
                                 SVNPropertyValue.create(myNewMessage), false, null);
  }
  catch (SVNException e) {
    myException = new VcsException(e);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:SvnEditCommitMessageAction.java


示例15: statusFor

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@NotNull
public FileStatus statusFor(@NotNull SvnVcs svn, @NotNull Project project, @NotNull VirtualFile vFile) {
    File currentFile = VfsUtilCore.virtualToIoFile(vFile);
    SVNURL fileUrl = SvnUtil.getUrl(svn, currentFile);
    if (fileUrl != null) {
        Info info = svn.getInfo(vFile);
        if (info != null) {
            SvnConfiguration svnConfig = SvnConfiguration.getInstance(project);
            Optional<FileStatus> status;
            if (svnConfig.isCommandLine()) {
                status = statusForCli(project, fileUrl, currentFile);                    
            } else {
                status = statusForSvnKit(info, svn, fileUrl, currentFile);                    
            }
            if (status.isPresent()) {
                return status.get();
            }
        } else {
            return new FileStatus(fileUrl);
        }
    }
    return FileStatus.EMPTY;
}
 
开发者ID:zielu,项目名称:SVNToolBox,代码行数:24,代码来源:FileStatusCalculator.java


示例16: batchPerform

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
protected void batchPerform(Project project, SvnVcs activeVcs, VirtualFile[] files, DataContext context)
  throws VcsException {
  File[] ioFiles = new File[files.length];
  for (int i = 0; i < files.length; i++) {
    VirtualFile virtualFile = files[i];
    ioFiles[i] = new File(virtualFile.getPath());
  }
  SvnUtil.doUnlockFiles(project, activeVcs, ioFiles);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:UnlockAction.java


示例17: execute

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
public void execute(final AnActionEvent e) {
  final DataContext dataContext = e.getDataContext();
  myProject = CommonDataKeys.PROJECT.getData(dataContext);
  if (myProject == null || myProject.isDefault()) {
    // remain false
    return;
  }
  final VirtualFile baseDir = myProject.getBaseDir();
  if (baseDir == null) return;

  final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject);
  final MyCheckResult result = checkMappings(baseDir, vcsManager);

  if (MyCheckResult.disable.equals(result)) return;

  myHadNoMappings = MyCheckResult.notMapped.equals(result);
  if (MyCheckResult.notMapped.equals(result)) {
    // no change list manager working
    if(SvnUtil.seemsLikeVersionedDir(baseDir)) return;
  } else if (SvnStatusUtil.isUnderControl(myProject, baseDir)) {
    return;
  }

  if ((! myHadNoMappings) && (! SvnVcs.getInstance(myProject).getSvnFileUrlMapping().isEmpty())) {
    // there are some versioned dirs under project dir
    return;
  }

  // visible: already checked above
  myVisible = true;
  myEnabled = (! vcsManager.isBackgroundVcsOperationRunning());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:ShareWholeProject.java


示例18: actionPerformed

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  final MyChecker checker = new MyChecker();
  checker.execute(e);
  if (! checker.isEnabled()) return;

  final Project project = checker.getProject();
  final VirtualFile baseDir = project.getBaseDir();
  if (baseDir == null) return;
  boolean success = false;
  boolean excThrown = false;
  try {
    success = ShareProjectAction.share(project, baseDir);
  } catch (VcsException exc) {
    AbstractVcsHelper.getInstance(project).showError(exc, "Failed to Share Project");
    excThrown = true;
  } finally {
    // if success = false -> either action was cancelled or exception was thrown, so also check for exception
    if (success || excThrown) {
      baseDir.refresh(true, true, new Runnable() {
        public void run() {
          ApplicationManager.getApplication().invokeLater(new Runnable() {
            @Override
            public void run() {
              VcsDirtyScopeManager.getInstance(project).dirDirtyRecursively(project.getBaseDir());
              if (checker.isHadNoMappings() && SvnUtil.seemsLikeVersionedDir(baseDir)) {
                final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(project);
                vcsManager.setDirectoryMappings(Arrays.asList(new VcsDirectoryMapping("", SvnVcs.VCS_NAME)));
              }
            }
          }, ModalityState.NON_MODAL, project.getDisposed());
        }
      });
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:ShareWholeProject.java


示例19: batchPerform

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
protected void batchPerform(Project project, SvnVcs activeVcs, VirtualFile[] files, DataContext context)
  throws VcsException {
  File[] ioFiles = new File[files.length];
  for (int i = 0; i < files.length; i++) {
    VirtualFile virtualFile = files[i];
    ioFiles[i] = new File(virtualFile.getPath());
  }
  SvnUtil.doLockFiles(project, activeVcs, ioFiles);

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:LockAction.java


示例20: OneShotMergeInfoHelper

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
public OneShotMergeInfoHelper(@NotNull MergeContext mergeContext) {
  myMergeContext = mergeContext;
  myPartiallyMerged = ContainerUtil.newHashMap();
  myMergeInfoLock = new Object();
  // TODO: Rewrite without AreaMap usage
  myMergeInfoMap = AreaMap.create(new PairProcessor<String, String>() {
    public boolean process(String parentUrl, String childUrl) {
      if (".".equals(parentUrl)) return true;
      return SVNPathUtil.isAncestor(SvnUtil.ensureStartSlash(parentUrl), SvnUtil.ensureStartSlash(childUrl));
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:OneShotMergeInfoHelper.java


示例21: process

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
public boolean process(@NotNull String workingCopyRelativePath, @NotNull Map<String, SVNMergeRangeList> mergedPathsMap) {
  boolean processed = false;
  final boolean isCurrentPath = workingCopyRelativePath.equals(mySourceRelativePath);

  if (mergedPathsMap.isEmpty()) {
    myIsMerged = false;
    processed = true;
  }
  else {
    String mergedPathAffectingSourcePath = ContainerUtil.find(mergedPathsMap.keySet(), new Condition<String>() {
      @Override
      public boolean value(String path) {
        return SVNPathUtil.isAncestor(myRepositoryRelativeSourcePath, SvnUtil.ensureStartSlash(path));
      }
    });

    if (mergedPathAffectingSourcePath != null) {
      SVNMergeRangeList mergeRangeList = mergedPathsMap.get(mergedPathAffectingSourcePath);

      processed = true;
      myIsMerged = ContainerUtil.or(mergeRangeList.getRanges(), new Condition<SVNMergeRange>() {
        @Override
        public boolean value(@NotNull SVNMergeRange range) {
          return BranchInfo.isInRange(range, myRevisionNumber) && (range.isInheritable() || isCurrentPath);
        }
      });
    }
  }

  return processed;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:OneShotMergeInfoHelper.java


示例22: resolveOutputType

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@NotNull
protected Key resolveOutputType(@NotNull String line, @NotNull Key outputType) {
  Key result = outputType;

  if (!ProcessOutputTypes.SYSTEM.equals(outputType)) {
    Matcher errorMatcher = SvnUtil.ERROR_PATTERN.matcher(line);
    Matcher warningMatcher = SvnUtil.WARNING_PATTERN.matcher(line);

    result = errorMatcher.find() || warningMatcher.find() ? ProcessOutputTypes.STDERR : ProcessOutputTypes.STDOUT;
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:TerminalProcessHandler.java


示例23: handleAcceptCertificatePrompt

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
private void handleAcceptCertificatePrompt() {
  // TODO: show 'certificateError' in dialog
  SVNURL url = SvnUtil.parseUrl(serverUrl);
  AcceptResult result = myRuntime.getAuthenticationService().acceptCertificate(url, certificateInfo.toString());

  sendData(result.toString());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:TerminalSslCertificateModule.java


示例24: parseNormalString

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Nullable
private ProgressEvent parseNormalString(final String line) {
  if (line.length() < 5) return null;
  final char first = line.charAt(0);
  if (' ' != first && ! ourActions.contains(first)) return null;
  final StatusType contentsStatus = CommandUtil.getStatusType(first);
  final char second = line.charAt(1);
  final StatusType propertiesStatus = CommandUtil.getStatusType(second);
  final char lock = line.charAt(2); // dont know what to do with stolen lock info
  if (' ' != lock && 'B' != lock) return null;
  final char treeConflict = line.charAt(3);
  if (' ' != treeConflict && 'C' != treeConflict) return null;
  final boolean haveTreeConflict = 'C' == treeConflict;

  final String path = line.substring(4).trim();
  if (StringUtil.isEmptyOrSpaces(path)) return null;
  final File file = SvnUtil.resolvePath(myBase, path);
  if (StatusType.STATUS_OBSTRUCTED.equals(contentsStatus)) {
    // obstructed
    return new ProgressEvent(file, -1, contentsStatus, propertiesStatus, EventAction.UPDATE_SKIP_OBSTRUCTION, null, null);
  }
  
  EventAction action;
  EventAction expectedAction;
  if (StatusType.STATUS_ADDED.equals(contentsStatus)) {
    expectedAction = EventAction.UPDATE_ADD;
  } else if (StatusType.STATUS_DELETED.equals(contentsStatus)) {
    expectedAction = EventAction.UPDATE_DELETE;
  } else {
    expectedAction = EventAction.UPDATE_UPDATE;
  }
  action = expectedAction;
  if (haveTreeConflict) {
    action = EventAction.TREE_CONFLICT;
  }

  return new ProgressEvent(file, -1, contentsStatus, propertiesStatus, action, null, null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:UpdateOutputLineConverter.java


示例25: parseUrl

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Nullable
private SVNURL parseUrl(@NotNull String url) {
  SVNURL result = null;

  try {
    result = SvnUtil.createUrl(url);
  }
  catch (SvnBindException e) {
    myErrorPrompt.setText(e.getMessage());
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:BranchConfigurationDialog.java


示例26: accept

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
public boolean accept(final String url) throws SVNException {
  if (myRootUrl != null) {
    final File baseDir = new File(myRoot.getPath());
    final String baseUrl = myRootUrl.getPath();

    final SVNURL branchUrl = SVNURL.parseURIEncoded(url);
    if (myRootUrl.equals(SVNURLUtil.getCommonURLAncestor(myRootUrl, branchUrl))) {
      final File file = SvnUtil.fileFromUrl(baseDir, baseUrl, branchUrl.getPath());
      myBranchesUnder.put(url, file.getAbsolutePath());
    }
  }
  return false; // iterate everything
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:SvnBranchConfigurationNew.java


示例27: deserializeUrl

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
private static String deserializeUrl(final String url, final String userInfo) {
  try {
    final SVNURL svnurl = SVNURL.parseURIEncoded(url);
    return SVNURL.create(svnurl.getProtocol(), userInfo, svnurl.getHost(), SvnUtil.resolvePort(svnurl), svnurl.getURIEncodedPath(),
                         true).toString();
  } catch (SVNException e) {
    return url;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:UrlSerializationHelper.java


示例28: run

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
public void run(@NotNull final ProgressIndicator indicator) {
  ProjectLevelVcsManager.getInstanceChecked(myProject).startBackgroundVcsOperation();
  indicator.setIndeterminate(true);
  final boolean supportsChangelists = myNewFormat.supportsChangelists();
  if (supportsChangelists) {
    myBeforeChangeLists = ChangeListManager.getInstance(myProject).getChangeListsCopy();
  }

  try {
    for (WCInfo wcInfo : myWcInfos) {
      File path = new File(wcInfo.getPath());
      if (! wcInfo.isIsWcRoot()) {
        path = SvnUtil.getWorkingCopyRoot(path);
      }
      try {
        String cleanupMessage = SvnBundle.message("action.Subversion.cleanup.progress.text", path.getAbsolutePath());
        String upgradeMessage =
          SvnBundle.message("action.change.wcopy.format.task.progress.text", path.getAbsolutePath(), wcInfo.getFormat(), myNewFormat);
        ProgressTracker handler = createUpgradeHandler(indicator, cleanupMessage, upgradeMessage);

        getFactory(path, myNewFormat).createUpgradeClient().upgrade(path, myNewFormat, handler);
      } catch (Throwable e) {
        myExceptions.add(e);
      }
    }
  }
  finally {
    ProjectLevelVcsManager.getInstance(myProject).stopBackgroundVcsOperation();

    // to map to native
    if (supportsChangelists) {
      SvnVcs.getInstance(myProject).processChangeLists(myBeforeChangeLists);
    }

    ApplicationManager.getApplication().getMessageBus().syncPublisher(SvnVcs.WC_CONVERTED).run();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:SvnFormatWorker.java


示例29: createChange

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@NotNull
private Change createChange(@NotNull SvnTarget target1, @NotNull SvnTarget target2, @NotNull DiffPath diffPath) throws SvnBindException {
  // TODO: 1) Unify logic of creating Change instance with SvnDiffEditor and SvnChangeProviderContext
  // TODO: 2) If some directory is switched, files inside it are returned as modified in "svn diff --summarize", even if they are equal
  // TODO: to branch files by content - possibly add separate processing of all switched files
  // TODO: 3) Properties change is currently not added as part of result change like in SvnChangeProviderContext.patchWithPropertyChange

  SvnTarget subTarget1 = SvnUtil.append(target1, diffPath.path, true);
  String relativePath = SvnUtil.getRelativeUrl(SvnUtil.toDecodedString(target1), SvnUtil.toDecodedString(subTarget1));

  if (relativePath == null) {
    throw new SvnBindException("Could not get relative path for " + target1 + " and " + subTarget1);
  }

  SvnTarget subTarget2 = SvnUtil.append(target2, FileUtil.toSystemIndependentName(relativePath));

  FilePath target1Path = createFilePath(subTarget1, diffPath.isDirectory());
  FilePath target2Path = createFilePath(subTarget2, diffPath.isDirectory());

  FileStatus status = SvnStatusConvertor
    .convertStatus(SvnStatusHandler.getStatus(diffPath.itemStatus), SvnStatusHandler.getStatus(diffPath.propertiesStatus));

  // statuses determine changes needs to be done to "target1" to get "target2" state
  ContentRevision beforeRevision = status == FileStatus.ADDED
                                   ? null
                                   : createRevision(target1Path, target2Path, target1.getPegRevision(), status);
  ContentRevision afterRevision = status == FileStatus.DELETED
                                  ? null
                                  : createRevision(target2Path, target1Path, target2.getPegRevision(), status);

  return createChange(status, beforeRevision, afterRevision);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:CmdDiffClient.java


示例30: handleCommandCompletion

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
private static void handleCommandCompletion(@NotNull CommandExecutor command,
                                            @NotNull File file,
                                            @NotNull EventAction success,
                                            @NotNull EventAction failure,
                                            @Nullable ProgressTracker handler) throws VcsException {
  // just warning appears in output when can not lock/unlock file for some reason (like, that file is already locked)
  SVNErrorMessage error = SvnUtil.parseWarning(command.getErrorOutput());

  try {
    invokeHandler(file, error == null ? success : failure, handler, error);
  }
  catch (SVNException e) {
    throw new VcsException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:CmdLockClient.java


示例31: MergeContext

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
public MergeContext(@NotNull SvnVcs vcs,
                    @NotNull String sourceUrl,
                    @NotNull WCInfo wcInfo,
                    @NotNull String branchName,
                    @NotNull VirtualFile root) {
  myVcs = vcs;
  myProject = vcs.getProject();
  myBranchName = branchName;
  myRoot = root;
  mySourceUrl = sourceUrl;
  myWcInfo = wcInfo;
  myTitle = "Merge from " + myBranchName;
  myRepositoryRelativeSourcePath = SvnUtil.ensureStartSlash(SVNPathUtil.getRelativePath(myWcInfo.getRepositoryRoot(), mySourceUrl));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:MergeContext.java


示例32: needsInteraction

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
public boolean needsInteraction(final UpdatedFiles updatedFiles) {
  if (myChangesUnderProjectRoot) {
    refreshChangeListsFindConflicts(updatedFiles);
  } else {
    final FileGroup conflictedGroup = updatedFiles.getGroupById(FileGroup.MERGED_WITH_CONFLICT_ID);
    for (String filename : conflictedGroup.getFiles()) {
      final VirtualFile vf = SvnUtil.getVirtualFile(filename);
      myConflictedVirtualFiles.add(vf);
    }
  }

  return ((! myConflictedVirtualFiles.isEmpty()) || (! haveUnresolvedConflicts(updatedFiles))) &&
         (!SvnConfiguration.getInstance(myProject).isMergeDryRun());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ResolveWorker.java


示例33: getNotMergedChangeLists

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@NotNull
private List<CommittedChangeList> getNotMergedChangeLists(@NotNull List<Pair<SvnChangeList, LogHierarchyNode>> changeLists) {
  ProgressManager.getInstance().getProgressIndicator().setText("Checking merge information...");

  String repositoryRelativeWorkingCopyRoot = SvnUtil.ensureStartSlash(
    SVNPathUtil.getRelativePath(myMergeContext.getWcInfo().getRepositoryRoot(), myMergeContext.getWcInfo().getRootUrl()));
  String repositoryRelativeSourceBranch =
    SvnUtil.ensureStartSlash(SVNPathUtil.getRelativePath(myMergeContext.getWcInfo().getRepositoryRoot(), myMergeContext.getSourceUrl()));

  return getNotMergedChangeLists(changeLists, repositoryRelativeWorkingCopyRoot, repositoryRelativeSourceBranch);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:MergeCalculatorTask.java


示例34: resolveSourceLatestRevision

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@NotNull
public SVNRevision resolveSourceLatestRevision() {
  SVNRevision result = SVNRevision.HEAD;

  try {
    result = SvnUtil.getHeadRevision(myVcs, mySourceUrl);
  }
  catch (SvnBindException e) {
    LOG.info(e);
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:BranchMerger.java


示例35: parseSourceUrl

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Nullable
protected SVNURL parseSourceUrl(@NotNull ContinuationContext context) {
  SVNURL result = null;

  try {
    result = SvnUtil.createUrl(myMergeContext.getSourceUrl());
  }
  catch (SvnBindException e) {
    finishWithError(context, e.getMessage(), true);
  }

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:BaseMergeTask.java


示例36: underProject

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
private boolean underProject(final File file) {
  return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
    @Override
    public Boolean compute() {
      final VirtualFile vf = SvnUtil.getVirtualFile(file.getAbsolutePath());
      return (vf == null) || PeriodicalTasksCloser.getInstance().safeGetService(myProject, FileIndexFacade.class).isInContent(vf);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:IntegratedSelectedOptionsDialog.java


示例37: initMergeTarget

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
/**
 * folder that is going to keep merge info record should also be changed
 */
private void initMergeTarget() {
  final File mergeInfoHolder = myMerger.getMergeInfoHolder();
  if (mergeInfoHolder != null) {
    final Status svnStatus = SvnUtil.getStatus(myVcs, mergeInfoHolder);
    if (svnStatus != null && svnStatus.isProperty(StatusType.STATUS_MODIFIED)) {
      myMergeTarget = VcsUtil.getFilePath(mergeInfoHolder);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SvnIntegrateChangesTask.java


示例38: LatestExistentSearcher

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
public LatestExistentSearcher(final long startNumber,
                              final long endNumber,
                              final boolean startExistsKnown,
                              final SvnVcs vcs,
                              @NotNull SVNURL url,
                              @NotNull SVNURL repositoryUrl) {
  myStartNumber = startNumber;
  myEndNumber = endNumber;
  myStartExistsKnown = startExistsKnown;
  myVcs = vcs;
  myUrl = url;
  myRepositoryUrl = repositoryUrl;
  // TODO: Make utility method that compare relative urls checking all possible cases when start/end slash exists or not.
  myRelativeUrl = SvnUtil.ensureStartSlash(SVNURLUtil.getRelativeURL(myRepositoryUrl, myUrl, true));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:LatestExistentSearcher.java


示例39: getExistingParent

import org.jetbrains.idea.svn.SvnUtil; //导入依赖的package包/类
@Nullable
private SVNURL getExistingParent(SVNURL url) throws SvnBindException {
  while (url != null && !url.equals(myRepositoryUrl) && !existsInRevision(url, myEndNumber)) {
    url = SvnUtil.removePathTail(url);
  }

  return url;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:LatestExistentSearcher.java



注:本文中的org.jetbrains.idea.svn.SvnUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。