public void receive(SvnTarget target, SVNCommitInfo commitInfo) throws SVNException { try { SVNURL repositoryRoot = target.getURL(); callback.commitInfo(getCommitInfo(commitInfo, repositoryRoot)); } catch (ParseException e) { throwSvnException(e); } } };
public void receive(SvnTarget target, SVNPropertyData object) throws SVNException { if (handler != null) { handler.handleProperty(target.getURL(), object); } } });
/** * Determines whether target is remote or local, and returns corresponding <code>String</code> representation of the target's path * @return <code>String</code> representation of the target's path * @throws {@link IllegalStateException} if neither file not URL was specified as a target */ public String getPathOrUrlString() { if (isFile()) { return getFile().getPath(); } else if (isURL()) { return getURL().toString(); } throw new IllegalStateException("A target can be either an URL or a path"); }
/** * Determines whether target is remote or local, and returns corresponding <code>String</code> representation of the target's path * @return <code>String</code> representation of the target * @throws {@link IllegalStateException} if neither file not URL was specified as a target's path */ public String getPathOrUrlDecodedString() { if (isFile()) { return getFile().getPath(); } else if (isURL()) { return getURL().toString(); } throw new IllegalStateException("A target can be either an URL or a path"); }
protected SVNURL getURL(SvnTarget target) throws SVNException { if (target.isURL()) { return target.getURL(); } return deriveLocation(target.getFile(), null, null, SVNRevision.UNDEFINED, null, null); }
protected SVNURL getTargetURL(SvnTarget target) throws SVNException { if (target.isURL()) { return target.getURL(); } return getWCContext().getNodeUrl(target.getFile()); }
public void receive(SvnTarget target, SVNProperties object) throws SVNException { if (propName != null && object.containsName(propName)) { SVNPropertyData propertyData = new SVNPropertyData(propName, object.getSVNPropertyValue(propName), getOptions()); handler.handleProperty(target.getURL(), propertyData); } else if (propName == null) { for (Object propertyName : object.nameSet()) { String name = propertyName.toString(); SVNPropertyData propertyData = new SVNPropertyData(name, object.getSVNPropertyValue(name), getOptions()); handler.handleProperty(target.getURL(), propertyData); } } } });
@Override protected SVNCommitInfo run() throws SVNException { SVNCommitInfo info = doRun(); if (info != null) { Collection<SvnTarget> targets = getOperation().getTargets(); if (targets != null && targets.size() != 0) { SvnTarget firstTarget = targets.iterator().next(); SVNRepository repository = getRepositoryAccess().createRepository(firstTarget.getURL(), null, true); SVNURL repositoryRoot = repository.getRepositoryRoot(true); getOperation().receive(SvnTarget.fromURL(repositoryRoot), info); } } return info; }
@Override protected void ensureArgumentsAreValid() throws SVNException { super.ensureArgumentsAreValid(); setRemoteRevision(SVNWCContext.INVALID_REVNUM); if (hasRemoteTargets()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET, "''{0}'' is not a local path", getFirstTarget().getURL()); SVNErrorManager.error(err, SVNLogType.WC); } }
public void receive(SvnTarget target, SVNProperties props) throws SVNException { for (Object propertyName : props.nameSet()) { final String name = propertyName.toString(); final SVNPropertyData propertyData = new SVNPropertyData(name, props.getSVNPropertyValue(name), getSVNEnvironment().getOptions()); if (target.isURL()) { handleProperty(target.getURL(), propertyData); } else { handleProperty(target.getFile(), propertyData); } } } });
public void receive(SvnTarget target, SVNProperties props) throws SVNException { for (Object propertyName : props.nameSet()) { final String name = propertyName.toString(); final SVNPropertyData propertyData = new SVNPropertyData(name, props.getSVNPropertyValue(name), getSVNEnvironment().getOptions()); if (target.isURL()) { handleProperty(target.getURL(), propertyData); } else { handleProperty(target.getFile(), propertyData); } } } });
@Override protected void ensureArgumentsAreValid() throws SVNException { super.ensureArgumentsAreValid(); if (!isRemove()) { if ("".equals(getChangelistName())) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_CHANGELIST_NAME, "Target changelist name must not be empty"); SVNErrorManager.error(err, SVNLogType.WC); } } if (hasRemoteTargets()) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET, "''{0}'' is not a local path", getFirstTarget().getURL()); SVNErrorManager.error(err, SVNLogType.WC); } }
public static SVNCopySource copySource(SvnCopySource newSource) { if (newSource.getSource().getURL() != null) { final SVNCopySource copySource = new SVNCopySource(newSource.getSource().getResolvedPegRevision(), newSource.getRevision(), newSource.getSource().getURL()); copySource.setCopyContents(newSource.isCopyContents()); return copySource; } final SVNCopySource copySource = new SVNCopySource(newSource.getSource().getResolvedPegRevision(), newSource.getRevision(), newSource.getSource().getFile()); copySource.setCopyContents(newSource.isCopyContents()); return copySource; }
public void receive(SvnTarget target, SVNProperties props) throws SVNException { if (!props.containsName(propertyName)) { return; } final SVNPropertyData propertyData = new SVNPropertyData(propertyName, props.getSVNPropertyValue(propertyName), getSVNEnvironment().getOptions()); if (target.isURL()) { handleProperty(target.getURL(), propertyData); } else { handleProperty(target.getFile(), propertyData); } } });
public void receive(SvnTarget target, SVNProperties props) throws SVNException { if (!props.containsName(propertyName)) { return; } final SVNPropertyData propertyData = new SVNPropertyData(propertyName, props.getSVNPropertyValue(propertyName), getSVNEnvironment().getOptions()); if (target.isURL()) { handleProperty(target.getURL(), propertyData); } else { handleProperty(target.getFile(), propertyData); } } });
@Override protected Long run(SVNWCContext context) throws SVNException { SvnTarget source = getOperation().getSource(); int targetWorkingCopyFormat = getOperation().getTargetWorkingCopyFormat(); return checkout(source.getURL(), getFirstTarget(), source.getResolvedPegRevision(), getOperation().getRevision(), getOperation().getDepth(), getOperation().isIgnoreExternals(), getOperation().isAllowUnversionedObstructions(), getOperation().isSleepForTimestamp(), targetWorkingCopyFormat < 0 ? ISVNWCDb.WC_FORMAT_18 : targetWorkingCopyFormat); }
@Override protected Long run(SVNWCContext context) throws SVNException { SvnTarget switchTarget = getOperation().getSwitchTarget(); return doSwitch(getFirstTarget(), switchTarget.getURL(), getOperation().getRevision(), switchTarget.getResolvedPegRevision(), getOperation().getDepth(), getOperation().isDepthIsSticky(), getOperation().isIgnoreExternals(), getOperation().isAllowUnversionedObstructions(), getOperation().isIgnoreAncestry(), getOperation().isSleepForTimestamp()); }
@Override protected Collection<SVNURL> run() throws SVNException { SVNDiffClient16 dc = new SVNDiffClient16(getOperation().getAuthenticationManager(), getOperation().getOptions()); if (getOperation().getFirstTarget().isURL()) { return dc.doSuggestMergeSources(getOperation().getFirstTarget().getURL(), getOperation().getFirstTarget().getPegRevision()); } return dc.doSuggestMergeSources(getOperation().getFirstTarget().getFile(), getOperation().getFirstTarget().getPegRevision()); }
@Override protected Map<SVNURL, SVNMergeRangeList> run() throws SVNException { SVNDiffClient16 dc = new SVNDiffClient16(getOperation().getAuthenticationManager(), getOperation().getOptions()); if (getOperation().getFirstTarget().isURL()) { return dc.doGetMergedMergeInfo(getOperation().getFirstTarget().getURL(), getOperation().getFirstTarget().getResolvedPegRevision()); } return dc.doGetMergedMergeInfo(getOperation().getFirstTarget().getFile(), getOperation().getFirstTarget().getResolvedPegRevision()); }
private Void copy() throws SVNException { final SVNCopyClient16 client = new SVNCopyClient16(getOperation().getRepositoryPool(), getOperation().getOptions()); client.setEventHandler(getOperation().getEventHandler()); client.setCommitHandler(null); client.setExternalsHandler(ISVNExternalsHandler.DEFAULT); client.setOptions(getOperation().getOptions()); final SvnTarget target = getOperation().getFirstTarget(); final SVNCopySource[] sources = getCopySources(); if (target.isURL()) { client.doCopy(sources, target.getURL(), getOperation().isMove(), getOperation().isMakeParents(), getOperation().isFailWhenDstExists(), null, null); } else { client.doCopy(sources, target.getFile(), getOperation().isMove(), getOperation().isMakeParents(), getOperation().isFailWhenDstExists()); } return null; }