/*
* 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.
*/
"org.opensolaris.opengrok.history.AccuRev";
/**
* The command to use to access the repository if none was given explicitly
*/
public AccuRevRepository() {
type = "AccuRev";
datePattern = "yyyy/MM/dd hh:mm:ss";
}
/*
* ----------------------------------------------- Strip off source root
* to get to workspace path.
*-----------------------------------------------
*/
}
int lineno = 0;
try {
++lineno;
} else {
"Did not find annotation in line "
}
}
} catch (IOException e) {
"Could not read annotations for " + file, 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.
* @return An Executor ready to be started
*/
/*
* ----------------------------------------------- Strip off source root
* to get to workspace path.
*-----------------------------------------------
*/
if (!file.isDirectory()) {
}
}
/*
* ----------------------------------------------------------------- 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) {
"Could not obtain status for " + basename);
}
/*
* ------------------------------------------ This really gets the
* contents of the file.
*------------------------------------------
*/
}
return inputStream;
}
throw new UnsupportedOperationException("Not supported yet.");
}
return true;
}
return true;
}
/**
* 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 path The presumed path to an AccuRev workspace directory.
* @return true if the given path is in the depot, false otherwise
*/
boolean status = false;
if (isWorking()) {
try {
break;
}
if (depotMatch.find()) {
status = true;
break;
}
}
} catch (IOException e) {
"Could not find AccuRev repository for " + wsPath);
}
}
return status;
}
try {
} else {
}
} catch (IOException e) {
}
return path;
}
return isInAccuRevDepot(sourceHome);
}
public boolean isWorking() {
}
return working.booleanValue();
}
boolean hasHistoryForDirectories() {
return true;
}
}
}