From 4d802c718c5114bbf2d5f8c1d6fbddde498343fa Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 25 Jun 2005 17:28:39 +0000 Subject: [PATCH] Worked on SubversionAddIn. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@169 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/PostBuildEvent.bat | 1 + .../Project/Resources/ContentPanel.xfrm | 154 ------------- .../Project/Resources/DiffPanel.xfrm | 216 +++--------------- .../Project/Resources/InfoPanel.xfrm | 182 ++++++--------- .../Project/Src/AddInOptions.cs | 13 +- .../Project/Src/Commands/AutostartCommands.cs | 20 +- .../HistoryViewDisplayBinding/ContentPanel.cs | 86 ------- .../HistoryViewDisplayBinding/DiffPanel.cs | 35 ++- .../HistoryViewPanel.cs | 13 +- .../HistoryViewDisplayBinding/InfoPanel.cs | 137 +++++++++-- .../SvnProjectBrowserVisitor.cs | 27 +-- .../SubversionAddIn/Project/Src/SvnClient.cs | 21 +- .../Project/SubversionAddIn.csproj | 6 +- .../ProjectBrowser/ProjectBrowserControl.cs | 44 ++-- src/SharpDevelop.sln | 82 +++---- 15 files changed, 368 insertions(+), 669 deletions(-) create mode 100644 src/AddIns/Misc/SubversionAddIn/Project/PostBuildEvent.bat delete mode 100644 src/AddIns/Misc/SubversionAddIn/Project/Resources/ContentPanel.xfrm delete mode 100644 src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/ContentPanel.cs diff --git a/src/AddIns/Misc/SubversionAddIn/Project/PostBuildEvent.bat b/src/AddIns/Misc/SubversionAddIn/Project/PostBuildEvent.bat new file mode 100644 index 0000000000..15ad0cb40d --- /dev/null +++ b/src/AddIns/Misc/SubversionAddIn/Project/PostBuildEvent.bat @@ -0,0 +1 @@ +copy ..\..\..\..\src\AddIns\Misc\SubversionAddIn\RequiredLibraries\ms* . diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Resources/ContentPanel.xfrm b/src/AddIns/Misc/SubversionAddIn/Project/Resources/ContentPanel.xfrm deleted file mode 100644 index 61e2f2c538..0000000000 --- a/src/AddIns/Misc/SubversionAddIn/Project/Resources/ContentPanel.xfrm +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Resources/DiffPanel.xfrm b/src/AddIns/Misc/SubversionAddIn/Project/Resources/DiffPanel.xfrm index c004743e01..2ebbcc31b9 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/Resources/DiffPanel.xfrm +++ b/src/AddIns/Misc/SubversionAddIn/Project/Resources/DiffPanel.xfrm @@ -41,7 +41,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -73,17 +73,27 @@ - + - + + + + + + - - + + + + + + + @@ -96,7 +106,7 @@ - + @@ -123,15 +133,25 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + @@ -140,166 +160,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Resources/InfoPanel.xfrm b/src/AddIns/Misc/SubversionAddIn/Project/Resources/InfoPanel.xfrm index 6373e48598..047acb7017 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/Resources/InfoPanel.xfrm +++ b/src/AddIns/Misc/SubversionAddIn/Project/Resources/InfoPanel.xfrm @@ -1,154 +1,112 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + - - - + + + + + - - - - - + + - - + + - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Src/AddInOptions.cs b/src/AddIns/Misc/SubversionAddIn/Project/Src/AddInOptions.cs index 13c89127c1..1efdfd7ef0 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/Src/AddInOptions.cs +++ b/src/AddIns/Misc/SubversionAddIn/Project/Src/AddInOptions.cs @@ -27,8 +27,8 @@ namespace ICSharpCode.Svn public static string DefaultLogMessage { get { return Properties.Get("DefaultLogMessage", - "# All lines starting with a # will be ignored" + Environment.NewLine + - "# This template can be modified by using the 'Tools->IDE Options->Source Control->Subversion' panel"); + "# All lines starting with a # will be ignored" + Environment.NewLine + + "# This template can be modified by using the 'Tools->IDE Options->Source Control->Subversion' panel"); } set { Properties.Set("DefaultLogMessage", value); @@ -44,6 +44,15 @@ namespace ICSharpCode.Svn } } + public static bool AutomaticallyDeleteFiles { + get { + return Properties.Get("AutomaticallyDeleteFiles", false); + } + set { + Properties.Set("AutomaticallyDeleteFiles", value); + } + } + public static bool AutomaticallyReloadProject { get { return Properties.Get("AutomaticallyReloadProject", true); diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/AutostartCommands.cs b/src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/AutostartCommands.cs index 3e26ef45e3..04c7a1c37c 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/AutostartCommands.cs +++ b/src/AddIns/Misc/SubversionAddIn/Project/Src/Commands/AutostartCommands.cs @@ -49,9 +49,11 @@ namespace ICSharpCode.Svn.Commands void FileSaved(object sender, FileNameEventArgs e) { - // TODO: Reimplement - //ICSharpCode.SharpDevelop.Gui.Pads.ProjectBrowser.ProjectBrowserView pbv = (ICSharpCode.SharpDevelop.Gui.Pads.ProjectBrowser.ProjectBrowserView)WorkbenchSingleton.Workbench.GetPad(typeof(ICSharpCode.SharpDevelop.Gui.Pads.ProjectBrowser.ProjectBrowserView)); - //pbv.VisitRoot(); + ProjectBrowserPad pad = ProjectBrowserPad.Instance; + if (pad == null) return; + FileNode node = pad.ProjectBrowserControl.FindFileNode(e.FileName); + if (node == null) return; + OverlayIconManager.Enqueue(node); } void FileAdded(object sender, FileEventArgs e) @@ -70,9 +72,11 @@ namespace ICSharpCode.Svn.Commands { // Console.WriteLine("REMOVE : " + e.FileName); try { - SvnClient.Instance.Client.Delete( new string [] { - Path.GetFullPath(e.FileName) - }, true); + if (AddInOptions.AutomaticallyDeleteFiles) { + SvnClient.Instance.Client.Delete( new string [] { + Path.GetFullPath(e.FileName) + }, true); + } } catch (Exception ex) { MessageService.ShowError("File removed exception: " + ex); } @@ -82,8 +86,8 @@ namespace ICSharpCode.Svn.Commands { // Console.WriteLine("RENAME : " + e.FileName); try { - SvnClient.Instance.Client.Move(Path.GetFullPath(e.SourceFile), - Revision.Unspecified, + SvnClient.Instance.Client.Move(Path.GetFullPath(e.SourceFile), + Revision.Unspecified, // TODO: Remove this line when upgrading to new NSvn version Path.GetFullPath(e.TargetFile), true ); diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/ContentPanel.cs b/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/ContentPanel.cs deleted file mode 100644 index ebb0746489..0000000000 --- a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/ContentPanel.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Created by SharpDevelop. - * User: Omnibrain - * Date: 22.11.2004 - * Time: 11:08 - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ - -using System; -using System.Drawing; -using System.Text; -using System.Threading; -using System.IO; -using System.Windows.Forms; -using System.Reflection; - -using ICSharpCode.Core; -using ICSharpCode.SharpDevelop; -using ICSharpCode.SharpDevelop.Gui; -using ICSharpCode.SharpDevelop.Gui.XmlForms; -using NSvn.Common; -using NSvn.Core; - -namespace ICSharpCode.Svn -{ - /// - /// Description of InfoPanel. - /// - public class ContentPanel : BaseSharpDevelopUserControl - { - IViewContent viewContent; - - public ContentPanel(IViewContent viewContent) - { - SetupFromXmlStream(GetType().Assembly.GetManifestResourceStream("ICSharpCode.Svn.Resources.ContentPanel.xfrm")); - this.viewContent = viewContent; - ((ListView)ControlDictionary["revisionListView"]).SelectedIndexChanged += new EventHandler(RevisionListViewSelectionChanged); - ControlDictionary["contentRichTextBox"].Enabled = false; - ControlDictionary["contentRichTextBox"].Font = new Font("Courier New", 10); - ControlDictionary["splitter1"].Height = 3; - } - - LogMessage logMessage; - - void DoCat() - { - MemoryStream memStream = new MemoryStream(); - try { - SvnClient.Instance.Client.Cat(memStream, - Path.GetFullPath(viewContent.FileName), - logMessage.Revision == 1 ? Revision.Head : Revision.FromNumber(logMessage.Revision)); - - ControlDictionary["contentRichTextBox"].Enabled = true; - ControlDictionary["contentRichTextBox"].Text = Encoding.Default.GetString(memStream.ToArray()); - ControlDictionary["contentLabel"].Text = "Content of revision " + logMessage.Revision + ":"; - } finally { - memStream.Close(); - } - } - - void RevisionListViewSelectionChanged(object sender, EventArgs e) - { - if (((ListView)ControlDictionary["revisionListView"]).SelectedItems.Count == 0) { - ControlDictionary["contentRichTextBox"].Text = ""; - ControlDictionary["contentRichTextBox"].Enabled = false; - ControlDictionary["contentLabel"].Text = "Content:"; - return; - } - logMessage = ((ListView)ControlDictionary["revisionListView"]).SelectedItems[0].Tag as LogMessage; - SvnClient.Instance.OperationStart("Cat", new ThreadStart(DoCat)); - } - - public void AddLogMessage(LogMessage logMessage) - { - ListViewItem newItem = new ListViewItem(new string[] { - logMessage.Revision.ToString(), - logMessage.Date.ToString(), - logMessage.Author, - logMessage.Message - }); - newItem.Tag = logMessage; - ((ListView)ControlDictionary["revisionListView"]).Items.Add(newItem); - } - } -} diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/DiffPanel.cs b/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/DiffPanel.cs index 305740ba6d..312f4e6baa 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/DiffPanel.cs +++ b/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/DiffPanel.cs @@ -40,17 +40,22 @@ namespace ICSharpCode.Svn ControlDictionary["splitter1"].Height = 3; ListViewItem newItem; - newItem = new ListViewItem(new string[] { "Base", "" }); + newItem = new ListViewItem(new string[] { "Base", "", "", "" }); newItem.Tag = Revision.Base; Get("fromRevision").Items.Add(newItem); - newItem = new ListViewItem(new string[] { "Base", "" }); - newItem.Tag = Revision.Base; - Get("toRevision").Items.Add(newItem); - newItem = new ListViewItem(new string[] { "Head", "" }); - newItem.Tag = Revision.Head; + newItem.Selected = true; + newItem = new ListViewItem(new string[] { "Work", "", "", "" }); + newItem.Tag = Revision.Working; Get("toRevision").Items.Add(newItem); } + protected override void OnLoad(EventArgs e) + { + // fix sizing problems + Get("toRevision").Width -= 13; + ControlDictionary["fromRevisionPanel"].Width = ControlDictionary["topPanel"].Width / 2 - 2; + } + string output = null; string fileName = null; Revision fromRevision; @@ -101,23 +106,31 @@ namespace ICSharpCode.Svn toRevision = Get("toRevision").SelectedItems[0].Tag as Revision; fileName = Path.GetFullPath(viewContent.FileName); - SvnClient.Instance.OperationStart("Diff", new ThreadStart(DoDiffOperation)); + if (fromRevision.ToString() == toRevision.ToString()) { + output = ""; + } else { + SvnClient.Instance.OperationStart("Diff", new ThreadStart(DoDiffOperation)); + } } public void AddLogMessage(LogMessage logMessage) { ListViewItem newItem = new ListViewItem(new string[] { logMessage.Revision.ToString(), - logMessage.Date.ToString() + logMessage.Author, + logMessage.Date.ToString(), + logMessage.Message }); - newItem.Tag = logMessage; + newItem.Tag = Revision.FromNumber(logMessage.Revision); Get("fromRevision").Items.Add(newItem); ListViewItem newItem2 = new ListViewItem(new string[] { logMessage.Revision.ToString(), - logMessage.Date.ToString() + logMessage.Author, + logMessage.Date.ToString(), + logMessage.Message }); - newItem2.Tag = logMessage; + newItem2.Tag = Revision.FromNumber(logMessage.Revision); Get("toRevision").Items.Add(newItem2); } } diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewPanel.cs b/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewPanel.cs index 1edfae3d9d..e24609a9dc 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewPanel.cs +++ b/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewPanel.cs @@ -24,7 +24,6 @@ namespace ICSharpCode.Svn { IViewContent viewContent; - ContentPanel contentPanel; InfoPanel infoPanel; DiffPanel diffPanel; @@ -36,7 +35,7 @@ namespace ICSharpCode.Svn protected override void OnVisibleChanged(EventArgs e) { base.OnVisibleChanged(e); - if (Visible && contentPanel == null) { + if (Visible && infoPanel == null) { Initialize(); } } @@ -47,11 +46,6 @@ namespace ICSharpCode.Svn mainTab.Dock = DockStyle.Fill; mainTab.Alignment = TabAlignment.Bottom; - TabPage contentTabPage = new TabPage("Content"); - contentPanel = new ContentPanel(viewContent); - contentPanel.Dock = DockStyle.Fill; - contentTabPage.Controls.Add(contentPanel); - mainTab.TabPages.Add(contentTabPage); TabPage infoTabPage = new TabPage("Info"); infoPanel = new InfoPanel(viewContent); @@ -86,8 +80,8 @@ namespace ICSharpCode.Svn if (File.Exists(fileName)) { Client client = SvnClient.Instance.Client; client.Log(new string[] { fileName}, - Revision.FromNumber(1), // Revision start - Revision.Working, // Revision end + Revision.Head, // Revision start + Revision.FromNumber(1), // Revision end false, // bool discoverChangePath false, // bool strictNodeHistory new LogMessageReceiver(ReceiveLogMessage)); @@ -97,7 +91,6 @@ namespace ICSharpCode.Svn void ReceiveLogMessage(LogMessage logMessage) { WorkbenchSingleton.SafeThreadCall(infoPanel, "AddLogMessage", logMessage); - WorkbenchSingleton.SafeThreadCall(contentPanel, "AddLogMessage", logMessage); WorkbenchSingleton.SafeThreadCall(diffPanel, "AddLogMessage", logMessage); } } diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/InfoPanel.cs b/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/InfoPanel.cs index 1aa9644184..2a62756d9d 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/InfoPanel.cs +++ b/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/InfoPanel.cs @@ -8,12 +8,14 @@ */ using System; +using System.Collections; using System.Drawing; using System.Reflection; using System.Windows.Forms; using ICSharpCode.SharpDevelop.Gui; using NSvn.Common; using NSvn.Core; +using ICSharpCode.Core; using ICSharpCode.SharpDevelop.Gui.XmlForms; namespace ICSharpCode.Svn @@ -24,6 +26,7 @@ namespace ICSharpCode.Svn public class InfoPanel : BaseSharpDevelopUserControl { IViewContent viewContent; + ListView revisionList, changesList; public InfoPanel(IViewContent viewContent) { @@ -31,38 +34,144 @@ namespace ICSharpCode.Svn SetupFromXmlStream(GetType().Assembly.GetManifestResourceStream("ICSharpCode.Svn.Resources.InfoPanel.xfrm")); - ((ListView)ControlDictionary["revisionListView"]).SelectedIndexChanged += new EventHandler(RevisionListViewSelectionChanged); + revisionList = Get("revision"); + changesList = Get("changes"); + revisionList.SelectedIndexChanged += RevisionListViewSelectionChanged; ControlDictionary["commentRichTextBox"].Enabled = false; ControlDictionary["commentRichTextBox"].Font = new Font("Courier New", 10); + // Work around WinForms/XmlForms bug: ControlDictionary["splitter1"].Height = 3; } + int lastRevision = -1; + + public void AddLogMessage(LogMessage logMessage) + { + if (lastRevision < 0) + lastRevision = logMessage.Revision; + ListViewItem newItem = new ListViewItem(new string[] { + logMessage.Revision.ToString(), + logMessage.Author, + logMessage.Date.ToString(), + logMessage.Message + }); + newItem.Tag = logMessage; + revisionList.Items.Add(newItem); + } + void RevisionListViewSelectionChanged(object sender, EventArgs e) { - if (((ListView)ControlDictionary["revisionListView"]).SelectedItems.Count == 0) { + changesList.Items.Clear(); + if (revisionList.SelectedItems.Count == 0) { ControlDictionary["commentRichTextBox"].Text = ""; ControlDictionary["commentRichTextBox"].Enabled = false; - ControlDictionary["commentLabel"].Text = "Comment:"; return; } ControlDictionary["commentRichTextBox"].Enabled = true; - LogMessage logMessage = ((ListView)ControlDictionary["revisionListView"]).SelectedItems[0].Tag as LogMessage; - ControlDictionary["commentLabel"].Text = "Comment of revision " + logMessage.Revision + ":"; + ListViewItem item = revisionList.SelectedItems[0]; + LogMessage logMessage = item.Tag as LogMessage; ControlDictionary["commentRichTextBox"].Text = logMessage.Message; + ChangedPathDictionary changes = logMessage.ChangedPaths; + if (changes == null) { + changesList.Items.Add("Loading..."); + if (!isLoadingChangedPaths) { + isLoadingChangedPaths = true; + loadChangedPathsItem = item; + new MethodInvoker(LoadChangedPaths).BeginInvoke(null, null); + } + } else { + int pathWidth = 70; + int copyFromWidth = 70; + using (Graphics g = CreateGraphics()) { + foreach (DictionaryEntry entry in changes) { + string path = (string)entry.Key; + path = path.Replace('\\', '/'); + SizeF size = g.MeasureString(path, changesList.Font); + if (size.Width + 4 > pathWidth) + pathWidth = (int)size.Width + 4; + ChangedPath change = (ChangedPath)entry.Value; + string copyFrom = change.CopyFromPath; + if (copyFrom == null) { + copyFrom = string.Empty; + } else { + copyFrom = copyFrom + " : r" + change.CopyFromRevision; + size = g.MeasureString(copyFrom, changesList.Font); + if (size.Width + 4 > copyFromWidth) + copyFromWidth = (int)size.Width + 4; + } + ListViewItem newItem = new ListViewItem(new string[] { + SvnClient.GetActionString(change.Action), + path, + copyFrom + }); + changesList.Items.Add(newItem); + } + } + changesList.Columns[1].Width = pathWidth; + changesList.Columns[2].Width = copyFromWidth; + } } + ListViewItem loadChangedPathsItem; + volatile bool isLoadingChangedPaths; - public void AddLogMessage(LogMessage logMessage) + void LoadChangedPaths() { - ListViewItem newItem = new ListViewItem(new string[] { - logMessage.Revision.ToString(), - logMessage.Date.ToString(), - logMessage.Author, - logMessage.Message - }); - newItem.Tag = logMessage; - ((ListView)ControlDictionary["revisionListView"]).Items.Add(newItem); + try { + LogMessage logMessage = (LogMessage)loadChangedPathsItem.Tag; + string fileName = System.IO.Path.GetFullPath(viewContent.FileName); + Client client = SvnClient.Instance.Client; + try { + client.Log(new string[] { fileName }, + Revision.FromNumber(logMessage.Revision), // Revision start + Revision.FromNumber(logMessage.Revision), // Revision end + true, // bool discoverChangePath + false, // bool strictNodeHistory + new LogMessageReceiver(ReceiveChangedPaths)); + } catch (SvnClientException ex) { + if (ex.ErrorCode == 160013) { + // 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 + true, // bool discoverChangePath + false, // bool strictNodeHistory + new LogMessageReceiver(ReceiveAllChangedPaths)); + } else { + throw; + } + } + loadChangedPathsItem = null; + isLoadingChangedPaths = false; + WorkbenchSingleton.SafeThreadAsyncCall(this, "RevisionListViewSelectionChanged", null, null); + } catch (Exception ex) { + MessageService.ShowError(ex); + } + } + + void ReceiveChangedPaths(LogMessage logMessage) + { + loadChangedPathsItem.Tag = logMessage; + } + + void ReceiveAllChangedPaths(LogMessage logMessage) + { + WorkbenchSingleton.SafeThreadAsyncCall(this, "ReceiveAllChangedPathsInvoked", logMessage); + } + + void ReceiveAllChangedPathsInvoked(LogMessage logMessage) + { + foreach (ListViewItem item in revisionList.Items) { + LogMessage oldMessage = (LogMessage)item.Tag; + if (oldMessage.Revision == logMessage.Revision) { + item.Tag = logMessage; + break; + } + } } } } diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/ProjectBrowserVisitor/SvnProjectBrowserVisitor.cs b/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/ProjectBrowserVisitor/SvnProjectBrowserVisitor.cs index f83796cec9..2c0ded7d93 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/ProjectBrowserVisitor/SvnProjectBrowserVisitor.cs +++ b/src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/ProjectBrowserVisitor/SvnProjectBrowserVisitor.cs @@ -36,26 +36,7 @@ namespace ICSharpCode.Svn public override object Visit(ProjectNode node, object data) { - node.BackColor = System.Drawing.Color.Yellow; - return node.AcceptChildren(this, data); - /*string fileName = node.FileName; - NodeStatus nodeStatus = NodeStatus.None; - if (fileName != null && fileName.Length > 0) { - Status status = client.SingleStatus(Path.GetFullPath(fileName)); - nodeStatus = GetNodeStatus(status.TextStatus); - } - if (data != null) { - ((NodeStatusInformer)data).Inform(nodeStatus); - } - object back = node.AcceptChildren(this, data); - - if (data != null) { - node.NodeStatus = ((NodeStatusInformer)data).NodeStatus; - } else { - node.NodeStatus = nodeStatus; - } - - return back;*/ + return Visit((DirectoryNode)node, data); } public override object Visit(DirectoryNode node, object data) @@ -65,12 +46,6 @@ namespace ICSharpCode.Svn return node.AcceptChildren(this, data); } return data; - /* - Status status = client.SingleStatus(Path.GetFullPath(node.FileName)); - node.NodeStatus = GetNodeStatus(status.TextStatus); - if (data != null) { - ((NodeStatusInformer)data).Inform(node.NodeStatus); - }*/ } public override object Visit(FileNode node, object data) diff --git a/src/AddIns/Misc/SubversionAddIn/Project/Src/SvnClient.cs b/src/AddIns/Misc/SubversionAddIn/Project/Src/SvnClient.cs index d7d172c2a9..15657118b3 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/Src/SvnClient.cs +++ b/src/AddIns/Misc/SubversionAddIn/Project/Src/SvnClient.cs @@ -69,7 +69,23 @@ namespace ICSharpCode.Svn return null; } - string GetActionString(NotifyAction action) + public static string GetActionString(ChangedPathAction action) + { + switch (action) { + case ChangedPathAction.Add: + return GetActionString(NotifyAction.CommitAdded); + case ChangedPathAction.Delete: + return GetActionString(NotifyAction.CommitDeleted); + case ChangedPathAction.Modify: + return GetActionString(NotifyAction.CommitModified); + case ChangedPathAction.Replace: + return GetActionString(NotifyAction.CommitReplaced); + default: + return "unknown"; + } + } + + public static string GetActionString(NotifyAction action) { switch (action) { case NotifyAction.Add: @@ -103,8 +119,9 @@ namespace ICSharpCode.Svn return "modified"; case NotifyAction.CommitReplaced: return "replaced"; + default: + return "unknown"; } - return "unknown"; } void ReceiveNotification(object sender, NotificationEventArgs e) diff --git a/src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj b/src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj index 5140144d15..72c31addaf 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj +++ b/src/AddIns/Misc/SubversionAddIn/Project/SubversionAddIn.csproj @@ -6,6 +6,7 @@ Debug AnyCPU {17F4D7E0-6933-4C2E-8714-FD7E98D625D5} + ..\..\..\..\src\AddIns\Misc\SubversionAddIn\Project\PostBuildEvent.bat True @@ -48,10 +49,9 @@ - + - @@ -67,7 +67,6 @@ - @@ -76,6 +75,7 @@ + diff --git a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserControl.cs b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserControl.cs index 15fabbb4de..960fed0c8b 100644 --- a/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserControl.cs +++ b/src/Main/Base/Project/Src/Gui/Pads/ProjectBrowser/ProjectBrowserControl.cs @@ -101,35 +101,37 @@ namespace ICSharpCode.SharpDevelop.Project CallVisitor(new FileRenameTreeNodeVisitor(e.SourceFile, e.TargetFile)); } - void SelectFile(ProjectNode projectNode, string fileName) - { - string relativeName = FileUtility.GetRelativePath(projectNode.Directory, fileName); - string file = Path.GetFileName(relativeName); - } - public void RefreshView() { // TODO implement refresh. } - public void SelectFile(string fileName) + FileNode FindFileNode(TreeNodeCollection nodes, string fileName) { - if (treeView.Nodes.Count == 0) { - return; - } - - SolutionNode solutionNode = treeView.Nodes[0] as SolutionNode; - if (solutionNode!= null) { - foreach (object o in solutionNode.Nodes) { - ProjectNode projectNode = o as ProjectNode; - if (projectNode != null && projectNode.Project.IsFileInProject(fileName)) { - SelectFile(projectNode, fileName); - return; - } + FileNode fn; + foreach (TreeNode node in nodes) { + fn = node as FileNode; + if (fn != null) { + if (FileUtility.IsEqualFileName(fn.FileName, fileName)) + return fn; } + fn = FindFileNode(node.Nodes, fileName); + if (fn != null) + return fn; } -// treeView.SelectedNode = null; -// ProjectService.CurrentProject = null; + return null; + } + + public FileNode FindFileNode(string fileName) + { + return FindFileNode(treeView.Nodes, fileName); + } + + public void SelectFile(string fileName) + { + FileNode node = FindFileNode(fileName); + if (node != null) + treeView.SelectedNode = node; } public void ViewSolution(Solution solution) diff --git a/src/SharpDevelop.sln b/src/SharpDevelop.sln index f2d989028c..3c8a3af3a0 100644 --- a/src/SharpDevelop.sln +++ b/src/SharpDevelop.sln @@ -1,5 +1,35 @@ Microsoft Visual Studio Solution File, Format Version 9.00 # SharpDevelop 2.0.0.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{5A3EBEBA-0560-41C1-966B-23F7D03A5486}" + ProjectSection(SolutionItems) = postProject + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Tests", "Main\Base\Test\ICSharpCode.SharpDevelop.Tests.csproj", "{4980B743-B32F-4aba-AABD-45E2CAD3568D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop", "Main\Base\Project\ICSharpCode.SharpDevelop.csproj", "{2748AD25-9C63-4E12-877B-4DCE96FBED54}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "Main\Core\Project\ICSharpCode.Core.csproj", "{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StartUp", "Main\StartUp\Project\StartUp.csproj", "{1152B71B-3C05-4598-B20D-823B5D40559E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core.Tests", "Main\Core\Test\ICSharpCode.Core.Tests.csproj", "{AD6FAA08-D6F5-4DBA-AF85-F4DA9F40C3B5}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{9421EDF4-9769-4BE9-B5A6-C87DE221D73C}" + ProjectSection(SolutionItems) = postProject + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework.dll", "Tools\NUnit\src\NUnitFramework\framework\nunit.framework.dll.csproj", "{83DD7E12-A705-4DBA-9D71-09C8973D9382}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.core.dll", "Tools\NUnit\src\NUnitFramework\core\nunit.core.dll.csproj", "{EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj", "{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TextEditor", "Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj", "{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "Libraries\NRefactory\Project\NRefactory.csproj", "{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.extensions.dll", "Tools\NUnit\src\NUnitFramework\extensions\nunit.extensions.dll.csproj", "{98B10E98-003C-45A0-9587-119142E39986}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AddIns", "AddIns", "{14A277EE-7DF1-4529-B639-7D1EF334C1C5}" ProjectSection(SolutionItems) = postProject EndProjectSection @@ -48,36 +78,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StartPage", "AddIns\Misc\St EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddinScout", "AddIns\Misc\AddinScout\Project\AddinScout.csproj", "{4B8F0F98-8BE1-402B-AA8B-C8D548577B38}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{9421EDF4-9769-4BE9-B5A6-C87DE221D73C}" - ProjectSection(SolutionItems) = postProject - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.framework.dll", "Tools\NUnit\src\NUnitFramework\framework\nunit.framework.dll.csproj", "{83DD7E12-A705-4DBA-9D71-09C8973D9382}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.core.dll", "Tools\NUnit\src\NUnitFramework\core\nunit.core.dll.csproj", "{EBD43A7F-AFCA-4281-BB53-5CDD91F966A3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinFormsUI", "Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj", "{D3C782BA-178E-4235-A3BA-8C11DEBB6BEE}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.TextEditor", "Libraries\ICSharpCode.TextEditor\Project\ICSharpCode.TextEditor.csproj", "{2D18BE89-D210-49EB-A9DD-2246FBB3DF6D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NRefactory", "Libraries\NRefactory\Project\NRefactory.csproj", "{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "nunit.extensions.dll", "Tools\NUnit\src\NUnitFramework\extensions\nunit.extensions.dll.csproj", "{98B10E98-003C-45A0-9587-119142E39986}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{5A3EBEBA-0560-41C1-966B-23F7D03A5486}" - ProjectSection(SolutionItems) = postProject - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop.Tests", "Main\Base\Test\ICSharpCode.SharpDevelop.Tests.csproj", "{4980B743-B32F-4aba-AABD-45E2CAD3568D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpDevelop", "Main\Base\Project\ICSharpCode.SharpDevelop.csproj", "{2748AD25-9C63-4E12-877B-4DCE96FBED54}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core", "Main\Core\Project\ICSharpCode.Core.csproj", "{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StartUp", "Main\StartUp\Project\StartUp.csproj", "{1152B71B-3C05-4598-B20D-823B5D40559E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.Core.Tests", "Main\Core\Test\ICSharpCode.Core.Tests.csproj", "{AD6FAA08-D6F5-4DBA-AF85-F4DA9F40C3B5}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -159,6 +159,17 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution + {AD6FAA08-D6F5-4DBA-AF85-F4DA9F40C3B5} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486} + {1152B71B-3C05-4598-B20D-823B5D40559E} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486} + {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486} + {2748AD25-9C63-4E12-877B-4DCE96FBED54} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486} + {4980B743-B32F-4aba-AABD-45E2CAD3568D} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486} + {98B10E98-003C-45A0-9587-119142E39986} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} + {3A9AE6AA-BC07-4A2F-972C-581E3AE2F195} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} + {2D18BE89-D210-49EB-A9DD-2246FBB3DF6D} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} + {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} + {EBD43A7F-AFCA-4281-BB53-5CDD91F966A3} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} + {83DD7E12-A705-4DBA-9D71-09C8973D9382} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} {CE5B42B7-6E8C-4385-9E97-F4023FC16BF2} = {14A277EE-7DF1-4529-B639-7D1EF334C1C5} {FEB825FA-4AD8-425D-8E4A-B5A18EE1B81C} = {14A277EE-7DF1-4529-B639-7D1EF334C1C5} {4EA396ED-64AD-4AD0-A67A-AB363F3E0C79} = {14A277EE-7DF1-4529-B639-7D1EF334C1C5} @@ -177,16 +188,5 @@ Global {B08385CD-F0CC-488C-B4F4-EEB34B6D2688} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D} {1D18D788-F7EE-4585-A23B-34DC8EC63CB8} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D} {EC06F96A-AEEC-49D6-B03D-AB87C6EB674C} = {6604365C-C702-4C10-9BA8-637F1E3D4D0D} - {98B10E98-003C-45A0-9587-119142E39986} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} - {3A9AE6AA-BC07-4A2F-972C-581E3AE2F195} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} - {2D18BE89-D210-49EB-A9DD-2246FBB3DF6D} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} - {D3C782BA-178E-4235-A3BA-8C11DEBB6BEE} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} - {EBD43A7F-AFCA-4281-BB53-5CDD91F966A3} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} - {83DD7E12-A705-4DBA-9D71-09C8973D9382} = {9421EDF4-9769-4BE9-B5A6-C87DE221D73C} - {AD6FAA08-D6F5-4DBA-AF85-F4DA9F40C3B5} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486} - {1152B71B-3C05-4598-B20D-823B5D40559E} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486} - {35CEF10F-2D4C-45F2-9DD1-161E0FEC583C} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486} - {2748AD25-9C63-4E12-877B-4DCE96FBED54} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486} - {4980B743-B32F-4aba-AABD-45E2CAD3568D} = {5A3EBEBA-0560-41C1-966B-23F7D03A5486} EndGlobalSection EndGlobal