From bf8851fec740dcda33896e74d2107e069ab2b7f4 Mon Sep 17 00:00:00 2001 From: govindsalinas Date: Tue, 19 Jun 2007 01:04:45 -0700 Subject: [PATCH] Basic Commit viewer. Commit viewer is there. I hate the MS layout engine. Somehow diffs are getting into the view, but I don't know how. --- CommitViewer.Designer.cs | 222 +++++++++++++++++ CommitViewer.cs | 33 +++ CommitViewer.resx | 153 ++++++++++++ Form1.Designer.cs | 611 ++++++++++++++++++++++++----------------------- Form1.cs | 10 + Git/Commit.cs | 218 +++++++++++++---- Git/Repo.cs | 22 +- Git/Treeish.cs | 3 +- Gitrdone.csproj | 10 + 9 files changed, 910 insertions(+), 372 deletions(-) create mode 100755 CommitViewer.Designer.cs create mode 100755 CommitViewer.cs create mode 100755 CommitViewer.resx rewrite Git/Commit.cs (60%) diff --git a/CommitViewer.Designer.cs b/CommitViewer.Designer.cs new file mode 100755 index 0000000..70f8044 --- /dev/null +++ b/CommitViewer.Designer.cs @@ -0,0 +1,222 @@ +namespace Gitrdone +{ + partial class CommitViewer + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.m_id = new System.Windows.Forms.TextBox(); + this.m_author = new System.Windows.Forms.TextBox(); + this.m_email = new System.Windows.Forms.TextBox(); + this.m_date = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.m_parents = new System.Windows.Forms.ComboBox(); + this.label5 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.label6 = new System.Windows.Forms.Label(); + this.m_message = new System.Windows.Forms.TextBox(); + this.button2 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // m_id + // + this.m_id.BackColor = System.Drawing.SystemColors.Window; + this.m_id.Location = new System.Drawing.Point(82, 12); + this.m_id.Name = "m_id"; + this.m_id.ReadOnly = true; + this.m_id.Size = new System.Drawing.Size(445, 20); + this.m_id.TabIndex = 0; + // + // m_author + // + this.m_author.BackColor = System.Drawing.SystemColors.Window; + this.m_author.Location = new System.Drawing.Point(82, 41); + this.m_author.Name = "m_author"; + this.m_author.ReadOnly = true; + this.m_author.Size = new System.Drawing.Size(445, 20); + this.m_author.TabIndex = 1; + // + // m_email + // + this.m_email.BackColor = System.Drawing.SystemColors.Window; + this.m_email.Location = new System.Drawing.Point(82, 70); + this.m_email.Name = "m_email"; + this.m_email.ReadOnly = true; + this.m_email.Size = new System.Drawing.Size(445, 20); + this.m_email.TabIndex = 2; + // + // m_date + // + this.m_date.BackColor = System.Drawing.SystemColors.Window; + this.m_date.Location = new System.Drawing.Point(82, 99); + this.m_date.Name = "m_date"; + this.m_date.ReadOnly = true; + this.m_date.Size = new System.Drawing.Size(445, 20); + this.m_date.TabIndex = 3; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(9, 15); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(44, 13); + this.label1.TabIndex = 4; + this.label1.Text = "Commit:"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(9, 44); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(41, 13); + this.label2.TabIndex = 5; + this.label2.Text = "Author:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(9, 73); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(35, 13); + this.label3.TabIndex = 6; + this.label3.Text = "Email:"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(9, 102); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(33, 13); + this.label4.TabIndex = 7; + this.label4.Text = "Date:"; + // + // m_parents + // + this.m_parents.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.m_parents.FormattingEnabled = true; + this.m_parents.Location = new System.Drawing.Point(82, 133); + this.m_parents.Name = "m_parents"; + this.m_parents.Size = new System.Drawing.Size(364, 21); + this.m_parents.TabIndex = 8; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(9, 138); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(46, 13); + this.label5.TabIndex = 9; + this.label5.Text = "Parents:"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(453, 131); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(74, 23); + this.button1.TabIndex = 10; + this.button1.Text = "View"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.OnShowParent); + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(9, 188); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(53, 13); + this.label6.TabIndex = 11; + this.label6.Text = "Message:"; + // + // m_message + // + this.m_message.BackColor = System.Drawing.SystemColors.Window; + this.m_message.Location = new System.Drawing.Point(12, 221); + this.m_message.Multiline = true; + this.m_message.Name = "m_message"; + this.m_message.ReadOnly = true; + this.m_message.Size = new System.Drawing.Size(515, 286); + this.m_message.TabIndex = 12; + this.m_message.WordWrap = false; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(451, 513); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 13; + this.button2.Text = "Done"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.OnDone); + // + // CommitViewer + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(539, 548); + this.Controls.Add(this.button2); + this.Controls.Add(this.m_message); + this.Controls.Add(this.label6); + this.Controls.Add(this.button1); + this.Controls.Add(this.label5); + this.Controls.Add(this.m_parents); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.m_date); + this.Controls.Add(this.m_email); + this.Controls.Add(this.m_author); + this.Controls.Add(this.m_id); + this.Name = "CommitViewer"; + this.Text = "CommitViewer"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TextBox m_id; + private System.Windows.Forms.TextBox m_author; + private System.Windows.Forms.TextBox m_email; + private System.Windows.Forms.TextBox m_date; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.ComboBox m_parents; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.TextBox m_message; + private System.Windows.Forms.Button button2; + + + } +} \ No newline at end of file diff --git a/CommitViewer.cs b/CommitViewer.cs new file mode 100755 index 0000000..0f9a6a9 --- /dev/null +++ b/CommitViewer.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using Git; + +namespace Gitrdone +{ + public partial class CommitViewer : Form + { + protected Commit m_commit; + public CommitViewer(Commit c) + { + m_commit = c; + InitializeComponent(); + } + + private void OnShowParent(object sender, EventArgs e) + { + Commit c = new Commit(m_commit.Path, m_parents.SelectedItem.ToString()); + CommitViewer v = new CommitViewer(c); + v.Show(); + } + + private void OnDone(object sender, EventArgs e) + { + Close(); + } + } +} \ No newline at end of file diff --git a/CommitViewer.resx b/CommitViewer.resx new file mode 100755 index 0000000..9e70146 --- /dev/null +++ b/CommitViewer.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file diff --git a/Form1.Designer.cs b/Form1.Designer.cs index 31a4a34..cecc380 100755 --- a/Form1.Designer.cs +++ b/Form1.Designer.cs @@ -30,12 +30,23 @@ namespace Gitrdone { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.m_repoCanvas = new System.Windows.Forms.PictureBox(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.m_reposCombo = new System.Windows.Forms.ToolStripComboBox(); + this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.m_branchesCombo = new System.Windows.Forms.ToolStripComboBox(); + this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton4 = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton5 = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton6 = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton9 = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton14 = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripComboBox1 = new System.Windows.Forms.ToolStripComboBox(); + this.toolStripButton15 = new System.Windows.Forms.ToolStripButton(); + this.toolStripButton16 = new System.Windows.Forms.ToolStripButton(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.gitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.manageReposToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -50,36 +61,11 @@ namespace Gitrdone this.splitContainer3 = new System.Windows.Forms.SplitContainer(); this.m_workspaceTree = new System.Windows.Forms.TreeView(); this.m_treeStrip = new System.Windows.Forms.ToolStrip(); - this.m_tabControl = new System.Windows.Forms.TabControl(); - this.tabPage1 = new System.Windows.Forms.TabPage(); - this.m_commitsView = new System.Windows.Forms.ListView(); - this.m_outputArea = new System.Windows.Forms.ListBox(); - this.toolStrip3 = new System.Windows.Forms.ToolStrip(); - this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader3 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader4 = new System.Windows.Forms.ColumnHeader(); - this.columnHeader5 = new System.Windows.Forms.ColumnHeader(); - this.m_repoCanvas = new System.Windows.Forms.PictureBox(); - this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton2 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton3 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton4 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton5 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton6 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton9 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton14 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton15 = new System.Windows.Forms.ToolStripButton(); - this.toolStripButton16 = new System.Windows.Forms.ToolStripButton(); this.m_addFileButton = new System.Windows.Forms.ToolStripButton(); this.toolStripButton17 = new System.Windows.Forms.ToolStripButton(); this.m_typeSelector = new System.Windows.Forms.ToolStripButton(); this.m_revertFiles = new System.Windows.Forms.ToolStripButton(); this.m_removeFiles = new System.Windows.Forms.ToolStripButton(); - this.m_refreshButton = new System.Windows.Forms.ToolStripButton(); - this.m_fetchCommits = new System.Windows.Forms.ToolStripButton(); - this.m_nextCommits = new System.Windows.Forms.ToolStripButton(); - this.m_previousCommits = new System.Windows.Forms.ToolStripButton(); this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripSplitButton(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); @@ -90,9 +76,24 @@ namespace Gitrdone this.toolStripMenuItem8 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem9 = new System.Windows.Forms.ToolStripMenuItem(); + this.m_refreshButton = new System.Windows.Forms.ToolStripButton(); + this.m_tabControl = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.m_commitsView = new System.Windows.Forms.ListView(); + this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader3 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader4 = new System.Windows.Forms.ColumnHeader(); + this.columnHeader5 = new System.Windows.Forms.ColumnHeader(); + this.toolStrip3 = new System.Windows.Forms.ToolStrip(); + this.m_fetchCommits = new System.Windows.Forms.ToolStripButton(); + this.m_nextCommits = new System.Windows.Forms.ToolStripButton(); + this.m_previousCommits = new System.Windows.Forms.ToolStripButton(); + this.m_outputArea = new System.Windows.Forms.ListBox(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.m_repoCanvas)).BeginInit(); this.toolStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout(); this.splitContainer2.Panel1.SuspendLayout(); @@ -105,7 +106,6 @@ namespace Gitrdone this.m_tabControl.SuspendLayout(); this.tabPage1.SuspendLayout(); this.toolStrip3.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.m_repoCanvas)).BeginInit(); this.SuspendLayout(); // // splitContainer1 @@ -128,6 +128,15 @@ namespace Gitrdone this.splitContainer1.SplitterDistance = 103; this.splitContainer1.TabIndex = 1; // + // m_repoCanvas + // + this.m_repoCanvas.Dock = System.Windows.Forms.DockStyle.Fill; + this.m_repoCanvas.Location = new System.Drawing.Point(0, 49); + this.m_repoCanvas.Name = "m_repoCanvas"; + this.m_repoCanvas.Size = new System.Drawing.Size(1050, 54); + this.m_repoCanvas.TabIndex = 1; + this.m_repoCanvas.TabStop = false; + // // toolStrip1 // this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -159,6 +168,28 @@ namespace Gitrdone this.m_reposCombo.Name = "m_reposCombo"; this.m_reposCombo.Size = new System.Drawing.Size(121, 25); // + // toolStripButton1 + // + this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton1.Image = global::Gitrdone.Properties.Resources.accept; + this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton1.Name = "toolStripButton1"; + this.toolStripButton1.Size = new System.Drawing.Size(23, 22); + this.toolStripButton1.Text = "toolStripButton1"; + this.toolStripButton1.ToolTipText = "Select Repo"; + this.toolStripButton1.Click += new System.EventHandler(this.OnRepoChanged); + // + // toolStripButton2 + // + this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton2.Image = global::Gitrdone.Properties.Resources.book; + this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton2.Name = "toolStripButton2"; + this.toolStripButton2.Size = new System.Drawing.Size(23, 22); + this.toolStripButton2.Text = "toolStripButton2"; + this.toolStripButton2.ToolTipText = "Manage Repos..."; + this.toolStripButton2.Click += new System.EventHandler(this.OnManageRepos); + // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; @@ -171,6 +202,70 @@ namespace Gitrdone this.m_branchesCombo.Name = "m_branchesCombo"; this.m_branchesCombo.Size = new System.Drawing.Size(121, 25); // + // toolStripButton3 + // + this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton3.Image = global::Gitrdone.Properties.Resources.accept; + this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton3.Name = "toolStripButton3"; + this.toolStripButton3.Size = new System.Drawing.Size(23, 22); + this.toolStripButton3.Text = "toolStripButton3"; + this.toolStripButton3.ToolTipText = "Checkout Branch"; + this.toolStripButton3.Click += new System.EventHandler(this.OnBranchChanged); + // + // toolStripButton4 + // + this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton4.Image = global::Gitrdone.Properties.Resources.arrow_divide; + this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton4.Name = "toolStripButton4"; + this.toolStripButton4.Size = new System.Drawing.Size(23, 22); + this.toolStripButton4.Text = "toolStripButton4"; + this.toolStripButton4.ToolTipText = "Create New Branch..."; + this.toolStripButton4.Click += new System.EventHandler(this.OnCreateBranch); + // + // toolStripButton5 + // + this.toolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton5.Image = global::Gitrdone.Properties.Resources.arrow_join; + this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton5.Name = "toolStripButton5"; + this.toolStripButton5.Size = new System.Drawing.Size(23, 22); + this.toolStripButton5.Text = "toolStripButton5"; + this.toolStripButton5.ToolTipText = "Merge Branch..."; + this.toolStripButton5.Click += new System.EventHandler(this.OnMergeBranch); + // + // toolStripButton6 + // + this.toolStripButton6.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton6.Image = global::Gitrdone.Properties.Resources.delete; + this.toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton6.Name = "toolStripButton6"; + this.toolStripButton6.Size = new System.Drawing.Size(23, 22); + this.toolStripButton6.Text = "toolStripButton6"; + this.toolStripButton6.ToolTipText = "Delete Branch..."; + this.toolStripButton6.Click += new System.EventHandler(this.OnDeleteBranch); + // + // toolStripButton9 + // + this.toolStripButton9.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton9.Image = global::Gitrdone.Properties.Resources.arrow_redo; + this.toolStripButton9.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton9.Name = "toolStripButton9"; + this.toolStripButton9.Size = new System.Drawing.Size(23, 22); + this.toolStripButton9.Text = "toolStripButton9"; + this.toolStripButton9.ToolTipText = "Revert Entire Branch"; + this.toolStripButton9.Click += new System.EventHandler(this.OnResetHard); + // + // toolStripButton14 + // + this.toolStripButton14.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton14.Image = global::Gitrdone.Properties.Resources.tag_blue_add; + this.toolStripButton14.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton14.Name = "toolStripButton14"; + this.toolStripButton14.Size = new System.Drawing.Size(23, 22); + this.toolStripButton14.Text = "toolStripButton14"; + // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; @@ -181,6 +276,24 @@ namespace Gitrdone this.toolStripComboBox1.Name = "toolStripComboBox1"; this.toolStripComboBox1.Size = new System.Drawing.Size(121, 25); // + // toolStripButton15 + // + this.toolStripButton15.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton15.Image = global::Gitrdone.Properties.Resources.accept; + this.toolStripButton15.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton15.Name = "toolStripButton15"; + this.toolStripButton15.Size = new System.Drawing.Size(23, 22); + this.toolStripButton15.Text = "toolStripButton15"; + // + // toolStripButton16 + // + this.toolStripButton16.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton16.Image = global::Gitrdone.Properties.Resources.tag_blue_delete; + this.toolStripButton16.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton16.Name = "toolStripButton16"; + this.toolStripButton16.Size = new System.Drawing.Size(23, 22); + this.toolStripButton16.Text = "toolStripButton16"; + // // menuStrip1 // this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -322,245 +435,52 @@ namespace Gitrdone this.m_treeStrip.TabIndex = 2; this.m_treeStrip.Text = "toolStrip2"; // - // m_tabControl - // - this.m_tabControl.Controls.Add(this.tabPage1); - this.m_tabControl.Dock = System.Windows.Forms.DockStyle.Fill; - this.m_tabControl.Location = new System.Drawing.Point(0, 0); - this.m_tabControl.Name = "m_tabControl"; - this.m_tabControl.SelectedIndex = 0; - this.m_tabControl.Size = new System.Drawing.Size(696, 361); - this.m_tabControl.TabIndex = 0; - // - // tabPage1 + // m_addFileButton // - this.tabPage1.Controls.Add(this.m_commitsView); - this.tabPage1.Controls.Add(this.toolStrip3); - this.tabPage1.Location = new System.Drawing.Point(4, 22); - this.tabPage1.Name = "tabPage1"; - this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(688, 335); - this.tabPage1.TabIndex = 0; - this.tabPage1.Text = "tabPage1"; - this.tabPage1.UseVisualStyleBackColor = true; + this.m_addFileButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.m_addFileButton.Enabled = false; + this.m_addFileButton.Image = global::Gitrdone.Properties.Resources.add; + this.m_addFileButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.m_addFileButton.Name = "m_addFileButton"; + this.m_addFileButton.Size = new System.Drawing.Size(23, 22); + this.m_addFileButton.Text = "Add/Update Selected Files"; + this.m_addFileButton.Click += new System.EventHandler(this.OnAddFiles); // - // m_commitsView + // toolStripButton17 // - this.m_commitsView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeader1, - this.columnHeader2, - this.columnHeader3, - this.columnHeader4, - this.columnHeader5}); - this.m_commitsView.Dock = System.Windows.Forms.DockStyle.Fill; - this.m_commitsView.Location = new System.Drawing.Point(3, 28); - this.m_commitsView.Name = "m_commitsView"; - this.m_commitsView.Size = new System.Drawing.Size(682, 304); - this.m_commitsView.TabIndex = 0; - this.m_commitsView.UseCompatibleStateImageBehavior = false; - this.m_commitsView.View = System.Windows.Forms.View.Details; + this.toolStripButton17.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton17.Enabled = false; + this.toolStripButton17.Image = global::Gitrdone.Properties.Resources.page_copy; + this.toolStripButton17.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton17.Name = "toolStripButton17"; + this.toolStripButton17.Size = new System.Drawing.Size(23, 22); + this.toolStripButton17.Text = "Copy Files"; + this.toolStripButton17.Click += new System.EventHandler(this.OnCopyFiles); // - // m_outputArea + // m_typeSelector // - this.m_outputArea.Dock = System.Windows.Forms.DockStyle.Fill; - this.m_outputArea.FormattingEnabled = true; - this.m_outputArea.Location = new System.Drawing.Point(0, 0); - this.m_outputArea.Name = "m_outputArea"; - this.m_outputArea.Size = new System.Drawing.Size(1050, 95); - this.m_outputArea.TabIndex = 0; + this.m_typeSelector.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.m_typeSelector.Enabled = false; + this.m_typeSelector.Image = global::Gitrdone.Properties.Resources.page_go; + this.m_typeSelector.ImageTransparentColor = System.Drawing.Color.Magenta; + this.m_typeSelector.Name = "m_typeSelector"; + this.m_typeSelector.Size = new System.Drawing.Size(23, 22); + this.m_typeSelector.Text = "toolStripButton18"; + this.m_typeSelector.ToolTipText = "Rename/Move Files"; + this.m_typeSelector.Click += new System.EventHandler(this.OnMoveFiles); // - // toolStrip3 + // m_revertFiles // - this.toolStrip3.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.m_fetchCommits, - this.m_nextCommits, - this.m_previousCommits}); - this.toolStrip3.Location = new System.Drawing.Point(3, 3); - this.toolStrip3.Name = "toolStrip3"; - this.toolStrip3.Size = new System.Drawing.Size(682, 25); - this.toolStrip3.TabIndex = 1; - this.toolStrip3.Text = "toolStrip3"; + this.m_revertFiles.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.m_revertFiles.Enabled = false; + this.m_revertFiles.Image = global::Gitrdone.Properties.Resources.arrow_redo; + this.m_revertFiles.ImageTransparentColor = System.Drawing.Color.Magenta; + this.m_revertFiles.Name = "m_revertFiles"; + this.m_revertFiles.Size = new System.Drawing.Size(23, 22); + this.m_revertFiles.Text = "Revert Selected Files"; + this.m_revertFiles.Click += new System.EventHandler(this.OnRevertFiles); // - // columnHeader1 - // - this.columnHeader1.Text = "Commit ID"; - // - // columnHeader2 - // - this.columnHeader2.Text = "Author"; - // - // columnHeader3 - // - this.columnHeader3.Text = "Email"; - // - // columnHeader4 - // - this.columnHeader4.Text = "Date"; - // - // columnHeader5 - // - this.columnHeader5.Text = "Subject"; - this.columnHeader5.Width = 438; - // - // m_repoCanvas - // - this.m_repoCanvas.Dock = System.Windows.Forms.DockStyle.Fill; - this.m_repoCanvas.Location = new System.Drawing.Point(0, 49); - this.m_repoCanvas.Name = "m_repoCanvas"; - this.m_repoCanvas.Size = new System.Drawing.Size(1050, 54); - this.m_repoCanvas.TabIndex = 1; - this.m_repoCanvas.TabStop = false; - // - // toolStripButton1 - // - this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton1.Image = global::Gitrdone.Properties.Resources.accept; - this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton1.Name = "toolStripButton1"; - this.toolStripButton1.Size = new System.Drawing.Size(23, 22); - this.toolStripButton1.Text = "toolStripButton1"; - this.toolStripButton1.ToolTipText = "Select Repo"; - this.toolStripButton1.Click += new System.EventHandler(this.OnRepoChanged); - // - // toolStripButton2 - // - this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton2.Image = global::Gitrdone.Properties.Resources.book; - this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton2.Name = "toolStripButton2"; - this.toolStripButton2.Size = new System.Drawing.Size(23, 22); - this.toolStripButton2.Text = "toolStripButton2"; - this.toolStripButton2.ToolTipText = "Manage Repos..."; - this.toolStripButton2.Click += new System.EventHandler(this.OnManageRepos); - // - // toolStripButton3 - // - this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton3.Image = global::Gitrdone.Properties.Resources.accept; - this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton3.Name = "toolStripButton3"; - this.toolStripButton3.Size = new System.Drawing.Size(23, 22); - this.toolStripButton3.Text = "toolStripButton3"; - this.toolStripButton3.ToolTipText = "Checkout Branch"; - this.toolStripButton3.Click += new System.EventHandler(this.OnBranchChanged); - // - // toolStripButton4 - // - this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton4.Image = global::Gitrdone.Properties.Resources.arrow_divide; - this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton4.Name = "toolStripButton4"; - this.toolStripButton4.Size = new System.Drawing.Size(23, 22); - this.toolStripButton4.Text = "toolStripButton4"; - this.toolStripButton4.ToolTipText = "Create New Branch..."; - this.toolStripButton4.Click += new System.EventHandler(this.OnCreateBranch); - // - // toolStripButton5 - // - this.toolStripButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton5.Image = global::Gitrdone.Properties.Resources.arrow_join; - this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton5.Name = "toolStripButton5"; - this.toolStripButton5.Size = new System.Drawing.Size(23, 22); - this.toolStripButton5.Text = "toolStripButton5"; - this.toolStripButton5.ToolTipText = "Merge Branch..."; - this.toolStripButton5.Click += new System.EventHandler(this.OnMergeBranch); - // - // toolStripButton6 - // - this.toolStripButton6.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton6.Image = global::Gitrdone.Properties.Resources.delete; - this.toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton6.Name = "toolStripButton6"; - this.toolStripButton6.Size = new System.Drawing.Size(23, 22); - this.toolStripButton6.Text = "toolStripButton6"; - this.toolStripButton6.ToolTipText = "Delete Branch..."; - this.toolStripButton6.Click += new System.EventHandler(this.OnDeleteBranch); - // - // toolStripButton9 - // - this.toolStripButton9.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton9.Image = global::Gitrdone.Properties.Resources.arrow_redo; - this.toolStripButton9.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton9.Name = "toolStripButton9"; - this.toolStripButton9.Size = new System.Drawing.Size(23, 22); - this.toolStripButton9.Text = "toolStripButton9"; - this.toolStripButton9.ToolTipText = "Revert Entire Branch"; - this.toolStripButton9.Click += new System.EventHandler(this.OnResetHard); - // - // toolStripButton14 - // - this.toolStripButton14.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton14.Image = global::Gitrdone.Properties.Resources.tag_blue_add; - this.toolStripButton14.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton14.Name = "toolStripButton14"; - this.toolStripButton14.Size = new System.Drawing.Size(23, 22); - this.toolStripButton14.Text = "toolStripButton14"; - // - // toolStripButton15 - // - this.toolStripButton15.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton15.Image = global::Gitrdone.Properties.Resources.accept; - this.toolStripButton15.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton15.Name = "toolStripButton15"; - this.toolStripButton15.Size = new System.Drawing.Size(23, 22); - this.toolStripButton15.Text = "toolStripButton15"; - // - // toolStripButton16 - // - this.toolStripButton16.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton16.Image = global::Gitrdone.Properties.Resources.tag_blue_delete; - this.toolStripButton16.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton16.Name = "toolStripButton16"; - this.toolStripButton16.Size = new System.Drawing.Size(23, 22); - this.toolStripButton16.Text = "toolStripButton16"; - // - // m_addFileButton - // - this.m_addFileButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.m_addFileButton.Enabled = false; - this.m_addFileButton.Image = global::Gitrdone.Properties.Resources.add; - this.m_addFileButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.m_addFileButton.Name = "m_addFileButton"; - this.m_addFileButton.Size = new System.Drawing.Size(23, 22); - this.m_addFileButton.Text = "Add/Update Selected Files"; - this.m_addFileButton.Click += new System.EventHandler(this.OnAddFiles); - // - // toolStripButton17 - // - this.toolStripButton17.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton17.Enabled = false; - this.toolStripButton17.Image = global::Gitrdone.Properties.Resources.page_copy; - this.toolStripButton17.ImageTransparentColor = System.Drawing.Color.Magenta; - this.toolStripButton17.Name = "toolStripButton17"; - this.toolStripButton17.Size = new System.Drawing.Size(23, 22); - this.toolStripButton17.Text = "Copy Files"; - this.toolStripButton17.Click += new System.EventHandler(this.OnCopyFiles); - // - // m_typeSelector - // - this.m_typeSelector.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.m_typeSelector.Enabled = false; - this.m_typeSelector.Image = global::Gitrdone.Properties.Resources.page_go; - this.m_typeSelector.ImageTransparentColor = System.Drawing.Color.Magenta; - this.m_typeSelector.Name = "m_typeSelector"; - this.m_typeSelector.Size = new System.Drawing.Size(23, 22); - this.m_typeSelector.Text = "toolStripButton18"; - this.m_typeSelector.ToolTipText = "Rename/Move Files"; - this.m_typeSelector.Click += new System.EventHandler(this.OnMoveFiles); - // - // m_revertFiles - // - this.m_revertFiles.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.m_revertFiles.Enabled = false; - this.m_revertFiles.Image = global::Gitrdone.Properties.Resources.arrow_redo; - this.m_revertFiles.ImageTransparentColor = System.Drawing.Color.Magenta; - this.m_revertFiles.Name = "m_revertFiles"; - this.m_revertFiles.Size = new System.Drawing.Size(23, 22); - this.m_revertFiles.Text = "Revert Selected Files"; - this.m_revertFiles.Click += new System.EventHandler(this.OnRevertFiles); - // - // m_removeFiles + // m_removeFiles // this.m_removeFiles.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.m_removeFiles.Enabled = false; @@ -571,53 +491,6 @@ namespace Gitrdone this.m_removeFiles.Text = "Remove Selected Files"; this.m_removeFiles.Click += new System.EventHandler(this.OnDeleteFiles); // - // m_refreshButton - // - this.m_refreshButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.m_refreshButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.m_refreshButton.Image = global::Gitrdone.Properties.Resources.arrow_refresh; - this.m_refreshButton.ImageTransparentColor = System.Drawing.Color.Magenta; - this.m_refreshButton.Name = "m_refreshButton"; - this.m_refreshButton.Size = new System.Drawing.Size(23, 22); - this.m_refreshButton.Text = "toolStripButton12"; - this.m_refreshButton.Click += new System.EventHandler(this.OnRefreshTree); - // - // m_fetchCommits - // - this.m_fetchCommits.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.m_fetchCommits.Enabled = false; - this.m_fetchCommits.Image = global::Gitrdone.Properties.Resources.lightning; - this.m_fetchCommits.ImageTransparentColor = System.Drawing.Color.Magenta; - this.m_fetchCommits.Name = "m_fetchCommits"; - this.m_fetchCommits.Size = new System.Drawing.Size(23, 22); - this.m_fetchCommits.Text = "toolStripButton7"; - this.m_fetchCommits.ToolTipText = "Fetch"; - this.m_fetchCommits.Click += new System.EventHandler(this.OnFetchCommits); - // - // m_nextCommits - // - this.m_nextCommits.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.m_nextCommits.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.m_nextCommits.Enabled = false; - this.m_nextCommits.Image = global::Gitrdone.Properties.Resources.resultset_next; - this.m_nextCommits.ImageTransparentColor = System.Drawing.Color.Magenta; - this.m_nextCommits.Name = "m_nextCommits"; - this.m_nextCommits.Size = new System.Drawing.Size(23, 22); - this.m_nextCommits.Text = "Next"; - this.m_nextCommits.Click += new System.EventHandler(this.OnNextCommits); - // - // m_previousCommits - // - this.m_previousCommits.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.m_previousCommits.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.m_previousCommits.Enabled = false; - this.m_previousCommits.Image = global::Gitrdone.Properties.Resources.resultset_previous; - this.m_previousCommits.ImageTransparentColor = System.Drawing.Color.Magenta; - this.m_previousCommits.Name = "m_previousCommits"; - this.m_previousCommits.Size = new System.Drawing.Size(23, 22); - this.m_previousCommits.Text = "Previous"; - this.m_previousCommits.Click += new System.EventHandler(this.OnPreviousCommits); - // // toolStripDropDownButton1 // this.toolStripDropDownButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; @@ -737,6 +610,134 @@ namespace Gitrdone this.toolStripMenuItem9.Text = "Unknown"; this.toolStripMenuItem9.Click += new System.EventHandler(this.OnShowOther); // + // m_refreshButton + // + this.m_refreshButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.m_refreshButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.m_refreshButton.Image = global::Gitrdone.Properties.Resources.arrow_refresh; + this.m_refreshButton.ImageTransparentColor = System.Drawing.Color.Magenta; + this.m_refreshButton.Name = "m_refreshButton"; + this.m_refreshButton.Size = new System.Drawing.Size(23, 22); + this.m_refreshButton.Text = "toolStripButton12"; + this.m_refreshButton.Click += new System.EventHandler(this.OnRefreshTree); + // + // m_tabControl + // + this.m_tabControl.Controls.Add(this.tabPage1); + this.m_tabControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.m_tabControl.Location = new System.Drawing.Point(0, 0); + this.m_tabControl.Name = "m_tabControl"; + this.m_tabControl.SelectedIndex = 0; + this.m_tabControl.Size = new System.Drawing.Size(696, 361); + this.m_tabControl.TabIndex = 0; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.m_commitsView); + this.tabPage1.Controls.Add(this.toolStrip3); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(688, 335); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "tabPage1"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // m_commitsView + // + this.m_commitsView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1, + this.columnHeader2, + this.columnHeader3, + this.columnHeader4, + this.columnHeader5}); + this.m_commitsView.Dock = System.Windows.Forms.DockStyle.Fill; + this.m_commitsView.Location = new System.Drawing.Point(3, 28); + this.m_commitsView.Name = "m_commitsView"; + this.m_commitsView.Size = new System.Drawing.Size(682, 304); + this.m_commitsView.TabIndex = 0; + this.m_commitsView.UseCompatibleStateImageBehavior = false; + this.m_commitsView.View = System.Windows.Forms.View.Details; + this.m_commitsView.ItemActivate += new System.EventHandler(this.OnShowCommit); + // + // columnHeader1 + // + this.columnHeader1.Text = "Commit ID"; + // + // columnHeader2 + // + this.columnHeader2.Text = "Author"; + // + // columnHeader3 + // + this.columnHeader3.Text = "Email"; + // + // columnHeader4 + // + this.columnHeader4.Text = "Date"; + // + // columnHeader5 + // + this.columnHeader5.Text = "Subject"; + this.columnHeader5.Width = 438; + // + // toolStrip3 + // + this.toolStrip3.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.m_fetchCommits, + this.m_nextCommits, + this.m_previousCommits}); + this.toolStrip3.Location = new System.Drawing.Point(3, 3); + this.toolStrip3.Name = "toolStrip3"; + this.toolStrip3.Size = new System.Drawing.Size(682, 25); + this.toolStrip3.TabIndex = 1; + this.toolStrip3.Text = "toolStrip3"; + // + // m_fetchCommits + // + this.m_fetchCommits.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.m_fetchCommits.Enabled = false; + this.m_fetchCommits.Image = global::Gitrdone.Properties.Resources.lightning; + this.m_fetchCommits.ImageTransparentColor = System.Drawing.Color.Magenta; + this.m_fetchCommits.Name = "m_fetchCommits"; + this.m_fetchCommits.Size = new System.Drawing.Size(23, 22); + this.m_fetchCommits.Text = "toolStripButton7"; + this.m_fetchCommits.ToolTipText = "Fetch"; + this.m_fetchCommits.Click += new System.EventHandler(this.OnFetchCommits); + // + // m_nextCommits + // + this.m_nextCommits.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.m_nextCommits.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.m_nextCommits.Enabled = false; + this.m_nextCommits.Image = global::Gitrdone.Properties.Resources.resultset_next; + this.m_nextCommits.ImageTransparentColor = System.Drawing.Color.Magenta; + this.m_nextCommits.Name = "m_nextCommits"; + this.m_nextCommits.Size = new System.Drawing.Size(23, 22); + this.m_nextCommits.Text = "Next"; + this.m_nextCommits.Click += new System.EventHandler(this.OnNextCommits); + // + // m_previousCommits + // + this.m_previousCommits.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.m_previousCommits.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.m_previousCommits.Enabled = false; + this.m_previousCommits.Image = global::Gitrdone.Properties.Resources.resultset_previous; + this.m_previousCommits.ImageTransparentColor = System.Drawing.Color.Magenta; + this.m_previousCommits.Name = "m_previousCommits"; + this.m_previousCommits.Size = new System.Drawing.Size(23, 22); + this.m_previousCommits.Text = "Previous"; + this.m_previousCommits.Click += new System.EventHandler(this.OnPreviousCommits); + // + // m_outputArea + // + this.m_outputArea.Dock = System.Windows.Forms.DockStyle.Fill; + this.m_outputArea.FormattingEnabled = true; + this.m_outputArea.Location = new System.Drawing.Point(0, 0); + this.m_outputArea.Name = "m_outputArea"; + this.m_outputArea.Size = new System.Drawing.Size(1050, 95); + this.m_outputArea.TabIndex = 0; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -750,6 +751,7 @@ namespace Gitrdone this.splitContainer1.Panel1.PerformLayout(); this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.m_repoCanvas)).EndInit(); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.menuStrip1.ResumeLayout(false); @@ -768,7 +770,6 @@ namespace Gitrdone this.tabPage1.PerformLayout(); this.toolStrip3.ResumeLayout(false); this.toolStrip3.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.m_repoCanvas)).EndInit(); this.ResumeLayout(false); } diff --git a/Form1.cs b/Form1.cs index 9dd921a..ef985d6 100755 --- a/Form1.cs +++ b/Form1.cs @@ -637,5 +637,15 @@ namespace Gitrdone FillCommitList(commits); } } + + private void OnShowCommit(object sender, EventArgs e) + { + ListView.SelectedListViewItemCollection items = m_commitsView.SelectedItems; + if (items.Count == 1) + { + CommitViewer c = new CommitViewer((Commit)items[0].Tag); + c.Show(); + } + } } } diff --git a/Git/Commit.cs b/Git/Commit.cs dissimilarity index 60% index dd5304f..8362dc3 100755 --- a/Git/Commit.cs +++ b/Git/Commit.cs @@ -1,46 +1,172 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Git -{ - public class Commit : Treeish - { - protected List m_Parents = new List(); - public List Parents { get { return new List(m_Parents); } internal set { m_Parents = value; } } - - public override string Name { get { return "Commit"; } internal set { } } - - protected string m_hash; - public override string ID { get { return m_hash; } internal set { m_hash = value; } } - - protected string m_author; - public string AuthorName { get { return m_author; } internal set { m_author = value; } } - - protected string m_authorEmail; - public string AuthorEmail { get { return m_authorEmail; } internal set { m_authorEmail = value; } } - - protected string m_date; - public string Date { get { return m_date; } internal set { m_date = value; } } - - protected string m_subject; - public string Subject { get { return m_subject; } internal set { m_subject = value; } } - - protected string m_body; - public string Body { get { return m_body; } internal set { m_body = value; } } - - public Commit(string path) : base(path) - { - } - - public string Show(string path) - { - throw new NotImplementedException(); - } - - public List Diff(Commit other) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file +using System; +using System.Collections.Generic; +using System.Text; + +namespace Git +{ + public class Commit : Treeish + { + protected List m_Parents; + public List Parents + { + get + { + if (null == m_Parents && !Populate()) + { + return null; + } + return new List(m_Parents); + } + internal set { m_Parents = value; } + } + + public override string Name { get { return "Commit"; } internal set { } } + + protected string m_hash; + public override string ID { get { return m_hash; } internal set { m_hash = value; } } + + protected string m_author; + public string AuthorName + { + get + { + if (null == m_author && !Populate()) + { + return null; + } + return m_author; + } + internal set { m_author = value; } + } + + protected string m_authorEmail; + public string AuthorEmail + { + get + { + if (null == m_authorEmail && !Populate()) + { + return null; + } + return m_authorEmail; + } + internal set { m_authorEmail = value; } + } + + protected string m_date; + public string Date + { + get + { + if (null == m_date && !Populate()) + { + return null; + } + return m_date; + } + internal set { m_date = value; } + } + + protected string m_subject; + public string Subject + { + get + { + if (null == m_subject && !Populate()) + { + return null; + } + return m_subject; + } + internal set { m_subject = value; } + } + + protected string m_body; + public string Body + { + get + { + if (null == m_body && !GetBody()) + { + return null; + } + return m_body; + } + internal set { m_body = value; } + } + + internal static string FormatString { get { return " --pretty=format:\"%H %P\t%an\t%ae\t%ad\t%s\" "; } } + + internal string FullFormatString { get { return " --pretty=format:\"%H %P\t%an\t%ae\t%ad\t%s\" "; } } //use this to get body too + + public Commit(string path, string id) : base(path) + { + m_hash = id; + } + + protected Commit(string path) : base(path) + { + } + + public static Commit GetCommit(string path, string record) + { + Commit c = new Commit(path); + c.Populate(record); + return c; + } + + protected bool GetBody() + { + Executioner e = Executioner.GetExecutioner(m_path); + string output, error; + if (0 == e.Execute("git-show", "--name-only --pretty=format:%b " + ID, "", out output, out error)) + { + m_body = output.Trim(); + return true; + } + return false; + } + + protected bool Populate() + { + Executioner e = Executioner.GetExecutioner(m_path); + string output, error; + if (0 == e.Execute("git-show", FormatString + ID, "", out output, out error)) + { + return Populate(output.Trim()); + } + return false; + } + + internal bool Populate(string record) + { + try + { + int idx1 = record.IndexOf(" "); + string id = record.Substring(0, idx1); + int idx2 = record.IndexOf("\t", idx1 + 1); + string[] parents = record.Substring(idx1 + 1, (idx2 - idx1) - 1).Split(" ".ToCharArray()); + idx1 = record.IndexOf("\t", idx2 + 1); + string authorName = record.Substring(idx2 + 1, (idx1 - idx2) - 1); + idx2 = record.IndexOf("\t", idx1 + 1); + string authorEmail = record.Substring(idx1 + 1, (idx2 - idx1) - 1); + idx1 = record.IndexOf("\t", idx2 + 1); + string date = record.Substring(idx2 + 1, (idx1 - idx2) - 1); + + string subject = record.Substring(idx1 + 1); + ID = id; + Parents = new List(parents); + AuthorName = authorName; + AuthorEmail = authorEmail; + Date = date; + Subject = subject; + } + catch (IndexOutOfRangeException ex) + { + System.Console.WriteLine(ex.Message + " " + ex.StackTrace); + return false; + } + return true; + } + } +} \ No newline at end of file diff --git a/Git/Repo.cs b/Git/Repo.cs index 00a4fac..5412556 100755 --- a/Git/Repo.cs +++ b/Git/Repo.cs @@ -349,7 +349,7 @@ namespace Git public bool GetLog(Commit start, int count, out List commits) { Executioner e = Executioner.GetExecutioner(m_path, true); - string args = "-n " + count + " --pretty=format:\"%H %P\t%an\t%ae\t%ad\t%s\" "; + string args = "-n " + count + Git.Commit.FormatString; if (null != start) { args += start.ID; @@ -361,25 +361,7 @@ namespace Git commits = new List(); foreach (string record in records) { - int idx1 = record.IndexOf(" "); - string id = record.Substring(0, idx1); - int idx2 = record.IndexOf("\t", idx1 + 1); - string[] parents = record.Substring(idx1 + 1, (idx2 - idx1) - 1).Split(" ".ToCharArray()); - idx1 = record.IndexOf("\t", idx2 + 1); - string authorName = record.Substring(idx2 + 1, (idx1 - idx2) - 1); - idx2 = record.IndexOf("\t", idx1 + 1); - string authorEmail = record.Substring(idx1 + 1, (idx2 - idx1) - 1); - idx1 = record.IndexOf("\t", idx2 + 1); - string date = record.Substring(idx2 + 1, (idx1 - idx2) - 1); - - string subject = record.Substring(idx1 + 1); - Commit c = new Commit(m_path); - c.ID = id; - c.Parents = new List(parents); - c.AuthorName = authorName; - c.AuthorEmail = authorEmail; - c.Date = date; - c.Subject = subject; + Commit c = Git.Commit.GetCommit(m_path, record); commits.Add(c); } return true; diff --git a/Git/Treeish.cs b/Git/Treeish.cs index dcb6e0b..e02e3da 100644 --- a/Git/Treeish.cs +++ b/Git/Treeish.cs @@ -8,7 +8,8 @@ namespace Git public abstract string ID { get; internal set; } public abstract string Name { get; internal set; } - protected string m_path; + protected string m_path; + public string Path { get { return m_path; } } public Treeish(string path) { diff --git a/Gitrdone.csproj b/Gitrdone.csproj index 3b68a43..84c9fa3 100644 --- a/Gitrdone.csproj +++ b/Gitrdone.csproj @@ -45,6 +45,12 @@ + + Form + + + CommitViewer.cs + Form @@ -70,6 +76,10 @@ + + Designer + CommitViewer.cs + Designer Form1.cs -- 2.11.4.GIT