Esempio n. 1
0
 void GetLogMessages()
 {
     try {
         LoggingService.Info("SVN: Get log of " + fileName);
         if (File.Exists(fileName))
         {
             using (SvnClientWrapper client = new SvnClientWrapper()) {
                 client.AllowInteractiveAuthorization();
                 client.Log(new string[] { fileName },
                            Revision.Head,                                  // Revision start
                            Revision.FromNumber(1),                         // Revision end
                            int.MaxValue,                                   // Limit
                            false,                                          // bool discoverChangePath
                            false,                                          // bool strictNodeHistory
                            ReceiveLogMessage);
             }
         }
     } catch (Exception ex) {
         // if exceptions aren't caught here, they force SD to exit
         if (ex is SvnClientException || ex is System.Runtime.InteropServices.SEHException)
         {
             LoggingService.Warn(ex);
             SD.MainThread.InvokeAsyncAndForget(() => infoPanel.ShowError(ex));
         }
         else
         {
             MessageService.ShowException(ex);
         }
     }
 }
Esempio n. 2
0
 void LoadChangedPaths(object state)
 {
     try {
         LogMessage logMessage = (LogMessage)loadChangedPathsItem.Tag;
         using (SvnClientWrapper client = new SvnClientWrapper()) {
             client.AllowInteractiveAuthorization();
             try {
                 client.Log(new string[] { fileName },
                            Revision.FromNumber(logMessage.Revision),       // Revision start
                            Revision.FromNumber(logMessage.Revision),       // Revision end
                            int.MaxValue,                                   // limit
                            true,                                           // bool discoverChangePath
                            false,                                          // bool strictNodeHistory
                            ReceiveChangedPaths);
             } catch (SvnClientException ex) {
                 if (ex.IsKnownError(KnownError.FileNotFound))
                 {
                     // This can happen when the file was renamed/moved so it cannot be found
                     // directly in the old revision. In that case, we do a full download of
                     // all revisions (so the file can be found in the new revision and svn can
                     // follow back its history).
                     client.Log(new string[] { fileName },
                                Revision.FromNumber(1),                             // Revision start
                                Revision.FromNumber(lastRevision),                  // Revision end
                                int.MaxValue,                                       // limit
                                true,                                               // bool discoverChangePath
                                false,                                              // bool strictNodeHistory
                                ReceiveAllChangedPaths);
                 }
                 else
                 {
                     throw;
                 }
             }
         }
         loadChangedPathsItem  = null;
         isLoadingChangedPaths = false;
         WorkbenchSingleton.SafeThreadAsyncCall <object, EventArgs>(this.RevisionListViewSelectionChanged, null, EventArgs.Empty);
     } catch (Exception ex) {
         MessageService.ShowError(ex);
     }
 }
Esempio n. 3
0
        public void AddLogMessage(LogMessage logMessage)
        {
            ListViewItem newItem = new ListViewItem(new string[] {
                logMessage.Revision.ToString(),
                logMessage.Author,
                logMessage.Date.ToString(),
                logMessage.Message
            });

            newItem.Tag = Revision.FromNumber(logMessage.Revision);
            leftListView.Items.Add(newItem);

            ListViewItem newItem2 = new ListViewItem(new string[] {
                logMessage.Revision.ToString(),
                logMessage.Author,
                logMessage.Date.ToString(),
                logMessage.Message
            });

            newItem2.Tag = Revision.FromNumber(logMessage.Revision);
            rightListView.Items.Add(newItem2);
        }