0N/A * The contents of this file are subject to the terms of the 0N/A * Common Development and Distribution License (the "License"). 0N/A * You may not use this file except in compliance with the License. 0N/A * language governing permissions and limitations under the License. 0N/A * When distributing Covered Code, include this CDDL HEADER in each 0N/A * If applicable, add the following below this CDDL HEADER, with the 0N/A * fields enclosed by brackets "[]" replaced with your own identifying 0N/A * information: Portions Copyright [yyyy] [name of copyright owner] 1460N/A * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 0N/A * The HistoryGuru is used to implement an transparent layer to the various 0N/A * source control systems. 0N/A /** The one and only instance of the HistoryGuru */ 353N/A /** The history cache to use */ 0N/A * Creates a new instance of HistoryGuru, and try to set the default 0N/A * source control system. 772N/A // Failed to initialize, run without a history cache 0N/A * Get the one and only instance of the HistoryGuru 0N/A * @return the one and only HistoryGuru instance 1474N/A * Check whether a cache should be used for the history log. 1474N/A * @return {@code true} if the history cache has been enabled and is ready 864N/A * Get a string with information about the history cache. 864N/A * @return a free form text string describing the history cache instance 864N/A * @throws HistoryException if an error occurred while getting the info 84N/A * Annotate the specified revision of a file. 84N/A * @param file the file to annotate 84N/A * @param rev the revision to annotate (<code>null</code> means BASE) 87N/A * @return file annotation, or <code>null</code> if the 87N/A * <code>HistoryParser</code> does not support annotation 1182N/A // !!! cannot do this because of not matching rev ids (keys) 1190N/A // first is the most recent one, so we need the position of "rev" 1182N/A // until the end of the list 878N/A //if (hent.indexOf(rev)>0) { 1182N/A // hent = hent.subList(hent.indexOf(rev), hent.size()); 1190N/A //TODO this is only for mercurial, for other SCMs it might also 1190N/A // be a problem, we need to revise how we shorten the rev # for 1190N/A * Get the appropriate history reader for the file specified by parent and 1473N/A * @param file The file to get the history reader for (canonical path incl. 615N/A * @throws HistoryException If an error occurs while getting the history 1183N/A * @return A HistorReader that may be used to read out history data for a 1466N/A * Get the history for the specified file. The type of the returned history 1466N/A * (directory or file) gets automatically determined: If file physically 1466N/A * exists and is a directory, directory is assumed, file otherwise. 1473N/A * @param path The file to get the history for (canonical path incl. 1466N/A * @return The history for the given path including a list of files touched 829N/A * @throws HistoryException on error when accessing the history 1466N/A * Get the history for the specified file. The type of the returned history 1466N/A * (directory or file) gets automatically determined: If file physically 1466N/A * exists and is a directory, directory is assumed, file otherwise. 1473N/A * @param path The file to get the history for (canonical path incl. 1466N/A * @param withFiles If {@code true} the returned history will contain 1466N/A * a list of files touched by each changeset (the file list may be 1466N/A * skipped if {@code false}, but it doesn't have to) 1466N/A * @return The history for the given path. 839N/A * @throws HistoryException on error when accessing the history 1466N/A * Get the history for the specified path. The type of the returned history 1466N/A * (directory or file) gets automatically determined: If <var>path</var> 1466N/A * physically exists and is a directory, directory is assumed, file otherwise. 1473N/A * @param path The path name to get the history for (canonical path 1466N/A * @param withFiles If {@code true} the returned history will contain 1466N/A * a list of files touched by each changeset (the file list may be 1466N/A * skipped if {@code false}, but it doesn't have to) 1466N/A * @param isDir If {@code null} it behaves like 1466N/A * {@link #getHistory(File, boolean)} (auto detect history type). 1466N/A * If {@code true} doesn't check the file and blindly assumes type 1466N/A * directory. Otherwise a file history gets returned. 1466N/A * @return the history for the given path 1466N/A * @throws HistoryException on error when accessing the history 1466N/A * @see #isDirectory(String) 0N/A * Get a named revision of the specified file. 1473N/A * @param parent The directory (canonical path incl. source root) containing 1473N/A * @param basename The name of the file. 1473N/A * @param rev The revision to get. 0N/A * @return An InputStream containing the named revision of the file. 1473N/A * @see "Repository.getHistoryGet(String, String, String)" 0N/A * Does this directory contain files with source control information? 1466N/A * In contrast to {@link #isDirectory(String)} this usually doesn't hit the 1466N/A * history DB but solely ask the repository. 1473N/A * @param file The name of the directory (canonical path incl. source root). 1466N/A * @return {@code true} if the files in this directory have associated 1466N/A * Check if we can annotate the specified file. Doesn't hit the history DB 1473N/A * @param file the file to check (canonical path incl. source root). 1466N/A * @return {@code true} if the file is under version control and the 1466N/A * version control system supports annotation. 1463N/A * Get the last modified times for all files and subdirectories excluding 1463N/A * '.' and '..' in the specified directory the history cache has information 1463N/A * about. The returned map is keyed by the name of the file or subdirectory 1463N/A * and does neither contain a {@code null} key nor a {@code null} value. 1473N/A * @param directory the directory whose files to check (canonical path incl. 1474N/A * @param path2rev If not {@code null}, pathes including their latest 1474N/A * revisions get stored into this map. 1463N/A * @return a possible empty map. 993N/A * recursivelly search for repositories with a depth limit 993N/A * @param files list of files to check if they contain a repo 993N/A * @param repos list of found repos 993N/A * @param ignoredNames what files to ignore 993N/A * @param recursiveSearch whether to use recursive search 1190N/A * @param depth current depth - using global scanningDepth - one can limit 1183N/A * this to improve scanning performance 1327N/A +
file +
"', could not instantiate the repository: " 1250N/A // Not a repository, search it's sub-dirs 1250N/A +
"', check access permissions.");
460N/A // @TODO: Search only for one type of repository - the one found here 1182N/A +
"', check access permissions.");
1190N/A // Search only one level down - if not: too much 1182N/A // stat'ing for huge Mercurial repositories 99N/A * Search through the all of the directories and add all of the source 99N/A * repositories found. 99N/A * @param dir the root directory to start the search in. 203N/A * Update the source the contents in the source repositories. 668N/A * Update the source the contents in the source repositories. 1327N/A +
type +
" repository in '" +
path +
"': Missing SCM dependencies?");
1474N/A * Create the history cache for the given repositories, if caching is 1474N/A * enabled and the repository in question supports history for directories. 1474N/A * @param allRepos repositories in question. If {@code null} all registered 1462N/A +
"history.NumCacheThreads");
795N/A // The cache has been populated. Now, optimize how it is stored on 795N/A // disk to enhance performance and save space. 1461N/A * Remove the history cache for the given repositories. 1461N/A * @param repositories repositories in question. 1474N/A * Create the history cache for all of the repositories. 1466N/A * Check, whether the given path denotes a directory in the history cache. 1466N/A * This really hits the DB, so caching is advised. 1466N/A * @param path The <em>canonical</em> path to the file in question, 1466N/A * e.g. sourceRoot + '/' + projectdir + '/' + subdir with '/' 1474N/A * path separators, only! One trailing slash gets automatically removed 1466N/A * @return {@code null} if an error occured, {@code Boolean#TRUE} if there 1466N/A * is a directory with the given name in the history cache, 1466N/A * {@link Boolean#FALSE} otherwise. 771N/A * Ensure that we have a directory in the cache. If it's not there, fetch 771N/A * its history and populate the cache. If it's already there, and the 771N/A * cache is able to tell how recent it is, attempt to update it to the 771N/A * most recent revision. 1473N/A * @param file the root path to test (canonical path incl. source root). 678N/A * @throws HistoryException if an error occurs while accessing the 771N/A // no repository -> no history :( 771N/A // Cache already exists, but we don't know how recent it is, 771N/A // so don't do anything. 771N/A // Create cache from the beginning if it doesn't exist, or update it 771N/A // incrementally otherwise. 1461N/A * Get the with this instance registered repository for the given file. 1473N/A * @param path canonical path incl. source root to the source file in 1461N/A * @return {@code null} if unknown, the related repository otherwise. 664N/A * Invalidate the current list of known repositories! 664N/A * @param repos The new repositories 1327N/A +
"', could not instantiate the repository: "