File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,15 @@ Repository::Repository(const Rules::Repository &rule)
8484 init.setWorkingDirectory (name);
8585 init.start (" git" , QStringList () << " --bare" << " init" );
8686 init.waitForFinished (-1 );
87+ // Write description
88+ if (!rule.description .isEmpty ()) {
89+ QFile fDesc (QDir (name).filePath (" description" ));
90+ if (fDesc .open (QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) {
91+ fDesc .write (rule.description .toUtf8 ());
92+ fDesc .putChar (' \n ' );
93+ fDesc .close ();
94+ }
95+ }
8796 {
8897 QFile marks (name + " /" + marksFileName (name));
8998 marks.open (QIODevice::WriteOnly);
Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ void Rules::load(const QString &filename)
9393 QRegExp matchLine (" match\\ s+(.*)" , Qt::CaseInsensitive);
9494 QRegExp matchActionLine (" action\\ s+(\\ w+)" , Qt::CaseInsensitive);
9595 QRegExp matchRepoLine (" repository\\ s+(\\ S+)" , Qt::CaseInsensitive);
96+ QRegExp matchDescLine (" description\\ s+(.+)$" , Qt::CaseInsensitive);
9697 QRegExp matchBranchLine (" branch\\ s+(\\ S+)" , Qt::CaseInsensitive);
9798 QRegExp matchRevLine (" (min|max) revision (\\ d+)" , Qt::CaseInsensitive);
9899 QRegExp matchAnnotateLine (" annotated\\ s+(\\ S+)" , Qt::CaseInsensitive);
@@ -152,6 +153,9 @@ void Rules::load(const QString &filename)
152153
153154 repo.branches += branch;
154155 continue ;
156+ } else if (matchDescLine.exactMatch (line)) {
157+ repo.description = matchDescLine.cap (1 );
158+ continue ;
155159 } else if (matchRepoLine.exactMatch (line)) {
156160 repo.forwardTo = matchRepoLine.cap (1 );
157161 continue ;
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ class Rules
4343
4444 QString name;
4545 QList<Branch> branches;
46+ QString description;
4647
4748 QString forwardTo;
4849 QString prefix;
You can’t perform that action at this time.
0 commit comments