/*
* 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 Git repository.
*/
/** 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 */
/** git blame command */
/** the UUID of the bridged SVN repository */
/** the svnRev2gitHash map - since git automat. appends it to the log
* message, we don't need it yet. So for now it is here just for
* completeness. */
/** LM date of the corresponding file (cached map refresh indicator) */
private long lastModOldRev;
/**
* Create a new instance of type {@code git}.
*/
public GitRepository() {
type = "git";
datePattern = "EEE MMM dd hh:mm:ss yyyy ZZZZ";
}
/**
* Get path of the requested file given a commit hash.
* Useful for tracking the path when file has changed its location.
*
* @param fileName name of the file to retrieve the path
* @param revision commit hash to track the path of the file
* @return full path of the file on success; null string on failure
*/
throws IOException
{
if (status != 0) {
return path;
}
try {
break;
}
}
} finally {
}
return path;
}
/**
* Get the mapping of this repository based revisions to the revisions of
* the non-hybrid repository. Key is the full git revision aka 'hash', the
* corresponding value is the revision string in the non-hybrid repository.
* @return an empty map, if this is a native git repository or is not
* a hybrid (like git-svn), the fully populated map otherwise.
*/
return oldRevMap;
}
if (! f.exists()) {
return oldRevMap;
}
long t = f.lastModified();
if (t <= lastModOldRev) {
return oldRevMap;
}
lastModOldRev = t;
}
try (DataInputStream dis =
{
// NH40 => an uint32_t and a String of 40 hex characters (sha1)
long rev;
final byte[] hex_uuid = new byte[20];
int i, k;
byte b;
b = hex_uuid[i];
}
}
// sometimes the last record is a placeholder - the hash
// is made of zeros, only.
k = 0;
if (hex_uuid[i] != 0) {
k++;
break;
}
}
if (k == 0) {
}
} catch (IOException e) {
}
}
oldRevMap = m;
return oldRevMap;
}
/**
* Get the UUID assigned by git-svn to the repository.
* @return {@code null} if this is not a subversion hybrid repository,
* the git-svn UUID otherwise. */
if (f.exists()) {
String s;
boolean svn_rem = false;
if (! svn_rem) {
svn_rem = true;
}
continue;
}
s = s.trim();
break;
}
}
} catch (IOException e) {
}
}
}
svnUUID = "";
}
}
}
/**
* {@inheritDoc}
*/
// should not happen twice, but if, make sure we flush the cache
}
super.setDirectoryName(directoryName);
}
/**
* Get an executor to be used for retrieving the history log for the
* named file.
*
* @param file The file to retrieve history for (canonical path incl. source
* root).
* @return An Executor ready to be started
*/
throws IOException
{
}
if (sinceRevision != null) {
}
}
}
/**
* Create a {@code Reader} that reads an {@code InputStream} using the
* correct character encoding.
*
* @param input a stream with the output from a log or blame command
* @return a reader that reads the input
* @throws IOException if the reader cannot be created
*/
@SuppressWarnings("static-method")
// Bug #17731: Git always encodes the log output using UTF-8 (unless
// overridden by i18n.logoutputencoding, but let's assume that hasn't
// been done for now). Create a reader that uses UTF-8 instead of the
// platform's default encoding.
}
/**
* {@inheritDoc}
*/
@SuppressWarnings("resource")
{
byte[] buffer = new byte[8192];
try {
int len;
boolean error = true;
error = false;
if (len > 0) {
}
}
if (error) {
if (len > 0) {
}
}
}
} finally {
// Clean up zombie-processes...
try {
} catch (IllegalThreadStateException exp) {
// the process is still running??? just kill it..
}
}
}
return ret;
}
/**
* {@inheritDoc}
*/
}
// File might have changed its location
if (status != 0) {
if (status != 0) {
}
try {
}
if (status != 0) {
}
break;
}
}
} finally {
}
}
if (status != 0) {
}
}
/**
* Parse the given input for annotation infos.
* @param input data to parse
* @param fileName name of the file associated with the given input (used
* for reporting, only)
* @return a annotion which may or may not contain all reqiuired information.
* @throws IOException
*/
throws IOException
{
int lineno = 0;
++lineno;
} else {
"Did not find annotation in line {0} [{1}] of {2}",
}
}
return ret;
}
/**
* {@inheritDoc}
*/
return true;
}
/**
* {@inheritDoc}
*/
}
}
}
}
/**
* {@inheritDoc}
*/
// Todo: is there a cheap test for whether Git has history
// available for a file?
// Otherwise, this is harmless, since Git's commands will just
// print nothing if there is no history.
return true;
}
/**
* {@inheritDoc}
*/
if (file.isDirectory()) {
return f.exists() && f.isDirectory();
}
return false;
}
/**
* {@inheritDoc}
*/
public boolean isWorking() {
}
return working.booleanValue();
}
/**
* {@inheritDoc}
*/
public boolean hasHistoryForDirectories() {
return true;
}
/**
* {@inheritDoc}
*/
}
/**
* {@inheritDoc}
*/
throws HistoryException
{
}
}