in java/com/google/gitiles/GitilesView.java [101:143]
public Builder copyFrom(GitilesView other) {
if (type == Type.DOC && other.type == Type.ROOTED_DOC) {
type = Type.ROOTED_DOC;
}
hostName = other.hostName;
servletPath = other.servletPath;
switch (type) {
case HOST_INDEX:
repositoryPrefix = other.repositoryPrefix;
break;
case LOG:
case DIFF:
oldRevision = other.oldRevision;
// $FALL-THROUGH$
case PATH:
case DOC:
case ROOTED_DOC:
case ARCHIVE:
case BLAME:
case SHOW:
path = other.path;
// $FALL-THROUGH$
case REVISION:
revision = other.revision;
// $FALL-THROUGH$
case DESCRIBE:
case REFS:
case REPOSITORY_INDEX:
repositoryName = other.repositoryName;
// $FALL-THROUGH$
default:
break;
}
if (other.type == type) {
// Only copy params for matching type.
params.putAll(other.params);
if (type == Type.ARCHIVE) {
extension = other.extension;
}
}
return this;
}