示例#1
0
  protected ListScmResult executeListCommand(
      ScmProviderRepository r, ScmFileSet f, boolean recursive, ScmVersion v) throws ScmException {
    FileListConsumer out = new ServerFileListConsumer();
    ErrorStreamConsumer err = new ErrorStreamConsumer();

    TfsCommand command = createCommand(r, f, recursive);
    int status = command.execute(out, err);
    if (status != 0 || err.hasBeenFed()) {
      return new ListScmResult(
          command.getCommandString(),
          "Error code for TFS list command - " + status,
          err.getOutput(),
          false);
    }

    return new ListScmResult(command.getCommandString(), out.getFiles());
  }
示例#2
0
  protected ScmResult executeTagCommand(
      ScmProviderRepository r, ScmFileSet f, String tag, ScmTagParameters scmTagParameters)
      throws ScmException {
    TfsCommand command = createCommand(r, f, tag, scmTagParameters);

    StringStreamConsumer out = new StringStreamConsumer();
    ErrorStreamConsumer err = new ErrorStreamConsumer();

    int status = command.execute(out, err);
    if (status != 0 || err.hasBeenFed()) {
      return new TagScmResult(
          command.getCommandString(),
          "Error code for TFS label command - " + status,
          err.getOutput(),
          false);
    }
    List<ScmFile> files = new ArrayList<ScmFile>(f.getFileList().size());
    for (File file : f.getFileList()) {
      files.add(new ScmFile(file.getPath(), ScmFileStatus.TAGGED));
    }
    return new TagScmResult(command.getCommandString(), files);
  }