I'm trying to implement VcsRepositoryViewer for Perforce Swarm. The only way Swarm can display diffs for a file revision is on the same page that shows the commit that the file revision was part of. Because of this, I need access to both the filename and change set ID in order to generate the appropriate link to view diffs. getWebRepositoryUrlForFileDiff() currently only has access to the filename and revision.
I can return null from getWebRepositoryUrlForFileDiff() to hide the "(diffs)" link for now, but it would be great if we could get the diff link working without supplying our own template to replace the built-in one.
Is there any way to get access to the change set ID in this function? I realize the design of this new plugin point was to be stateless, so I assume not, but we'd really like to get this working if possible. The problem seems to be that defaultCommitView.ftl has
[#local fileDiffUrl = linkGenerator.getWebRepositoryUrlForFileDiff(file, repositoryData)!/]
[#if fileDiffUrl?has_content]
<a href="${fileDiffUrl}">(diffs)</a>
[/#if]
coded into it so unless we replace the template with our own, I don't see how to do this right now.
Any feedback would be appreciated!