コード例 #1
0
 private String checkout(SvnOperationFactory svnOperationFactory) throws SVNException {
   logger.debug("Checking out " + getUri() + " to: " + getWorkingDirectory().getAbsolutePath());
   final SvnCheckout checkout = svnOperationFactory.createCheckout();
   checkout.setSource(SvnTarget.fromURL(SVNURL.parseURIEncoded(getUri())));
   checkout.setSingleTarget(SvnTarget.fromFile(getWorkingDirectory()));
   Long id = checkout.run();
   if (id == null) {
     return null;
   }
   return id.toString();
 }
コード例 #2
0
  /**
   * This is mostly inlined {@code SVNUpdateClient.doCheckout()} - to allow specifying necessary
   * working copy format. Otherwise, if only {@link SvnWcGeneration} is used - either svn 1.6 or svn
   * 1.8 working copy will be created.
   *
   * <p>See also http://issues.tmatesoft.com/issue/SVNKIT-495 for more details.
   */
  private static void runCheckout(
      @NotNull SVNUpdateClient client,
      @NotNull WorkingCopyFormat format,
      @NotNull SvnTarget source,
      @NotNull File destination,
      @Nullable SVNRevision revision,
      @Nullable Depth depth,
      boolean force)
      throws SVNException {
    SvnCheckout checkoutOperation = createCheckoutOperation(client, format);

    checkoutOperation.setUpdateLocksOnDemand(client.isUpdateLocksOnDemand());
    checkoutOperation.setSource(SvnTarget.fromURL(source.getURL(), source.getPegRevision()));
    checkoutOperation.setSingleTarget(SvnTarget.fromFile(destination));
    checkoutOperation.setRevision(revision);
    checkoutOperation.setDepth(toDepth(depth));
    checkoutOperation.setAllowUnversionedObstructions(force);
    checkoutOperation.setIgnoreExternals(client.isIgnoreExternals());
    checkoutOperation.setExternalsHandler(SvnCodec.externalsHandler(client.getExternalsHandler()));

    checkoutOperation.run();
  }