private void InitializeBranchVersions() { if (this.versions == null) { this.versions = new List <BranchVersion>(); } else { this.versions.Clear(); } this.versions.Add(new BranchVersion("master")); if (this.repository != null) { IEnumerable <string> versionTags = this.repository.FindTags(Moduni.BranchVersion.RegexVersion); BranchVersion branchVersion; foreach (string versionTag in versionTags) { branchVersion = new BranchVersion(versionTag); this.versions.Add(branchVersion); this.versions.Add(new BranchVersion(branchVersion.ToBranchString())); } this.SortVersionsByDescendingOrder(); } }
/// <summary> /// Publishes a new version of the module whose number is specified as argument. /// </summary> /// <param name="newVersion">The number to identify the new version.</param> public void PublishVersion(BranchVersion newVersion) { string branchName = newVersion.ToBranchString(); if (!this.repository.ContainsBranch(branchName)) { this.repository.CreateBranch(branchName); this.versions.Add(new BranchVersion(branchName)); } this.repository.AddTag(newVersion.ToString()); this.versions.Add(newVersion); this.SortVersionsByDescendingOrder(); }