/** * 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); }
/** * 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); }
private void andPathsMustNotStartWithSlash() { for(LogEntry entry : changeLogSet.getLogs()) { for(Path path : entry.getPaths()) { Assert.assertFalse(path.getPath().startsWith("/")); } } } }
private void thenPathsMustBeEqualToValues() { for(LogEntry entry : changeLogSet.getLogs()) { for(Path path : entry.getPaths()) { Assert.assertEquals(path.getPath(), path.getValue()); } } }