1 // TortoiseGit - a Windows shell extension for easy version control
\r
3 // Copyright (C) 2003-2008 - TortoiseGit
\r
5 // This program is free software; you can redistribute it and/or
\r
6 // modify it under the terms of the GNU General Public License
\r
7 // as published by the Free Software Foundation; either version 2
\r
8 // of the License, or (at your option) any later version.
\r
10 // This program is distributed in the hope that it will be useful,
\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 // GNU General Public License for more details.
\r
15 // You should have received a copy of the GNU General Public License
\r
16 // along with this program; if not, write to the Free Software Foundation,
\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
\r
22 #include "ProgressDlg.h"
\r
24 #include "StdioFileT.h"
\r
25 #include "GitStatus.h"
\r
30 * \ingroup TortoiseProc
\r
31 * Helper class to get the blame information for a file.
\r
33 class CBlame : public CGit
\r
40 * Determine for every line in a versioned file the author, revision of last change, date of last
\r
41 * change. The result is saved to a temporary file.\n
\r
42 * Since this operation takes a long time a progress dialog is shown if \a showprogress is set to TRUE
\r
43 * \param startrev the starting revision of the operation
\r
44 * \param endrev the revision to stop the operation
\r
45 * \param pegrev the peg revision
\r
46 * \param path the path to the file to determine the required information
\r
47 * \return The path to the temporary file or an empty string in case of an error.
\r
49 CString BlameToTempFile(const CTGitPath& path, GitRev startrev, GitRev endrev, GitRev pegrev, CString& logfile, const CString& options, BOOL includemerge, BOOL showprogress, BOOL ignoremimetype);
\r
51 bool BlameToFile(const CTGitPath& path, GitRev startrev, GitRev endrev, GitRev peg, const CTGitPath& tofile, const CString& options, BOOL ignoremimetype, BOOL includemerge);
\r
53 BOOL BlameCallback(LONG linenumber, git_revnum_t revision, const CString& author, const CString& date,
\r
54 git_revnum_t merged_revision, const CString& merged_author, const CString& merged_date, const CString& merged_path,
\r
55 const CStringA& line);
\r
57 BOOL Notify(const CTGitPath& path, git_wc_notify_action_t action,
\r
58 git_node_kind_t kind, const CString& mime_type,
\r
59 git_wc_notify_state_t content_state,
\r
60 git_wc_notify_state_t prop_state, LONG rev,
\r
61 const git_lock_t * lock, git_wc_notify_lock_state_t lock_state,
\r
62 git_error_t * err, apr_pool_t * pool);
\r
63 BOOL Log(git_revnum_t rev, const CString& author, const CString& date, const CString& message, LogChangedPathArray * cpaths, apr_time_t time, int filechanges, BOOL copies, DWORD actions, BOOL haschildren);
\r
65 BOOL m_bCancelled; ///< TRUE if the operation should be canceled
\r
66 LONG m_nCounter; ///< Counts the number of calls to the Cancel() callback (revisions?)
\r
67 LONG m_nHeadRev; ///< The HEAD revision of the file
\r
68 bool m_bNoLineNo; ///< if true, then the line number isn't written to the file
\r
69 bool m_bHasMerges; ///< If the blame has merge info, this is set to true
\r
71 CString m_sSavePath; ///< Where to save the blame data
\r
72 CStdioFileT m_saveFile; ///< The file object to write to
\r
74 CProgressDlg m_progressDlg; ///< The progress dialog shown during operation
\r