public void diff(String target, Revision pegRevision, Revision startRevision, Revision endRevision, String outFileName, boolean recurse, boolean ignoreAncestry, boolean noDiffDeleted, boolean force) throws ClientException { SVNDiffClient differ = getSVNDiffClient(); differ.getDiffGenerator().setDiffDeleted(!noDiffDeleted); differ.getDiffGenerator().setForcedBinaryDiff(force); SVNRevision peg = JavaHLObjectFactory.getSVNRevision(pegRevision); SVNRevision rev1 = JavaHLObjectFactory.getSVNRevision(startRevision); SVNRevision rev2 = JavaHLObjectFactory.getSVNRevision(endRevision); try { OutputStream out = SVNFileUtil.openFileForWriting(new File(outFileName)); if(isURL(target)){ SVNURL url = SVNURL.parseURIEncoded(target); differ.doDiff(url, peg, rev1, rev2, recurse, !ignoreAncestry, out); }else{ differ.doDiff(new File(target).getAbsoluteFile(), peg, rev1, rev2, recurse, !ignoreAncestry, out); } SVNFileUtil.closeFile(out); } catch (SVNException e) { throwException(e); } }
public void diff(String target1, Revision revision1, String target2, Revision revision2, String outFileName, boolean recurse, boolean ignoreAncestry, boolean noDiffDeleted, boolean force) throws ClientException { SVNDiffClient differ = getSVNDiffClient(); differ.getDiffGenerator().setDiffDeleted(!noDiffDeleted); differ.getDiffGenerator().setForcedBinaryDiff(force); SVNRevision rev1 = JavaHLObjectFactory.getSVNRevision(revision1); SVNRevision rev2 = JavaHLObjectFactory.getSVNRevision(revision2); try { OutputStream out = SVNFileUtil.openFileForWriting(new File(outFileName)); if(!isURL(target1)&&!isURL(target2)){ differ.doDiff(new File(target1).getAbsoluteFile(), rev1, new File(target2).getAbsoluteFile(), rev2, recurse, !ignoreAncestry, out); }else if(isURL(target1)&&isURL(target2)){ SVNURL url1 = SVNURL.parseURIEncoded(target1); SVNURL url2 = SVNURL.parseURIEncoded(target2); differ.doDiff(url1, rev1, url2, rev2, recurse, !ignoreAncestry, out); }else if(!isURL(target1)&&isURL(target2)){ SVNURL url2 = SVNURL.parseURIEncoded(target2); differ.doDiff(new File(target1).getAbsoluteFile(), rev1, url2, rev2, recurse, !ignoreAncestry, out); }else if(isURL(target1)&&!isURL(target2)){ SVNURL url1 = SVNURL.parseURIEncoded(target1); differ.doDiff(url1, rev1, new File(target2).getAbsoluteFile(), rev2, recurse, !ignoreAncestry, out); } SVNFileUtil.closeFile(out); } catch (SVNException e) { throwException(e); } }
public void diff(String target, Revision pegRevision, Revision startRevision, Revision endRevision, String relativeToDir, String outFileName, int depth, String[] changelists, boolean ignoreAncestry, boolean noDiffDeleted, boolean force) throws ClientException { SVNDiffClient differ = getSVNDiffClient(); differ.getDiffGenerator().setDiffDeleted(!noDiffDeleted); differ.getDiffGenerator().setForcedBinaryDiff(force); differ.setOptions(getOptions()); SVNRevision peg = JavaHLObjectFactory.getSVNRevision(pegRevision); SVNRevision rev1 = JavaHLObjectFactory.getSVNRevision(startRevision); SVNRevision rev2 = JavaHLObjectFactory.getSVNRevision(endRevision); try { differ.getDiffGenerator().setBasePath(getDiffBasePath(relativeToDir)); OutputStream out = SVNFileUtil.openFileForWriting(new File(outFileName)); if (isURL(target)) { SVNURL url = SVNURL.parseURIEncoded(target); differ.doDiff(url, peg, rev1, rev2, JavaHLObjectFactory.getSVNDepth(depth), !ignoreAncestry, out); } else { differ.doDiff(new File(target).getAbsoluteFile(), peg, rev1, rev2, JavaHLObjectFactory.getSVNDepth(depth), !ignoreAncestry, out, JavaHLObjectFactory.getChangeListsCollection(changelists)); } SVNFileUtil.closeFile(out); } catch (SVNException e) { throwException(e); } finally { resetLog(); } }
public void diff(String target, Revision pegRevision, Revision startRevision, Revision endRevision, String relativeToDir, String outFileName, int depth, String[] changelists, boolean ignoreAncestry, boolean noDiffDeleted, boolean force) throws ClientException { SVNDiffClient differ = getSVNDiffClient(); differ.getDiffGenerator().setDiffDeleted(!noDiffDeleted); differ.getDiffGenerator().setForcedBinaryDiff(force); differ.setOptions(getOptions()); SVNRevision peg = JavaHLObjectFactory.getSVNRevision(pegRevision); SVNRevision rev1 = JavaHLObjectFactory.getSVNRevision(startRevision); SVNRevision rev2 = JavaHLObjectFactory.getSVNRevision(endRevision); try { differ.getDiffGenerator().setBasePath(getDiffBasePath(relativeToDir)); OutputStream out = SVNFileUtil.openFileForWriting(new File(outFileName)); if (isURL(target)) { SVNURL url = SVNURL.parseURIEncoded(target); differ.doDiff(url, peg, rev1, rev2, JavaHLObjectFactory.getSVNDepth(depth), !ignoreAncestry, out); } else { differ.doDiff(new File(target).getAbsoluteFile(), peg, rev1, rev2, JavaHLObjectFactory.getSVNDepth(depth), !ignoreAncestry, out, JavaHLObjectFactory.getChangeListsCollection(changelists)); } SVNFileUtil.closeFile(out); } catch (SVNException e) { throwException(e); } finally { resetLog(); } }
public void diff(String target, Revision pegRevision, Revision startRevision, Revision endRevision, String relativeToDir, String outFileName, int depth, String[] changelists, boolean ignoreAncestry, boolean noDiffDeleted, boolean force) throws ClientException { SVNDiffClient differ = getSVNDiffClient(); differ.getDiffGenerator().setDiffDeleted(!noDiffDeleted); differ.getDiffGenerator().setForcedBinaryDiff(force); differ.setOptions(getOptions()); SVNRevision peg = JavaHLObjectFactory.getSVNRevision(pegRevision); SVNRevision rev1 = JavaHLObjectFactory.getSVNRevision(startRevision); SVNRevision rev2 = JavaHLObjectFactory.getSVNRevision(endRevision); try { differ.getDiffGenerator().setBasePath(getDiffBasePath(relativeToDir)); OutputStream out = SVNFileUtil.openFileForWriting(new File(outFileName)); if (isURL(target)) { SVNURL url = SVNURL.parseURIEncoded(target); differ.doDiff(url, peg, rev1, rev2, JavaHLObjectFactory.getSVNDepth(depth), !ignoreAncestry, out); } else { differ.doDiff(new File(target).getAbsoluteFile(), peg, rev1, rev2, JavaHLObjectFactory.getSVNDepth(depth), !ignoreAncestry, out, JavaHLObjectFactory.getChangeListsCollection(changelists)); } SVNFileUtil.closeFile(out); } catch (SVNException e) { throwException(e); } finally { resetLog(); } }
boolean noDiffDeleted, boolean force) throws ClientException { SVNDiffClient differ = getSVNDiffClient(); differ.getDiffGenerator().setDiffDeleted(!noDiffDeleted); differ.getDiffGenerator().setForcedBinaryDiff(force); differ.setOptions(getOptions()); SVNRevision rev1 = JavaHLObjectFactory.getSVNRevision(revision1); SVNRevision rev2 = JavaHLObjectFactory.getSVNRevision(revision2); try { differ.getDiffGenerator().setBasePath(getDiffBasePath(relativeToDir)); OutputStream out = SVNFileUtil.openFileForWriting(new File(outFileName)); if (!isURL(target1) && !isURL(target2)) {
boolean noDiffDeleted, boolean force) throws ClientException { SVNDiffClient differ = getSVNDiffClient(); differ.getDiffGenerator().setDiffDeleted(!noDiffDeleted); differ.getDiffGenerator().setForcedBinaryDiff(force); differ.setOptions(getOptions()); SVNRevision rev1 = JavaHLObjectFactory.getSVNRevision(revision1); SVNRevision rev2 = JavaHLObjectFactory.getSVNRevision(revision2); try { differ.getDiffGenerator().setBasePath(getDiffBasePath(relativeToDir)); OutputStream out = SVNFileUtil.openFileForWriting(new File(outFileName)); if (!isURL(target1) && !isURL(target2)) {
boolean noDiffDeleted, boolean force) throws ClientException { SVNDiffClient differ = getSVNDiffClient(); differ.getDiffGenerator().setDiffDeleted(!noDiffDeleted); differ.getDiffGenerator().setForcedBinaryDiff(force); differ.setOptions(getOptions()); SVNRevision rev1 = JavaHLObjectFactory.getSVNRevision(revision1); SVNRevision rev2 = JavaHLObjectFactory.getSVNRevision(revision2); try { differ.getDiffGenerator().setBasePath(getDiffBasePath(relativeToDir)); OutputStream out = SVNFileUtil.openFileForWriting(new File(outFileName)); if (!isURL(target1) && !isURL(target2)) {
private void doDiffWCWC(File path1, SVNRevision revision1, File path2, SVNRevision revision2, SVNDepth depth, boolean useAncestry, OutputStream result, Collection changeLists) throws SVNException { if (!path1.equals(path2) || !(revision1 == SVNRevision.BASE && revision2 == SVNRevision.WORKING)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE, "Only diffs between a path's text-base and its working files are supported at this time (-rBASE:WORKING)"); SVNErrorManager.error(err, SVNLogType.WC); } SVNWCAccess wcAccess = createWCAccess(); try { int admDepth = getAdminDepth(depth); SVNAdminAreaInfo info = wcAccess.openAnchor(path1, false, admDepth); wcAccess.getVersionedEntry(path1, false); long rev = getRevisionNumber(revision1, null, path1); AbstractDiffCallback callback = new SVNDiffCallback(info.getAnchor(), getDiffGenerator(), rev, -1, result); SVNDiffEditor editor = new SVNDiffEditor(wcAccess, info, callback, useAncestry, false, false, depth, changeLists); try { editor.closeEdit(); } finally { editor.cleanup(); } } finally { wcAccess.close(); } }
private void doDiffWCWC(File path1, SVNRevision revision1, File path2, SVNRevision revision2, SVNDepth depth, boolean useAncestry, OutputStream result, Collection changeLists) throws SVNException { if (!path1.equals(path2) || !(revision1 == SVNRevision.BASE && revision2 == SVNRevision.WORKING)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE, "Only diffs between a path's text-base and its working files are supported at this time (-rBASE:WORKING)"); SVNErrorManager.error(err, SVNLogType.WC); } SVNWCAccess wcAccess = createWCAccess(); try { int admDepth = getAdminDepth(depth); SVNAdminAreaInfo info = wcAccess.openAnchor(path1, false, admDepth); wcAccess.getVersionedEntry(path1, false); long rev = getRevisionNumber(revision1, null, path1); AbstractDiffCallback callback = new SVNDiffCallback(info.getAnchor(), getDiffGenerator(), rev, -1, result); SVNDiffEditor editor = new SVNDiffEditor(wcAccess, info, callback, useAncestry, false, false, depth, changeLists); try { editor.closeEdit(); } finally { editor.cleanup(); } } finally { wcAccess.close(); } }
SVNErrorManager.error(err); getDiffGenerator().init(url1.toString(), url2.toString()); doDiffURLURL(url1, null, rN, url2, null, rM, SVNRevision.UNDEFINED, recursive, useAncestry, result);
private void doDiffWCWC(File path1, SVNRevision revision1, File path2, SVNRevision revision2, boolean recursive, boolean useAncestry, OutputStream result) throws SVNException { if (!path1.equals(path2) || !(revision1 == SVNRevision.BASE && revision2 == SVNRevision.WORKING)) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE, "Only diffs between a path's text-base " + "and its working files are supported at this time (-rBASE:WORKING)"); SVNErrorManager.error(err); } SVNWCAccess wcAccess = createWCAccess(); try { SVNAdminAreaInfo info = wcAccess.openAnchor(path1, false, recursive ? SVNWCAccess.INFINITE_DEPTH: 0); SVNEntry entry = wcAccess.getEntry(path1, false); if (entry == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.ENTRY_NOT_FOUND, "''{0}'' is not under version control", path1); SVNErrorManager.error(err); } long rev = getRevisionNumber(revision1, null, path1); AbstractDiffCallback callback = new SVNDiffCallback(info, getDiffGenerator(), rev, -1, result); SVNDiffEditor editor = new SVNDiffEditor(wcAccess, info, callback, useAncestry, false, false, recursive); try { editor.closeEdit(); } finally { editor.cleanup(); } } finally { wcAccess.close(); } }
SVNErrorManager.error(err); getDiffGenerator().init(url.toString(), url.toString()); doDiffURLURL(url, null, rN, url, null, rM, pegRevision, recursive, useAncestry, result);
url1 = locations[0].getURL(); String anchorPath2 = SVNPathUtil.append(anchorURL.toString(), target == null ? "" : target); getDiffGenerator().init(url1.toString(), anchorPath2); getDiffGenerator(), reverse ? -1 : revNumber, reverse ? revNumber : -1, result); SVNDiffEditor editor = new SVNDiffEditor(wcAccess, info, callback, useAncestry, reverse /* reverse */,
url1 = locations[0].getURL(); String anchorPath2 = SVNPathUtil.append(anchorURL.toString(), target == null ? "" : target); getDiffGenerator().init(url1.toString(), anchorPath2); AbstractDiffCallback callback = new SVNDiffCallback(info, getDiffGenerator(), reverse ? -1 : revNumber, reverse ? revNumber : -1, result); SVNDiffEditor editor = new SVNDiffEditor(wcAccess, info, callback,
url1 = locations[0].getURL(); String anchorPath2 = SVNPathUtil.append(anchorURL.toString(), target == null ? "" : target); getDiffGenerator().init(url1.toString(), anchorPath2); getDiffGenerator(), reverse ? -1 : revNumber, reverse ? revNumber : -1, result); SVNDiffEditor editor = new SVNDiffEditor(wcAccess, info, callback, useAncestry, reverse /* reverse */,
url1 = locations[0].getURL(); String anchorPath2 = SVNPathUtil.append(anchorURL.toString(), target == null ? "" : target); getDiffGenerator().init(url1.toString(), anchorPath2); } else { url1 = getURL(path1); AbstractDiffCallback callback = new SVNDiffCallback(info, getDiffGenerator(), reverse ? -1 : revNumber, reverse ? revNumber : -1, result); SVNDiffEditor editor = new SVNDiffEditor(wcAccess, info, callback,
diff.setDiffGenerator(getDiffGenerator()); diff.setSource(SvnTarget.fromURL(url, pegRevision), rN, rM); diff.setDepth(SVNDepth.getInfinityOrEmptyDepth(recursive));
for (File path : paths) { final SvnDiff diff = getOperationsFactory().createDiff(); diff.setDiffGenerator(getDiffGenerator()); diff.setSource(SvnTarget.fromFile(path, pegRevision), rN, rM); diff.setDepth(depth);
diff.setDiffGenerator(getDiffGenerator()); diff.setSources(SvnTarget.fromURL(url1, rN), SvnTarget.fromURL(url2, rM)); diff.setDepth(SVNDepth.getInfinityOrEmptyDepth(recursive));