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