/** * Trims off the root module portion to compute the path within FishEye. */ private String getPath(Path path) { String s = trimHeadSlash(path.getValue()); if(s.startsWith(rootModule)) // this should be always true, but be defensive s = trimHeadSlash(s.substring(rootModule.length())); return s; }
@Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() != EditType.EDIT) { return null; // no diff if this is not an edit change } // https://demo-server.visualsvn.com/!/#tortoisesvn/commit/r27333/head/trunk/src/Utils/MiscUI/SciEdit.cpp int r = path.getLogEntry().getRevision(); String value = String.format("%s/commit/r%d/head%s", url, r, path.getValue()); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("DiffLink URL: " + value); } return new URL(value); }
@Override public Collection<Path> getAffectedFiles() { Collection<Path> affectedFiles = new ArrayList<Path>(); for (Path p : paths) { if (p.hasLocalPath()) { affectedFiles.add(p); } } // FIXME backwards compatibility? return affectedFiles; }
/** * Creates a link to the commit diff. * * https://[Phabricator URL]/diffusion/$repo/change/master/$path;$revision * * * @param path * @return diff link * @throws IOException */ @Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() != EditType.EDIT) { return null; // no diff if this is not an edit change } int r = path.getLogEntry().getRevision(); final String spec = String.format("/diffusion/%s/change/master/%s;%i", this.getRepo(), path.getPath(), r); return new URL(getUrl(), spec); }
/** * Returns the diff link value. * * @param path the given path value. * @return the diff link value. * @throws IOException DOCUMENT ME! */ @Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() != EditType.EDIT) { return null; // no diff if this is not an edit change } int r = path.getLogEntry().getRevision(); return new URL( url, "diff/" + trimHeadSlash(path.getValue()) + param().add("rev1=" + (r-1) + ";rev2=" + r) ); }
/** * Returns the diff link value. * * @param path the given path value. * * @return the diff link value. * * @throws IOException DOCUMENT ME! */ @Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() != EditType.EDIT) { return null; // no diff if this is not an edit change } int r = path.getLogEntry().getRevision(); return new URL(url, trimHeadSlash(path.getValue()) + param().add("op=diff").add("rev=" + r)); }
/** * Returns the diff link value. * * @param path the given path value. * * @return the diff link value. * * @throws IOException DOCUMENT ME! */ @Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() != EditType.EDIT) { return null; // no diff if this is not an edit change } final int r = path.getLogEntry().getRevision(); return new URL(url, "diff/" + trimHeadSlash(path.getValue()) + param().add("rev1=" + (r-1) + ";rev2=" + r) ); }
/** * Returns the file link value. * * @param path the given path value. * * @return the file link value. * * @throws IOException DOCUMENT ME! */ @Override public URL getFileLink(Path path) throws IOException { final int r = path.getLogEntry().getRevision(); return new URL(url, "view/" + trimHeadSlash(path.getValue()) + param().add("rev=" + r) ); }
/** * Returns the diff link value. * * @param path the given path value. * @return the diff link value. * @throws IOException DOCUMENT ME! */ @Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() != EditType.EDIT) { return null; // no diff if this is not an edit change } int r = path.getLogEntry().getRevision(); return new URL(url, trimHeadSlash(path.getValue()) + param().add("op=diff").add("rev=" + r)); }
/** * Returns the diff link value. * * @param path the given path value. * @return the diff link value. * @throws IOException DOCUMENT ME! */ @Override public URL getDiffLink(Path path) throws IOException { if (path.getEditType() != EditType.EDIT) { return null; // no diff if this is not an edit change } int r = path.getLogEntry().getRevision(); return new URL(url, trimHeadSlash(path.getValue()) + param().add("op=diff").add("rev=" + r)); }
/** * Returns the file link value. * * @param path the given path value. * @return the file link value. * @throws IOException DOCUMENT ME! */ @Override public URL getFileLink(Path path) throws IOException { final int r = path.getLogEntry().getRevision(); return new URL( url, "view/" + trimHeadSlash(path.getValue()) + param().add("rev=" + r) ); }
@Override public URL getFileLink(Path path) throws IOException { return new URL(url,trimHeadSlash(path.getValue())+param()); }
/** * {@inheritDoc} */ public URL getDiffLink(SubversionChangeLogSet.Path path) throws IOException { if (path.getEditType() != EditType.EDIT) { // No diff if the file is being added or deleted. return null; } int revision = path.getLogEntry().getRevision(); QueryBuilder query = new QueryBuilder(null); query.add("r1=" + (revision - 1)); query.add("r2=" + revision); return new URL(url, trimHeadSlash(path.getValue()) + query); }
/** * Creates a link to the file. * https://[Phabricator URL]/diffusion/$repo/history/master/$path;$revision * * @param path * @return file link * @throws IOException */ @Override public URL getFileLink(Path path) throws IOException { int r = path.getLogEntry().getRevision(); final String spec = String.format("/diffusion/%s/history/master/%s;%i", this.getRepo(), path.getPath(), r); return new URL(getUrl(), spec); }
/** * {@inheritDoc} */ public URL getDiffLink(SubversionChangeLogSet.Path path) throws IOException { if (path.getEditType() != EditType.EDIT) { // No diff if the file is being added or deleted. return null; } int revision = path.getLogEntry().getRevision(); QueryBuilder query = new QueryBuilder(null); query.add("r1=" + (revision - 1)); query.add("r2=" + revision); return new URL(url, trimHeadSlash(path.getValue()) + query); }
/** * {@inheritDoc} */ public URL getDiffLink(SubversionChangeLogSet.Path path) throws IOException { if (path.getEditType() != EditType.EDIT) { // No diff if the file is being added or deleted. return null; } int revision = path.getLogEntry().getRevision(); QueryBuilder query = new QueryBuilder(null); query.add("r1=" + (revision - 1)); query.add("r2=" + revision); return new URL(url, trimHeadSlash(path.getValue()) + query); }
@Override public URL getFileLink(Path path) throws IOException { return new URL(url, trimHeadSlash(path.getValue()) + param()); }
@Override public URL getFileLink(Path path) throws IOException { return new URL(url, trimHeadSlash(path.getValue()) + param()); }
/** * {@inheritDoc} */ public URL getFileLink(SubversionChangeLogSet.Path path) throws IOException { int revision = path.getLogEntry().getRevision(); QueryBuilder query = new QueryBuilder(null); query.add("rev=" + revision); query.add("view=log"); return new URL(url, trimHeadSlash(path.getValue()) + query); }