forked from qt-creator/qt-creator
Adapt to Fossil client version 2.12
Fossil 2.12 changes the output of 'info' command replacing the label that attributes the check-out's hash-id from 'uuid' to 'hash' [1]. [1]: https://fossil-scm.org/fossil/info/8ad5e4690854a81 "src/info.c" Change-Id: I1277d784c377ee37434abc017db748d16353b31e Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -392,9 +392,12 @@ RevisionInfo FossilClient::synchronousRevisionQuery(const QString &workingDirect
|
||||
const QRegularExpression idRx("([0-9a-f]{5,40})");
|
||||
QTC_ASSERT(idRx.isValid(), return RevisionInfo());
|
||||
|
||||
const QString hashToken =
|
||||
(supportedFeatures().testFlag(InfoHashFeature) ? "hash: " : "uuid: ");
|
||||
|
||||
for (const QString &l : output.split('\n', QString::SkipEmptyParts)) {
|
||||
if (l.startsWith("checkout: ", Qt::CaseInsensitive)
|
||||
|| l.startsWith("uuid: ", Qt::CaseInsensitive)) {
|
||||
|| l.startsWith(hashToken, Qt::CaseInsensitive)) {
|
||||
const QRegularExpressionMatch idMatch = idRx.match(l);
|
||||
QTC_ASSERT(idMatch.hasMatch(), return RevisionInfo());
|
||||
revisionId = idMatch.captured(1);
|
||||
@@ -407,8 +410,7 @@ RevisionInfo FossilClient::synchronousRevisionQuery(const QString &workingDirect
|
||||
const QRegularExpressionMatch idMatch = idRx.match(l);
|
||||
if (idMatch.hasMatch())
|
||||
mergeParentIds.append(idMatch.captured(1));
|
||||
} else if (getCommentMsg
|
||||
&& l.startsWith("comment: ", Qt::CaseInsensitive)) {
|
||||
} else if (getCommentMsg && l.startsWith("comment: ", Qt::CaseInsensitive)) {
|
||||
const QStringList commentLineParts = parseRevisionCommentLine(l);
|
||||
commentMsg = commentLineParts.value(0);
|
||||
committer = commentLineParts.value(1);
|
||||
@@ -891,7 +893,9 @@ FossilClient::SupportedFeatures FossilClient::supportedFeatures() const
|
||||
|
||||
const unsigned int version = binaryVersion();
|
||||
|
||||
if (version < 0x20400) {
|
||||
if (version < 0x21200) {
|
||||
features &= ~InfoHashFeature;
|
||||
if (version < 0x20400)
|
||||
features &= ~AnnotateRevisionFeature;
|
||||
if (version < 0x13000)
|
||||
features &= ~TimelinePathFeature;
|
||||
|
||||
@@ -49,12 +49,14 @@ public:
|
||||
DiffIgnoreWhiteSpaceFeature = 0x8,
|
||||
TimelinePathFeature = 0x10,
|
||||
AnnotateRevisionFeature = 0x20,
|
||||
InfoHashFeature = 0x40,
|
||||
AllSupportedFeatures = // | all defined features
|
||||
AnnotateBlameFeature
|
||||
| TimelineWidthFeature
|
||||
| DiffIgnoreWhiteSpaceFeature
|
||||
| TimelinePathFeature
|
||||
| AnnotateRevisionFeature
|
||||
| InfoHashFeature
|
||||
};
|
||||
Q_DECLARE_FLAGS(SupportedFeatures, SupportedFeature)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user