Exemplo n.º 1
0
        }     // GeneratePromotionGroupEntryForIssue

        public string GeneratePromotionGroupEntry(string promotionGroup)
        {
            string entry = null;

            if (PvcsArchiveRevisionDetailCollection.HasPromotionGroup(promotionGroup))
            {
                // 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)
                    {
                        entry = String.Format("\"{0}\"", pvcsArchiveRevisionDetail.ArchiveName);
                    }
                    else
                    {
                        entry = String.Format("{0}", pvcsArchiveRevisionDetail.ArchiveName);
                    }
                    entry += String.Format(" - {0} : {1} = {2} = NoLockers",
                                           pvcsArchiveRevisionDetail.PromotionGroup,
                                           pvcsArchiveRevisionDetail.RevisionNumber,
                                           (String.IsNullOrEmpty(pvcsArchiveRevisionDetail.DeveloperId) ? "Unknown" : pvcsArchiveRevisionDetail.DeveloperId));
                }
            }
            return(entry);
        }
Exemplo n.º 2
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 = PvcsCompleteSystemArchiveDetail.PromotionGroupDetailCollection.HierarchyIndex(promotionGroup) - 1;

                for (int hierarchyIndex = PvcsPromotionGroupDetailCollection.DevelopmentHierarchyBaseIndex;
                     hierarchyIndex < maximumHierarchyIndex;
                     ++hierarchyIndex)
                {
                    string higherPromotionGroup = PvcsCompleteSystemArchiveDetail.PromotionGroupDetailCollection.PromotionGroupName(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", ConsoleDisplay.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", ConsoleDisplay.Indent(indent));
                            }
                        }
                    }
                }
            } // A revision with this Promotion Group exists
        }
Exemplo n.º 3
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 = String.Empty;

            if (colonIndex >= 0)
            {
                if ((colonIndex + 1) < reportDataText.Length)
                {
                    description = reportDataText.Substring(colonIndex + 1).Trim(' ');
                }
                else
                {
                    description = String.Empty;
                }
            }

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

            string revisionNumber = archiveDetailItem[1];
            string issueNumber    = String.Empty;

            if (descriptionPart.Length > 0)
            {
                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);
        }