Ejemplo n.º 1
0
        /// <inheritdoc />
        public ICommit GetCommit(RevSpec revision)
        {
            var query = new HgLogQuery(revision)
                        .Last();

            return((HgCommit)Log(query).First());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Create a <see cref="HgLogQuery"/> that includes the commit
        /// specified and all ancestor commits.
        /// </summary>
        /// <param name="query">The <see cref="HgLogQuery"/> to end with.</param>
        public HgLogQuery AncestorsOf(HgLogQuery query)
        {
            if (query == null)
            {
                throw new ArgumentNullException(nameof(query));
            }

            return(RevSpec.AncestorsOf(query.Revision));
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        public ICommit CurrentCommit()
        {
            var id       = _repository.Identify();
            var revision = new HgLogQuery(RevSpec.To(id))
                           .ExceptTaggingCommits()
                           .Last()
                           .Revision;

            return(GetCommit(revision));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a <see cref="HgLogQuery"/> that finds the common ancestor of the two <see cref="HgLogQuery"/>
        /// </summary>
        /// <param name="query1">The first <see cref="HgLogQuery"/> of which to find the ancestor of.</param>
        /// <param name="query2">The second <see cref="HgLogQuery"/> of which to find the ancestor of.</param>
        public HgLogQuery CommonAncestorOf(HgLogQuery query1, HgLogQuery query2)
        {
            if (query1 == null)
            {
                throw new ArgumentNullException(nameof(query1));
            }

            if (query2 == null)
            {
                throw new ArgumentNullException(nameof(query2));
            }

            return(RevSpec.CommonAncestorOf(
                       query1.Revision,
                       query2.Revision));
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Create a <see cref="HgLogQuery"/> that includes the commit
 /// intersected with <paramref name="left"/> query and <paramref name="right"/> query.
 /// </summary>
 /// <param name="left">Left part of intersection</param>
 /// <param name="right">Right part of intersection</param>
 public HgLogQuery Intersect(HgLogQuery left, HgLogQuery right)
 {
     return(left.Revision & right.Revision);
 }