Exemple #1
0
  /**
   * Update the listed files from the repository
   *
   * @param client The client to use to perform the update with
   * @param listener The listener to receive notifications of updated files
   * @param theFiles The set of files to update
   * @param force Whether to do a forced "clean copy" update (override local changes)
   * @return UpdateServerResponse with information about the update
   * @throws CommandAbortedException
   * @throws CommandException
   * @throws AuthenticationException
   * @throws InvalidCvsRootException
   */
  synchronized UpdateServerResponse doUpdateFiles(
      BlueJCvsClient client, UpdateListener listener, Set theFiles, boolean force)
      throws CommandAbortedException, CommandException, AuthenticationException {
    UpdateCommand command = new UpdateCommand();
    command.setFiles(listToFileArray(theFiles));

    command.setCleanCopy(force);
    command.setRecursive(false);
    command.setBuildDirectories(true);
    command.setPruneDirectories(true);

    UpdateServerResponse updateServerResponse = new UpdateServerResponse(listener, client);
    client.getEventManager().addCVSListener(updateServerResponse);
    client.setLocalPath(projectPath.getAbsolutePath());

    printCommand(command, client);
    setupConnection(client);

    try {
      adminHandler.setMildManneredMode(true);
      client.executeCommand(command, globalOptions);
      updateServerResponse.waitForExecutionToFinish();
    } finally {
      // restore previous excludes setting
      client.getEventManager().removeCVSListener(updateServerResponse);
      disconnect(client);
      adminHandler.setMildManneredMode(false);
    }

    updateServerResponse.setConflictMap(client.getConflictFiles());
    return updateServerResponse;
  }
Exemple #2
0
 /**
  * Get a client object which can be used to execute commands.
  *
  * <p>It's necessary to get a fresh client for each command because once the client is put in the
  * "aborted" state there's no way to undo that effect.
  *
  * @return A client (without connection established)
  */
 BlueJCvsClient getClient() {
   BlueJCvsClient client = new BlueJCvsClient(null, adminHandler);
   client.dontUseGzipFileHandler();
   return client;
 }