public CompareTo ( |
||
other | Other release tag (can be null). | |
return | int |
public void AddSameTree(TagCommit otherCommit) { Debug.Assert(this != otherCommit); Debug.Assert((_nextSameTree == null && _headSameTree == null) || (_nextSameTree != null && _headSameTree != null && _nextSameTree._headSameTree == _headSameTree)); if (_headSameTree == null) { if (otherCommit._headSameTree == null) { _headSameTree = this; otherCommit._headSameTree = this; _nextSameTree = otherCommit; if (_thisTag.CompareTo(otherCommit._thisTag) < 0) { _bestTagCommit = otherCommit; } else { _bestTagCommit = this; } } else { otherCommit._headSameTree.AddSameTreeFromHead(this); } } else { _headSameTree.AddSameTreeFromHead(otherCommit); } }
void RegisterOneTag(StringBuilder errors, Commit c, string tagName, Func <Commit, ReleaseTagParsingMode> analyseInvalidTagSyntax, ref bool startingVersionForCSemVerFound) { ReleaseTagParsingMode mode = analyseInvalidTagSyntax == null ? ReleaseTagParsingMode.IgnoreMalformedTag : analyseInvalidTagSyntax(c); ReleaseTagVersion v = ReleaseTagVersion.TryParse(tagName, mode == ReleaseTagParsingMode.RaiseErrorOnMalformedTag); if (v.IsMalformed) { // Parsing in strict mode can result in malformed tag. We can not assume that here: // Debug.Assert( mode == ReleaseTagParsingMode.RaiseErrorOnMalformedTag ); if (mode == ReleaseTagParsingMode.RaiseErrorOnMalformedTag) { errors.AppendFormat("Malformed {0} on commit '{1}'.", v.ParseErrorMessage, c.Sha).AppendLine(); } return; } if (v.IsValid) { if (_startingVersionForCSemVer != null) { int cmp = _startingVersionForCSemVer.CompareTo(v); if (cmp == 0) { startingVersionForCSemVerFound = true; } else if (cmp > 0) { // This version is smaller than the StartingVersionForCSemVer: // we ignore it. return; } } if (mode == ReleaseTagParsingMode.RaiseErrorOnMalformedTagAndNonStandardPreReleaseName && v.IsPreRelease && !v.IsPreReleaseNameStandard) { errors.AppendFormat("Invalid PreRelease name in '{0}' on commit '{1}'.", v.OriginalTagText, c.Sha).AppendLine(); return; } TagCommit tagCommit; if (_collector.TryGetValue(c.Sha, out tagCommit)) { tagCommit.AddCollectedTag(v); } else { _collector.Add(c.Sha, tagCommit = new TagCommit(c, v)); } } }