Mercurial: Properly cleanup commit message

Change-Id: If035d3a2476408d3c54aa30f9b276bc5921845b3
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
This commit is contained in:
Orgad Shaneh
2014-11-04 23:49:51 +02:00
committed by Orgad Shaneh
parent 0ee23c2313
commit ace663a5be
2 changed files with 12 additions and 0 deletions

View File

@@ -151,5 +151,14 @@ QString MercurialCommitWidget::repoRoot()
return mercurialCommitPanelUi.repositoryLabel->text();
}
QString MercurialCommitWidget::cleanupDescription(const QString &input) const
{
const QRegularExpression commentLine(QLatin1String("^HG:[^\\n]*(\\n|$)"),
QRegularExpression::MultilineOption);
QString message = input;
message.remove(commentLine);
return message;
}
} // namespace Internal
} // namespace Mercurial

View File

@@ -53,6 +53,9 @@ public:
QString committer();
QString repoRoot();
protected:
QString cleanupDescription(const QString &input) const;
private:
QWidget *mercurialCommitPanel;
Ui::MercurialCommitPanel mercurialCommitPanelUi;