/*
* 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 a Mercurial repository.
*
*/
/** The property name used to obtain the client command for thisrepository. */
"org.opensolaris.opengrok.history.Mercurial";
/** The command to use to access the repository if none was given explicitly */
/**
* The boolean property and environment variable name to indicate
* whether forest-extension in Mercurial adds repositories inside the
* repositories.
*/
"org.opensolaris.opengrok.history.mercurial.disableForest";
/** Template for formatting hg log output for files. */
+ "{branches}{tags}{parents}\\n"
+ "user: {author}\\ndate: {date|isodate}\\n"
+ "description: {desc|strip|obfuscate}\\n";
/** Template for formatting hg log output for directories. */
+ "files: {files}{file_copies}\\n";
public MercurialRepository() {
type = "Mercurial";
datePattern = "yyyy-MM-dd hh:mm ZZZZ";
}
/**
* Get an executor to be used for retrieving the history log for the
* named file.
*
* @param file The file to retrieve history for
* @param changeset the oldest changeset to return from the executor,
* or {@code null} if all changesets should be returned
* @return An Executor ready to be started
*/
throws HistoryException, IOException
{
}
} else {
throw new HistoryException(
"Don't know how to parse changeset identifier: " +
}
}
}
{
}
try {
int len;
if (len > 0) {
}
}
} finally {
// Clean up zombie-processes...
try {
} catch (IllegalThreadStateException exp) {
// the process is still running??? just kill it..
}
}
}
return ret;
}
/**
*
* @param file file to annotate
* @param revision revision to annotate
* @return file annotation
*/
} else {
}
}
// Construct hash map for history entries from history cache. This is
// needed later to get user string for particular revision.
try {
// Chop out the colon and all hexadecimal what follows.
// This is because the whole changeset identification is
// stored in history index while annotate only needs the
// revision identifier.
}
} catch (HistoryException he) {
"Error: cannot get history for file " + file);
return null;
}
try {
int lineno = 0;
++lineno;
// Use the history index hash map to get the author.
}
} else {
"Error: did not find annotation in line "
}
}
} finally {
try {
} catch (IllegalThreadStateException e) {
// the process is still running??? just kill it..
}
}
}
return ret;
}
return true;
}
}
}
}
}
// Todo: is there a cheap test for whether mercurial has history
// available for a file?
// Otherwise, this is harmless, since mercurial's commands will just
// print nothing if there is no history.
return true;
}
if (file.isDirectory()) {
return f.exists() && f.isDirectory();
}
return false;
}
boolean supportsSubRepositories() {
}
public boolean isWorking() {
}
return working.booleanValue();
}
boolean hasHistoryForDirectories() {
return true;
}
}
throws HistoryException {
// Assign tags to changesets they represent
// We don't need to check if this repository supports tags, because we know it:-)
if (env.isTagsEnabled()) {
}
return result;
}
/**
* We need to create list of all tags prior to creation of HistoryEntries
* per file.
* @return true.
*/
boolean hasFileBasedTags() {
return true;
}
try {
}
// Grrr, how to parse tags with spaces inside?
// This solution will loose multiple spaces;-/
}
}
// Reverse the order of the list
}
} catch (IOException e) {
} catch (HistoryException e) {
}
try {
} catch (IllegalThreadStateException e) {
// the process is still running??? just kill it..
}
}
}
}