2 * This file is part of the vng project
3 * Copyright (C) 2008 Thomas Zander <tzander@trolltech.com>
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (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, see <http://www.gnu.org/licenses/>.
21 #include "AbstractCommand.h"
25 /// The command to record a set of changes into a patch.
26 class Record
: public AbstractCommand
30 Unset
, ///< Use the command line options for usage mode
31 InteractiveSelection
, ///< give the user a prompt to select which hunks to record
32 AllChanges
, ///< Add all changes to the patch
33 Index
///< Use the git index without change
39 * Set the message that will be placed in the recorded patch.
41 void setPatchName(const QByteArray
&patchName
);
42 /// returns the message
43 QByteArray
patchName() const;
46 * Set the way that the patches to be recorded will be decided based on the usage mode.
48 void setUsageMode(UsageMode mode
);
49 /// retuns the sha1 of the recorded patch after run() has successfully concluded.
52 // is set to true, force the editor to be started, if false use the command line options
53 void setEditComment(bool on
) { m_editComment
= on
; }
55 virtual ReturnCodes
run();
58 virtual QString
argumentDescription() const;
59 virtual QString
commandDescription() const;
62 ReturnCodes
addFilesPerAcceptance(const ChangeSet
&changeSet
, bool allChanges
);
65 QByteArray m_patchName
;