Example #1
0
            public void GeneratePromotionEntry(string issueNumber, string promotionGroup)
            {
                if (PvcsArchiveRevisionDetailCollection.HasIssueNumber(issueNumber))
                {
                    // This Archive has this Issue Number

                    // Find the revision with this Promotion Group
                    PvcsArchiveRevisionDetail pvcsArchiveRevisionDetail =
                        PvcsArchiveRevisionDetailCollection.HighestRevisionWithPromotionGroup(promotionGroup);
                    if (pvcsArchiveRevisionDetail != null)
                    {
                        // This Archive has a revision at this Promotion Group
                        if (pvcsArchiveRevisionDetail.ArchiveName.IndexOf(' ') >= 0)
                        {
                            Console.Write("\"{0}\"", pvcsArchiveRevisionDetail.ArchiveName);
                        }
                        else
                        {
                            Console.Write("{0}", pvcsArchiveRevisionDetail.ArchiveName);
                        }
                        Console.WriteLine(" - {0} : {1} = {2} = NoLockers",
                                          pvcsArchiveRevisionDetail.PromotionGroup,
                                          pvcsArchiveRevisionDetail.RevisionNumber,
                                          (String.IsNullOrEmpty(pvcsArchiveRevisionDetail.DeveloperId)?"Unknown":pvcsArchiveRevisionDetail.DeveloperId));
                    }
                } // This Archive has this Issue Number
            }
Example #2
0
            public void AddArchiveDetail(string reportDataText)
            {
                string [] archiveDetailItem = reportDataText.Split(new char[] { ' ', ':', '=' }, StringSplitOptions.RemoveEmptyEntries);

                string promotionGroup = archiveDetailItem[0];

                if (string.Compare(promotionGroup, "[NoPromoGroup]", true) == 0)
                {
                    // Use the Promotion Group of the higher revision
                    if (PvcsArchiveRevisionDetailCollection.Count > 0)
                    {
                        promotionGroup =
                            PvcsArchiveRevisionDetailCollection.ElementAt(PvcsArchiveRevisionDetailCollection.Count - 1)
                            .PromotionGroup;
                    }
                    else
                    {
                        promotionGroup = "NoPromoGroup";
                    }
                }

                // Find the second colon beyond which is the description
                int colonIndex = reportDataText.IndexOf(':');

                colonIndex = reportDataText.IndexOf(':', colonIndex + 1);
                string description;

                if ((colonIndex + 1) < reportDataText.Length)
                {
                    description = reportDataText.Substring(colonIndex + 1).Trim(' ');
                }
                else
                {
                    description = "";
                }

                string[] descriptionPart = description.Split(new char[] { ' ', '-' }, StringSplitOptions.RemoveEmptyEntries);

                string revisionNumber = archiveDetailItem[1];
                string issueNumber    = descriptionPart[0].Trim(new char[] { ':' }).ToUpper();

                if (descriptionPart.Length > 1)
                {
                    int numeric = 0;
                    if (Int32.TryParse(descriptionPart[1], out numeric))
                    {
                        issueNumber += descriptionPart[1];
                    }
                }
                if (String.IsNullOrEmpty(issueNumber))
                {
                    Console.WriteLine("\"{0}\" has empty Issue Number in \"{1}\"", Name, description);
                }
                string developerId = archiveDetailItem[2];
                PvcsArchiveRevisionDetail pvcsArchiveRevisionDetail =
                    new PvcsArchiveRevisionDetail(Name, revisionNumber, promotionGroup, issueNumber, developerId, description);

                PvcsArchiveRevisionDetailCollection.Add(pvcsArchiveRevisionDetail);
            }
Example #3
0
            }         // CheckDescendents

            public void CheckBuriedPromotionGroup(int indent, string promotionGroup)
            {
                PvcsArchiveRevisionDetail highestRevisionWithPromotionGroup = PvcsArchiveRevisionDetailCollection.HighestRevisionWithPromotionGroup(promotionGroup);

                if (highestRevisionWithPromotionGroup != null)
                {
                    // A revision with this Promotion Group exists

                    // Check all other higher Promotion Groups

                    // check up to but not including the specified Promotion Group
                    int maximumHierarchyIndex = PromotionGroupDetailCollection.HierarchyIndex(promotionGroup) - 1;

                    for (int hierarchyIndex = PvcsPromotionGroupDetailCollection.DevelopmentHierarchyBaseIndex;
                         hierarchyIndex < maximumHierarchyIndex;
                         ++hierarchyIndex)
                    {
                        string higherPromotionGroup = PromotionGroupDetailCollection.PromotionGroup(hierarchyIndex);
                        PvcsArchiveRevisionDetail higherRevisionWithPromotionGroup = PvcsArchiveRevisionDetailCollection.HighestRevisionWithPromotionGroup(higherPromotionGroup);
                        if (higherRevisionWithPromotionGroup != null)
                        {
                            bool specifiedPromotionGroupOnSameBranch =
                                PvcsArchiveRevisionDetailCollection.RevisionsOnTheSameBranch(
                                    highestRevisionWithPromotionGroup.RevisionNumber,
                                    higherRevisionWithPromotionGroup.RevisionNumber);

                            if (!specifiedPromotionGroupOnSameBranch)
                            {
                                Console.WriteLine("\"{0}\" has both {1} at r{2} and {3} at r{4}",
                                                  highestRevisionWithPromotionGroup.ArchiveName,
                                                  highestRevisionWithPromotionGroup.PromotionGroup,
                                                  highestRevisionWithPromotionGroup.RevisionNumber,
                                                  higherRevisionWithPromotionGroup.PromotionGroup,
                                                  higherRevisionWithPromotionGroup.RevisionNumber);
                                Console.WriteLine("{0}Is not on the same branch", Indent(indent));
                            }
                            else
                            {
                                bool specifiedPromotionGroupAtHigherRevision =
                                    PvcsArchiveRevisionDetailCollection.RevisionNumberIsGreater(
                                        highestRevisionWithPromotionGroup.RevisionNumber,
                                        higherRevisionWithPromotionGroup.RevisionNumber);
                                if (!specifiedPromotionGroupAtHigherRevision)
                                {
                                    Console.WriteLine("\"{0}\" has both {1} at r{2} and {3} at r{4}",
                                                      highestRevisionWithPromotionGroup.ArchiveName,
                                                      highestRevisionWithPromotionGroup.PromotionGroup,
                                                      highestRevisionWithPromotionGroup.RevisionNumber,
                                                      higherRevisionWithPromotionGroup.PromotionGroup,
                                                      higherRevisionWithPromotionGroup.RevisionNumber);
                                    Console.WriteLine("{0}Is not at a higher revision", Indent(indent));
                                }
                            }
                        }
                    }
                } // A revision with this Promotion Group exists
            }