@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); }
private String preparePath(String path) { Job job = getParent().getRun().getParent(); SCMTriggerItem s = SCMTriggerItem.SCMTriggerItems.asSCMTriggerItem(job); if (s == null) { String commonPart = findCommonPart(expandedRemote, path); if (commonPart != null) { if (path.startsWith("/")) {
/*package*/ SubversionChangeLogSet(AbstractBuild build, List<LogEntry> logs) { super(build); // we want recent changes first Collections.sort(logs, new Comparator<LogEntry>() { public int compare(LogEntry a, LogEntry b) { return b.getRevision() - a.getRevision(); } }); this.logs = Collections.unmodifiableList(logs); for (LogEntry log : logs) { log.setParent(this); } }
/** * Removes duplicate entries, e.g. those coming form svn:externals. * * @param items list of items * @return filtered list without duplicated entries */ static List<LogEntry> removeDuplicatedEntries(List<LogEntry> items) { Set<LogEntry> entries = new HashSet<LogEntry>(items); for (LogEntry sourceEntry : items) { // LogEntry equality does not consider paths, but some might have localPath attributes // that would get lost by HashSet duplicate removal for (LogEntry destinationEntry : entries) { if (sourceEntry.equals(destinationEntry)) { // get all local paths and set in destination for (Path sourcePath : sourceEntry.getPaths()) { if (sourcePath.localPath != null) { for (Path destinationPath : destinationEntry.getPaths()) { if (sourcePath.value.equals(destinationPath.value)) { destinationPath.localPath = sourcePath.localPath; } } } } } } } return new ArrayList<LogEntry>(entries); }
private String preparePath(String path) { SCM scm = getParent().build.getProject().getScm(); if (!(scm instanceof SubversionSCM)) { return path; } ModuleLocation[] locations = ((SubversionSCM) scm).getLocations(); for (int i = 0; i < locations.length; i++) { String commonPart = findCommonPart(locations[i].remote, path); if (commonPart != null) { if (path.startsWith("/")) { path = path.substring(1); } String newPath = path.substring(commonPart.length()); if (newPath.startsWith("/")) { newPath = newPath.substring(1); } return newPath; } } return path; }
private String preparePath(String path) { SCM scm = getParent().build.getProject().getScm(); if (!(scm instanceof SubversionSCM)) { return path; } ModuleLocation[] locations = ((SubversionSCM) scm).getLocations(); for (int i = 0; i < locations.length; i++) { String commonPart = findCommonPart(locations[i].remote, path); if (commonPart != null) { if (path.startsWith("/")) { path = path.substring(1); } String newPath = path.substring(commonPart.length()); if (newPath.startsWith("/")) { newPath = newPath.substring(1); } return newPath; } } return path; }
/** * 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) ); }
/** * 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 } final 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 change set link value. * * @param changeSet the given changeSet value. * * @return the change set link value. * * @throws IOException DOCUMENT ME! */ @Override public URL getChangeSetLink(SubversionChangeLogSet.LogEntry changeSet) throws IOException { final int r = changeSet.getRevision(); return new URL(url, "revision/" + param().add("rev=" + r) ); }
/** * Returns the change set link value. * * @param changeSet the given changeSet value. * @return the change set link value. * @throws IOException DOCUMENT ME! */ @Override public URL getChangeSetLink(SubversionChangeLogSet.LogEntry changeSet) throws IOException { final int r = changeSet.getRevision(); return new URL( url, "revision/" + 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 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 change set link value. * * @param changeSet the given changeSet value. * * @return the change set link value. * * @throws IOException DOCUMENT ME! */ @Override public URL getChangeSetLink(SubversionChangeLogSet.LogEntry changeSet) throws IOException { return new URL(url, "." + param().add("rev=" + changeSet.getRevision()).add("sc=1")); }
/** * 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) ); }
/** * 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); }