/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/**
* Access to an AccuRev repository (here an actual user workspace)
*
* AccuRev requires that a user logs into their system before it can be used. So
* on the machine acting as the OpenGrok server, some valid user has to be
* permanently logged in. (accurev login -n <user>)
*
* It appears that the file path that is given to all these methods is the
* complete path to the file which includes the path to the root of the source
* location. This means that when using the -P option of OpenGrok to make all
* the directories pointed to by the source root to be seen as separate projects
* is not all as it would seem. The History GURU always starts building the
* history cache using the source root. Well there is NO HISTORY for anything at
* the source root because it is not part of an actual AccuRev depot. The
* directories within the source root directory represent the work areas of
* AccuRev and it is those areas where history can be obtained. This
* implementation allows those directories to be symbolic links to the actual
* workspaces.
*
* Other assumptions:
* There is only one associated AccuRev depot associated with workspaces.
*
* @author Steven Haehn
*/
/**
* The property name used to obtain the client command for this repository.
*/
/**
* The command to use to access the repository if none was given explicitly
*/
/**
* Create a new instance of type {@code AccuRev}.
*/
public AccuRevRepository() {
type = "AccuRev";
datePattern = "yyyy/MM/dd hh:mm:ss";
}
/**
* {@inheritDoc}
*/
/* Strip off source root to get to workspace path. */
}
int lineno = 0;
try {
lineno++;
} else {
}
}
} catch (IOException e) {
}
return a;
}
/**
* Get an executor to be used for retrieving the history log for the given
* file. (used by AccuRevHistoryParser).
*
* @param file file for which history is to be retrieved (canonical path
* incl. source root).
* @return An Executor ready to be started
*/
/* Strip off source root to get to workspace path. */
if (!file.isDirectory()) {
}
}
/**
* {@inheritDoc}
*/
{
/* The only way to guarantee getting the contents of a file is to fire
* off an AccuRev 'stat'us command to get the element ID number for the
* subsequent 'cat' command. (Element ID's are unique for a file, unless
* evil twins are present) This is because it is possible that the file
* may have been moved to a different place in the depot. The 'stat'
* command will produce a line with the format:
*
* <filePath> <elementID> <virtualVersion> (<realVersion>) (<status>)
*
* /./myFile e:17715 CP.73_Depot/2 (3220/2) (backed)
*/
try {
} catch (IOException e) {
}
/* This really gets the contents of the file */
.getBytes());
}
return inputStream;
}
/**
* {@inheritDoc}
*/
public void update() {
throw new UnsupportedOperationException("Not supported yet.");
}
/**
* {@inheritDoc}
*/
return true;
}
/**
* {@inheritDoc}
*/
return true;
}
/**
* Get the path for the given file relative to the opengrok source root
* directory.
*
* @param file file to check
* @return {@code /./} on error if file names the opengrok source directory,
* the relative path prefixed with a {@code /.} otherwise.
*/
try {
} else {
}
} catch (IOException e) {
}
return path;
}
/**
* Check if a given path is associated with an AccuRev workspace.
*
* The AccuRev 'info' command provides a Depot name when in a known
* workspace. Otherwise, the Depot name will be missing.
*
* @param sourceHome The presumed path to an AccuRev workspace directory.
* @return {@code true} if the given path is in the depot.
*/
// TODO: oh my goodness!!! Have fun invoking this for all files in a
// repo search scan ...
if (isWorking()) {
try {
// TODO: is it ever possible to find a match if not
// logged in? If not, return false immediately.
}
if (depotMatch.find()) {
return true;
}
}
} catch (IOException e) {
+ sourceHome + "'");
}
}
return false;
}
/**
* {@inheritDoc}
*/
public boolean isWorking() {
}
return working.booleanValue();
}
/**
* {@inheritDoc}
*/
public boolean hasHistoryForDirectories() {
return true;
}
/**
* {@inheritDoc}
*/
}
}