Пример #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);
         }
     }
 }
Пример #2
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);
         }
     }
 }
Пример #3
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);
     }
 }
Пример #4
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;
				SD.MainThread.InvokeAsyncAndForget(() => this.RevisionListViewSelectionChanged(null, EventArgs.Empty));
			} catch (Exception ex) {
				MessageService.ShowException(ex);
			}
		}