Esempio n. 1
0
 private MyChangeset GetCommentsForBuild(MyTfsBuildDefinition buildDefinition, BuildStatus buildStatus)
 {
     var newBuildHash = buildStatus.GetBuildDataAsHash();
     CommentAndHash cachedChangeset;
     bool haveEverGottenCommentsForThisBuildDef = CachedCommentsByBuildDefinition.TryGetValue(buildDefinition.Name, out cachedChangeset);
     bool areCacheCommentsStale = false;
     if (haveEverGottenCommentsForThisBuildDef)
     {
         string oldBuildHash = cachedChangeset.BuildStatusHash;
         areCacheCommentsStale = oldBuildHash != newBuildHash;
     }
     if (!haveEverGottenCommentsForThisBuildDef || areCacheCommentsStale)
     {
         MyChangeset latestChangeset = buildDefinition.GetLatestChangeset();
         CachedCommentsByBuildDefinition[buildDefinition.Name] = new CommentAndHash(newBuildHash, latestChangeset);
     }
     return CachedCommentsByBuildDefinition[buildDefinition.Name].Changeset;
 }
Esempio n. 2
0
        private MyChangeset GetCommentsForBuild(MyTfsBuildDefinition buildDefinition, BuildStatus buildStatus)
        {
            var            newBuildHash = buildStatus.GetBuildDataAsHash();
            CommentAndHash cachedChangeset;
            bool           haveEverGottenCommentsForThisBuildDef = CachedCommentsByBuildDefinition.TryGetValue(buildDefinition.Name, out cachedChangeset);
            bool           areCacheCommentsStale = false;

            if (haveEverGottenCommentsForThisBuildDef)
            {
                string oldBuildHash = cachedChangeset.BuildStatusHash;
                areCacheCommentsStale = oldBuildHash != newBuildHash;
            }
            if (!haveEverGottenCommentsForThisBuildDef || areCacheCommentsStale)
            {
                MyChangeset latestChangeset = buildDefinition.GetLatestChangeset();
                CachedCommentsByBuildDefinition[buildDefinition.Name] = new CommentAndHash(newBuildHash, latestChangeset);
            }
            return(CachedCommentsByBuildDefinition[buildDefinition.Name].Changeset);
        }