Esempio n. 1
0
        public List <RevisionData> GetRevisionData(int firstRevision, int lastRevision)
        {
            List <RevisionData> revisions = new List <RevisionData>();
            SvnClient           client    = AllocSvnClient();

            try
            {
                SvnLogArgs args = new SvnLogArgs(new SvnRevisionRange(firstRevision, lastRevision));
                args.StrictNodeHistory    = false;
                args.RetrieveChangedPaths = true;
                args.ThrowOnError         = true;
                args.ThrowOnCancel        = true;
                Collection <SvnLogEventArgs> logEvents;
                client.GetLog(_uri, args, out logEvents);
                foreach (SvnLogEventArgs e in logEvents)
                {
                    RevisionData data = new RevisionData();
                    data.Revision  = (int)e.Revision;
                    data.Author    = e.Author ?? "";
                    data.Message   = e.LogMessage ?? "";
                    data.Timestamp = e.Time;
                    AddChanges(data, e.ChangedPaths);
                    revisions.Add(data);

                    lock (_messages) _messages[data.Revision] = data.Message;
                }
            }
            finally
            {
                FreeSvnClient(client);
            }
            return(revisions);
        }
Esempio n. 2
0
 static void AddChanges(RevisionData data, IEnumerable <SvnChangeItem> changes)
 {
     if (changes == null)
     {
         return;
     }
     foreach (var item in changes)
     {
         data.Changes.Add(new PathChange
         {
             Change   = ConvertActionToChange(item.Action),
             Revision = data.Revision,
             Path     = item.Path,
             IsCopy   = item.CopyFromPath != null
         });
     }
 }