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


Java SvnTarget类代码示例

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


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

示例1: copy

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
@Override
public void copy(@NotNull SvnTarget source,
                 @NotNull File destination,
                 @Nullable SVNRevision revision,
                 boolean makeParents,
                 @Nullable ProgressTracker handler) throws VcsException {
  SVNCopyClient client = myVcs.getSvnKitManager().createCopyClient();
  client.setEventHandler(toEventHandler(handler));

  try {
    client.doCopy(new SVNCopySource[]{createCopySource(source, revision)}, destination, false, makeParents, true);
  }
  catch (SVNException e) {
    throw new SvnBindException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:SvnKitCopyMoveClient.java

示例2: upgrade

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
@Override
public void upgrade(@NotNull File path, @NotNull WorkingCopyFormat format, @Nullable ProgressTracker handler) throws VcsException {
  validateFormat(format, getSupportedFormats());

  // fake event indicating upgrade start
  callHandler(handler, createEvent(path, EventAction.UPDATE_COMPLETED));

  List<String> parameters = new ArrayList<String>();

  CommandUtil.put(parameters, path);

  // TODO: Add general possibility to invoke "handler.checkCancelled" (process should be killed). But currently upgrade process is not
  // TODO: cancellable from UI - and this makes sense.
  // for 1.8 - no output
  // for 1.7 - output in format "Upgraded '<path>'"
  FileStatusResultParser parser = new FileStatusResultParser(CHANGED_PATH, handler, new UpgradeStatusConvertor());
  UpgradeLineCommandListener listener = new UpgradeLineCommandListener(parser);

  execute(myVcs, SvnTarget.fromFile(path), SvnCommandName.upgrade, parameters, listener);
  listener.throwIfException();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:CmdUpgradeClient.java

示例3: runCommit

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
@NotNull
private CommitInfo[] runCommit(@NotNull List<File> paths, @NotNull String message) throws VcsException {
  if (ContainerUtil.isEmpty(paths)) return new CommitInfo[]{CommitInfo.EMPTY};

  Command command = newCommand(SvnCommandName.ci);

  command.put(Depth.EMPTY);
  command.put("-m", message);
  // TODO: seems that sort is not necessary here
  ContainerUtil.sort(paths);
  command.setTargets(paths);

  IdeaCommitHandler handler = new IdeaCommitHandler(ProgressManager.getInstance().getProgressIndicator());
  CmdCheckinClient.CommandListener listener = new CommandListener(handler);
  listener.setBaseDirectory(CommandUtil.requireExistingParent(paths.get(0)));
  execute(myVcs, SvnTarget.fromFile(paths.get(0)), null, command, listener);
  listener.throwExceptionIfOccurred();

  long revision = validateRevisionNumber(listener.getCommittedRevision());

  return new CommitInfo[]{new CommitInfo.Builder().setRevision(revision).build()};
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:CmdCheckinClient.java

示例4: doStatus

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
@Override
public long doStatus(@NotNull final File path,
                     @Nullable final SVNRevision revision,
                     @NotNull final Depth depth,
                     boolean remote,
                     boolean reportAll,
                     boolean includeIgnored,
                     boolean collectParentExternals,
                     @NotNull final StatusConsumer handler,
                     @Nullable final Collection changeLists) throws SvnBindException {
  File base = CommandUtil.requireExistingParent(path);
  final Info infoBase = myFactory.createInfoClient().doInfo(base, revision);
  List<String> parameters = new ArrayList<String>();

  putParameters(parameters, path, depth, remote, reportAll, includeIgnored, changeLists);

  CommandExecutor command = execute(myVcs, SvnTarget.fromFile(path), SvnCommandName.st, parameters, null);
  parseResult(path, revision, handler, base, infoBase, command);
  return 0;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:CmdStatusClient.java

示例5: annotate

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
@Override
public void annotate(@NotNull SvnTarget target,
                     @NotNull SVNRevision startRevision,
                     @NotNull SVNRevision endRevision,
                     boolean includeMergedRevisions,
                     @Nullable DiffOptions diffOptions,
                     @Nullable AnnotationConsumer handler) throws VcsException {
  try {
    SVNLogClient client = myVcs.getSvnKitManager().createLogClient();

    client.setDiffOptions(toDiffOptions(diffOptions));
    if (target.isFile()) {
      client
        .doAnnotate(target.getFile(), target.getPegRevision(), startRevision, endRevision, true, includeMergedRevisions,
                    toAnnotateHandler(handler), null);
    }
    else {
      client
        .doAnnotate(target.getURL(), target.getPegRevision(), startRevision, endRevision, true, includeMergedRevisions,
                    toAnnotateHandler(handler), null);
    }
  }
  catch (SVNException e) {
    throw new VcsException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnKitAnnotateClient.java

示例6: annotate

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
@Override
public void annotate(@NotNull SvnTarget target,
                     @NotNull SVNRevision startRevision,
                     @NotNull SVNRevision endRevision,
                     boolean includeMergedRevisions,
                     @Nullable DiffOptions diffOptions,
                     @Nullable final AnnotationConsumer handler) throws VcsException {
  List<String> parameters = new ArrayList<String>();
  CommandUtil.put(parameters, target);
  CommandUtil.put(parameters, startRevision, endRevision);
  CommandUtil.put(parameters, includeMergedRevisions, "--use-merge-history");
  CommandUtil.put(parameters, diffOptions);
  parameters.add("--xml");

  CommandExecutor command = execute(myVcs, target, SvnCommandName.blame, parameters, null);

  parseOutput(command.getOutput(), handler);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:CmdAnnotateClient.java

示例7: doLog

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
private void doLog(final boolean includeMerged, final SVNRevision truncateTo, final int max) throws VcsException {
  myClient.doLog(SvnTarget.fromFile(myIoFile), myEndRevision, truncateTo == null ? SVNRevision.create(1L) : truncateTo,
                 false, false, includeMerged, max, null,
                 new LogEntryConsumer() {
                   @Override
                   public void consume(LogEntry logEntry) {
                     if (SVNRevision.UNDEFINED.getNumber() == logEntry.getRevision()) {
                       return;
                     }

                     if (myProgress != null) {
                       myProgress.checkCanceled();
                       myProgress.setText2(SvnBundle.message("progress.text2.revision.processed", logEntry.getRevision()));
                     }
                     myResult.setRevision(logEntry.getRevision(), new SvnFileRevision(myVcs, SVNRevision.UNDEFINED, logEntry, myUrl, ""));
                   }
                 });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:SvnAnnotationProvider.java

示例8: editFiles

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
public void editFiles(VirtualFile[] files) throws VcsException {
  File[] ioFiles = new File[files.length];

  for (int i = 0; i < files.length; i++) {
    ioFiles[i] = new File(files[i].getPath());

    PropertyClient client = myVCS.getFactory(ioFiles[i]).createPropertyClient();
    PropertyValue property = client.getProperty(SvnTarget.fromFile(ioFiles[i], SVNRevision.WORKING), SvnPropertyKeys.SVN_NEEDS_LOCK,
                                                  false, SVNRevision.WORKING);

    if (property == null) {
      throw new VcsException(SvnBundle.message("exception.text.file.miss.svn", ioFiles[i].getName()));
    }
  }
  SvnUtil.doLockFiles(myVCS.getProject(), myVCS, ioFiles);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:SvnEditFileProvider.java

示例9: revert

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
@Override
public void revert(@NotNull Collection<File> paths, @Nullable Depth depth, @Nullable ProgressTracker handler) throws VcsException {
  if (!ContainerUtil.isEmpty(paths)) {
    Command command = newCommand(SvnCommandName.revert);

    command.put(depth);
    command.setTargets(paths);

    // TODO: handler should be called in parallel with command execution, but this will be in other thread
    // TODO: check if that is ok for current handler implementation
    // TODO: add possibility to invoke "handler.checkCancelled" - process should be killed
    SvnTarget target = SvnTarget.fromFile(ObjectUtils.assertNotNull(ContainerUtil.getFirstItem(paths)));
    CommandExecutor executor = execute(myVcs, target, CommandUtil.getHomeDirectory(), command, null);
    FileStatusResultParser parser = new FileStatusResultParser(CHANGED_PATH, handler, new RevertStatusConvertor());
    parser.parse(executor.getOutput());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:CmdRevertClient.java

示例10: copy

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
@Override
public void copy(@NotNull SvnTarget source,
                 @NotNull File destination,
                 @Nullable SVNRevision revision,
                 boolean makeParents,
                 @Nullable ProgressTracker handler) throws VcsException {
  List<String> parameters = new ArrayList<String>();

  CommandUtil.put(parameters, source);
  CommandUtil.put(parameters, destination);
  CommandUtil.put(parameters, revision);
  CommandUtil.put(parameters, makeParents, "--parents");

  File workingDirectory = CommandUtil.getHomeDirectory();
  BaseUpdateCommandListener listener = new BaseUpdateCommandListener(workingDirectory, handler);

  execute(myVcs, source, workingDirectory, SvnCommandName.copy, parameters, listener);

  listener.throwWrappedIfException();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:CmdCopyMoveClient.java

示例11: export

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
@Override
public void export(@NotNull SvnTarget from,
                   @NotNull File to,
                   @Nullable SVNRevision revision,
                   @Nullable Depth depth,
                   @Nullable String nativeLineEnd,
                   boolean force,
                   boolean ignoreExternals,
                   @Nullable ProgressTracker handler) throws VcsException {
  SVNUpdateClient client = myVcs.getSvnKitManager().createUpdateClient();

  client.setEventHandler(toEventHandler(handler));
  client.setIgnoreExternals(ignoreExternals);

  try {
    if (from.isFile()) {
      client.doExport(from.getFile(), to, from.getPegRevision(), revision, nativeLineEnd, force, toDepth(depth));
    }
    else {
      client.doExport(from.getURL(), to, from.getPegRevision(), revision, nativeLineEnd, force, toDepth(depth));
    }
  }
  catch (SVNException e) {
    throw new SvnBindException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:SvnKitExportClient.java

示例12: list

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
@Override
public void list(@NotNull SvnTarget target,
                 @Nullable SVNRevision revision,
                 @Nullable Depth depth,
                 @Nullable DirectoryEntryConsumer handler) throws VcsException {
  assertUrl(target);

  SVNLogClient client = getLogClient();
  ISVNDirEntryHandler wrappedHandler = wrapHandler(handler);

  client.setIgnoreExternals(true);
  try {
    if (target.isFile()) {
      client.doList(target.getFile(), target.getPegRevision(), notNullize(revision), true, toDepth(depth), SVNDirEntry.DIRENT_ALL, wrappedHandler);
    }
    else {
      client.doList(target.getURL(), target.getPegRevision(), notNullize(revision), true, toDepth(depth), SVNDirEntry.DIRENT_ALL, wrappedHandler);
    }
  }
  catch (SVNException e) {
    throw new SvnBindException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:SvnKitBrowseClient.java

示例13: merge

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
@Override
public void merge(@NotNull SvnTarget source1,
                  @NotNull SvnTarget source2,
                  @NotNull File destination,
                  @Nullable Depth depth,
                  boolean useAncestry,
                  boolean dryRun,
                  boolean recordOnly,
                  boolean force,
                  @Nullable DiffOptions diffOptions,
                  @Nullable ProgressTracker handler) throws VcsException {
  assertUrl(source1);
  assertUrl(source2);

  List<String> parameters = new ArrayList<String>();

  CommandUtil.put(parameters, source1);
  CommandUtil.put(parameters, source2);
  fillParameters(parameters, destination, depth, dryRun, recordOnly, force, false, diffOptions);
  CommandUtil.put(parameters, !useAncestry, "--ignore-ancestry");

  run(destination, handler, parameters);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:CmdMergeClient.java

示例14: getCommitMessage

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
@Nullable
private String getCommitMessage(@NotNull File path, @NotNull Info info) {
  String result;

  try {
    PropertyValue property =
      myVcs.getFactory(path).createPropertyClient()
        .getProperty(SvnTarget.fromFile(path), COMMIT_MESSAGE, true, info.getCommittedRevision());

    result = PropertyValue.toString(property);
  }
  catch (VcsException e) {
    LOG.info("Failed to get commit message for file " + path + ", " + info.getCommittedRevision() + ", " + info.getRevision(), e);
    result = "";
  }

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

示例15: remoteFolderIsEmpty

import org.tmatesoft.svn.core.wc2.SvnTarget; //导入依赖的package包/类
public static boolean remoteFolderIsEmpty(final SvnVcs vcs, final String url) throws VcsException {
  SvnTarget target = SvnTarget.fromURL(createUrl(url));
  final Ref<Boolean> result = new Ref<Boolean>(true);
  DirectoryEntryConsumer handler = new DirectoryEntryConsumer() {

    @Override
    public void consume(final DirectoryEntry entry) throws SVNException {
      if (entry != null) {
        result.set(false);
      }
    }
  };

  vcs.getFactory(target).createBrowseClient().list(target, null, Depth.IMMEDIATES, handler);
  return result.get();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:SvnUtil.java


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