Link the tree of the filename in SideBySide2 to gitweb
It is often convenient to be able to see the files in the same tree as the file being reviewed. Update the gitweb linker to support linking to a specific revision and file. Link the base of the filename to the tree and link the project name to the root tree. Change-Id: I11a969e9b1d14ea4180699ae9c02a6a62147d3de
This commit is contained in:
@@ -83,6 +83,18 @@ public class GitwebLink {
|
||||
return baseUrl + pattern.replace(p);
|
||||
}
|
||||
|
||||
public String toFile(String project, String commit, String file) {
|
||||
Map<String, String> p = new HashMap<String, String>();
|
||||
p.put("project", encode(project));
|
||||
p.put("commit", encode(commit));
|
||||
p.put("file", encode(file));
|
||||
|
||||
ParameterizedString pattern = (file == null || file.isEmpty())
|
||||
? new ParameterizedString(type.getRootTree())
|
||||
: new ParameterizedString(type.getFile());
|
||||
return baseUrl + pattern.replace(p);
|
||||
}
|
||||
|
||||
public String toFileHistory(final Branch.NameKey branch, final String file) {
|
||||
ParameterizedString pattern = new ParameterizedString(type.getFileHistory());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user