public bool Update(HGVersionSpec version)
        {
            Contract.Requires(version != null);

            var arguments = "update -C";

            arguments += " -r " + version.Id;
            Contract.Assume(!String.IsNullOrWhiteSpace(arguments));
            var res = this.Invoke(arguments, longTimeout);

            return(res.ExitCode == 0);
        }
        public bool GetSources(HGVersionSpec Version)
        {
            Contract.Requires(Version != null);
            Contract.Requires(this.WorkingDirectory != null);

            if (!this.CheckRepository())
            {
                return(false);
            }

            repository.Update(Version);

            return(true);
        }
 public IEnumerable<HGVersionSpec> Log(HGVersionSpec first, HGVersionSpec last)
 {
   Contract.Requires(first != null);
   Contract.Requires(last != null);
   var arguments = "log --template \"{rev}\\n\"";
   arguments += " -r " + first.Id + ":" + last.Id;
   Contract.Assume(!String.IsNullOrWhiteSpace(arguments));
   var res = this.Invoke(arguments, mediumTimeout);
   if (res.ExitCode != 0)
   {
     return null;
   }
   return res.StdOut.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries).Select(s => new HGVersionSpec(s));
 }
        public IEnumerable <HGVersionSpec> Log(HGVersionSpec first, HGVersionSpec last)
        {
            Contract.Requires(first != null);
            Contract.Requires(last != null);
            var arguments = "log --template \"{rev}\\n\"";

            arguments += " -r " + first.Id + ":" + last.Id;
            Contract.Assume(!String.IsNullOrWhiteSpace(arguments));
            var res = this.Invoke(arguments, mediumTimeout);

            if (res.ExitCode != 0)
            {
                return(null);
            }
            return(res.StdOut.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries).Select(s => new HGVersionSpec(s)));
        }
        public IEnumerable <HGVersionSpec> VersionRange(HGVersionSpec First, HGVersionSpec Last)
        {
            Contract.Requires(First != null);
            Contract.Requires(Last != null);
            Contract.Ensures(Contract.Result <IEnumerable <HGVersionSpec> >() != null);

            if (!this.CheckRepository())
            {
                return(new HGVersionSpec[0]);
            }

            var first = First.IsNull ? this.repository.Identify("null") : First;
            var last  = Last.IsNull ? this.repository.Identify("tip") : Last;

            var log = repository.Log(first, last);

            return(log ?? new HGVersionSpec[0]);
        }
    public bool GetSources(HGVersionSpec Version)
    {
      Contract.Requires(Version != null);
      Contract.Requires(this.WorkingDirectory != null);

      if (!this.CheckRepository())
      {
        return false;
      }

      repository.Update(Version);

      return true;
    }
    public IEnumerable<HGVersionSpec> VersionRange(HGVersionSpec First, HGVersionSpec Last)
    {
      Contract.Requires(First != null);
      Contract.Requires(Last != null);
      Contract.Ensures(Contract.Result<IEnumerable<HGVersionSpec>>() != null);

      if (!this.CheckRepository())
      {
        return new HGVersionSpec[0];
      }

      var first = First.IsNull ? this.repository.Identify("null") : First;
      var last = Last.IsNull ? this.repository.Identify("tip") : Last;

      var log = repository.Log(first, last);

      return log ?? new HGVersionSpec[0];
    }
    public bool Update(HGVersionSpec version)
    {
      Contract.Requires(version != null);

      var arguments = "update -C";
      arguments += " -r " + version.Id;
      Contract.Assume(!String.IsNullOrWhiteSpace(arguments));
      var res = this.Invoke(arguments, longTimeout);
      return res.ExitCode == 0;
    }