Пример #1
0
        /// <summary>
        /// Aggregates a Build changelog onto a Commit AggregatedChangelog
        /// </summary>
        /// <param name="aggregated">The AggragatedChangelog from a Commit</param>
        /// <returns></returns>
        public AggregatedChangelog AggregateFrom(AggregatedChangelog aggregated)
        {
            if (IsNull)
            {
                return(aggregated);
            }
            var parent = (Build)Parents[0];
            AggregatedChangelog aggregate = parent.AggregateFrom(aggregated);

            aggregate.AggregateNext(this);
            return(aggregate);
        }
Пример #2
0
        /// <summary>
        /// Agregates a changelog from this commit to its ancestor
        /// </summary>
        /// <param name="ancestor">this and ancestor must form a boolean algrebra with ancestor at the top</param>
        /// <returns></returns>
        public AggregatedChangelog AncestorChangelog(Commit ancestor)
        {
            if (ancestor.Hash == Hash)
            {
                return(AggregatedChangelog.EmptyChangelog());
            }
            Commit next = Parents[0];

            for (int i = 1; i < Parents.Length; i++)
            {
                next = LCAFind(next, Parents[i]);
            }
            AggregatedChangelog aggregate = next.AncestorChangelog(ancestor);

            aggregate.AggregateNext(this);
            return(aggregate);
        }
Пример #3
0
        /// <summary>
        /// Aggregates the changelog from initial commit to this commit
        /// </summary>
        /// <returns></returns>
        public AggregatedChangelog AggregateChangelog()
        {
            if (IsNull)
            {
                return(AggregatedChangelog.EmptyChangelog());
            }
            if (Parents.Length == 0 || Parents[0].IsNull)
            {
                return(new AggregatedChangelog(this));
            }
            Commit next = Parents[0];

            for (int i = 1; i < Parents.Length; i++)
            {
                next = LCAFind(next, Parents[i]);
            }
            AggregatedChangelog aggregate = next.AggregateChangelog();

            aggregate.AggregateNext(this);
            return(aggregate);
        }
Пример #4
0
 /// <summary>
 /// Aggregates files from various Versions into one Version
 /// </summary>
 /// <param name="aggregated"></param>
 /// <returns></returns>
 public Version AggregateVersion(AggregatedChangelog aggregated)
 {
     return(directory.AggregateVersion(aggregated));
 }