<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>GitUI/Abort.cs</filename>
    </added>
    <added>
      <filename>GitUI/FileHelper.cs</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -391,6 +391,64 @@ namespace GitCommands
             return unmergedFiles;
         }
 
+        static public bool HandleConflice_SelectBase(string fileName)
+        {
+            if (HandeConflicts_SaveSide(fileName, fileName, &quot;1&quot;))
+            {
+                GitCommands.RunCmd(Settings.GitDir + &quot;git.cmd&quot;, &quot;add -- \&quot;&quot; + fileName + &quot;\&quot;&quot;);
+                return true;
+            }
+            return false;
+        }
+
+        static public bool HandleConflice_SelectLocal(string fileName)
+        {
+            if (HandeConflicts_SaveSide(fileName, fileName, &quot;2&quot;))
+            {
+                GitCommands.RunCmd(Settings.GitDir + &quot;git.cmd&quot;, &quot;add -- \&quot;&quot; + fileName + &quot;\&quot;&quot;);
+                return true;
+            }
+            return false;
+        }
+
+        static public bool HandleConflice_SelectRemote(string fileName)
+        {
+            if (HandeConflicts_SaveSide(fileName, fileName, &quot;3&quot;))
+            {
+                GitCommands.RunCmd(Settings.GitDir + &quot;git.cmd&quot;, &quot;add -- \&quot;&quot; + fileName + &quot;\&quot;&quot;);
+                return true;
+            }
+            return false;
+        }
+        
+        public static bool HandeConflicts_SaveSide(string fileName, string saveAs, string side)
+        {
+            if (side.Equals(&quot;REMOTE&quot;, StringComparison.CurrentCultureIgnoreCase))
+                side = &quot;3&quot;;
+            if (side.Equals(&quot;LOCAL&quot;, StringComparison.CurrentCultureIgnoreCase))
+                side = &quot;2&quot;;
+            if (side.Equals(&quot;BASE&quot;, StringComparison.CurrentCultureIgnoreCase))
+                side = &quot;1&quot;;
+
+            fileName = FixPath(fileName);
+            string[] unmerged = RunCmd(Settings.GitDir + &quot;git.cmd&quot;, &quot;ls-files --unmerged \&quot;&quot; + fileName + &quot;\&quot;&quot;).Split('\n');
+
+            foreach (string file in unmerged)
+            {
+                string[] fileline = file.Split(new char[] { ' ', '\t' });
+                if (fileline.Length &lt; 3)
+                    continue;
+                if (fileline[2].Trim() == side)
+                {
+                    RunCmd(Settings.GitDir + &quot;git.cmd&quot;, &quot;cat-file blob \&quot;&quot; + fileline[1] + &quot;\&quot; &gt; \&quot;&quot; + saveAs + &quot;\&quot;&quot;);
+                    
+                    return true;
+                }
+            }
+
+            return false;
+        }
+
         static public string GetConflictedFiles(string filename)
         {
             filename = FixPath(filename);</diff>
      <filename>GitCommands/GitCommands/Git/GitCommands.cs</filename>
    </modified>
    <modified>
      <diff>@@ -448,6 +448,8 @@ namespace GitUI
                     string fileName = ((GitItem)item).FileName;
                     if (fileName.Contains(&quot;\\&quot;) &amp;&amp; fileName.LastIndexOf(&quot;\\&quot;) &lt; fileName.Length)
                         fileName = fileName.Substring(fileName.LastIndexOf('\\') + 1);
+                    if (fileName.Contains(&quot;/&quot;) &amp;&amp; fileName.LastIndexOf(&quot;/&quot;) &lt; fileName.Length)
+                        fileName = fileName.Substring(fileName.LastIndexOf('/') + 1);
 
                     fileName = Path.GetTempPath() + fileName;
                     GitCommands.GitCommands.RunCmd(Settings.GitDir + &quot;git.cmd&quot;, &quot;cat-file blob \&quot;&quot; + ((GitItem)item).Guid + &quot;\&quot; &gt; \&quot;&quot; + fileName + &quot;\&quot;&quot;);
@@ -465,6 +467,8 @@ namespace GitUI
                     string fileName = ((GitItem)item).FileName;
                     if (fileName.Contains(&quot;\\&quot;) &amp;&amp; fileName.LastIndexOf(&quot;\\&quot;) &lt; fileName.Length)
                         fileName = fileName.Substring(fileName.LastIndexOf('\\') + 1);
+                    if (fileName.Contains(&quot;/&quot;) &amp;&amp; fileName.LastIndexOf(&quot;/&quot;) &lt; fileName.Length)
+                        fileName = fileName.Substring(fileName.LastIndexOf('/') + 1);
 
                     fileName = Path.GetTempPath() + fileName;
                     GitCommands.GitCommands.RunCmd(Settings.GitDir + &quot;git.cmd&quot;, &quot;cat-file blob \&quot;&quot; + ((GitItem)item).Guid + &quot;\&quot; &gt; \&quot;&quot; + fileName + &quot;\&quot;&quot;);</diff>
      <filename>GitUI/Browse.cs</filename>
    </modified>
    <modified>
      <diff>@@ -566,7 +566,7 @@
             this.Reset.Name = &quot;Reset&quot;;
             this.Reset.Size = new System.Drawing.Size(128, 23);
             this.Reset.TabIndex = 5;
-            this.Reset.Text = &quot;Reset changed HARD&quot;;
+            this.Reset.Text = &quot;Reset changed&quot;;
             this.Reset.UseVisualStyleBackColor = true;
             this.Reset.Click += new System.EventHandler(this.Reset_Click);
             // </diff>
      <filename>GitUI/Commit.Designer.cs</filename>
    </modified>
    <modified>
      <diff>@@ -278,14 +278,12 @@ namespace GitUI
 
         private void Reset_Click(object sender, EventArgs e)
         {
-            if (MessageBox.Show(&quot;Are you sure you want to reset all changes in the working dir?&quot; + Environment.NewLine + &quot;All changes made to all files in the workin dir will be overwritten by the files from the current HEAD!&quot;, &quot;WARNING!&quot;, MessageBoxButtons.YesNo) == DialogResult.Yes)
+            if (Abort.AbortCurrentAction())
             {
-                if (MessageBox.Show(&quot;Are you really sure you want to DELETE all changes?&quot;, &quot;WARNING! WARNING!&quot;, MessageBoxButtons.YesNo) == DialogResult.Yes)
-                {
-                    OutPut.Text = GitCommands.GitCommands.ResetHard(&quot;&quot;);
-                    Initialize();
-                }
+                Initialize();
+                NeedRefresh = true;
             }
+
         }
 
         private void UnstageFiles_Click(object sender, EventArgs e)</diff>
      <filename>GitUI/Commit.cs</filename>
    </modified>
    <modified>
      <diff>@@ -255,22 +255,7 @@ namespace GitUI
 
         public bool IsBinaryFile(string fileName)
         {
-            return (fileName.EndsWith(&quot;.png&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.jpg&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.bmp&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.jpeg&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.ico&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.tif&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.tiff&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.exe&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.gif&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.mpg&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.mpeg&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.dll&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.pdf&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.doc&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.vsd&quot;, StringComparison.CurrentCultureIgnoreCase) ||
-                    fileName.EndsWith(&quot;.avi&quot;, StringComparison.CurrentCultureIgnoreCase));
+            return FileHelper.IsBinaryFile(fileName);
         }
 
         public void ViewGitItemRevision(string fileName, string guid)</diff>
      <filename>GitUI/FileViewer.cs</filename>
    </modified>
    <modified>
      <diff>@@ -31,16 +31,35 @@
             this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormResolveConflicts));
             this.ConflictedFiles = new System.Windows.Forms.DataGridView();
+            this.ConflictedFilesContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
+            this.OpenMergetool = new System.Windows.Forms.ToolStripMenuItem();
+            this.ContextMarkAsSolved = new System.Windows.Forms.ToolStripMenuItem();
+            this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
+            this.ContextChooseBase = new System.Windows.Forms.ToolStripMenuItem();
+            this.ContextChooseLocal = new System.Windows.Forms.ToolStripMenuItem();
+            this.ContextChooseRemote = new System.Windows.Forms.ToolStripMenuItem();
+            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+            this.ContextOpenBaseWith = new System.Windows.Forms.ToolStripMenuItem();
+            this.ContextOpenLocalWith = new System.Windows.Forms.ToolStripMenuItem();
+            this.ContextOpenRemoteWith = new System.Windows.Forms.ToolStripMenuItem();
+            this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+            this.ContextSaveBaseAs = new System.Windows.Forms.ToolStripMenuItem();
+            this.ContextSaveLocalAs = new System.Windows.Forms.ToolStripMenuItem();
+            this.ContextSaveRemoteAs = new System.Windows.Forms.ToolStripMenuItem();
             this.gitItemBindingSource = new System.Windows.Forms.BindingSource(this.components);
             this.splitContainer1 = new System.Windows.Forms.SplitContainer();
             this.splitContainer2 = new System.Windows.Forms.SplitContainer();
             this.label1 = new System.Windows.Forms.Label();
+            this.splitContainer3 = new System.Windows.Forms.SplitContainer();
             this.button1 = new System.Windows.Forms.Button();
-            this.Rescan = new System.Windows.Forms.Button();
             this.Mergetool = new System.Windows.Forms.Button();
+            this.Rescan = new System.Windows.Forms.Button();
+            this.Reset = new System.Windows.Forms.Button();
             this.colorDialog1 = new System.Windows.Forms.ColorDialog();
             this.Namex = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.SolveConflictButton = new System.Windows.Forms.DataGridViewButtonColumn();
             ((System.ComponentModel.ISupportInitialize)(this.ConflictedFiles)).BeginInit();
+            this.ConflictedFilesContextMenu.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.gitItemBindingSource)).BeginInit();
             this.splitContainer1.Panel1.SuspendLayout();
             this.splitContainer1.Panel2.SuspendLayout();
@@ -48,6 +67,9 @@
             this.splitContainer2.Panel1.SuspendLayout();
             this.splitContainer2.Panel2.SuspendLayout();
             this.splitContainer2.SuspendLayout();
+            this.splitContainer3.Panel1.SuspendLayout();
+            this.splitContainer3.Panel2.SuspendLayout();
+            this.splitContainer3.SuspendLayout();
             this.SuspendLayout();
             // 
             // ConflictedFiles
@@ -58,7 +80,9 @@
             this.ConflictedFiles.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
             this.ConflictedFiles.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.ConflictedFiles.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.Namex});
+            this.Namex,
+            this.SolveConflictButton});
+            this.ConflictedFiles.ContextMenuStrip = this.ConflictedFilesContextMenu;
             this.ConflictedFiles.DataSource = this.gitItemBindingSource;
             this.ConflictedFiles.Dock = System.Windows.Forms.DockStyle.Fill;
             this.ConflictedFiles.Location = new System.Drawing.Point(0, 0);
@@ -67,9 +91,123 @@
             this.ConflictedFiles.ReadOnly = true;
             this.ConflictedFiles.RowHeadersVisible = false;
             this.ConflictedFiles.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
-            this.ConflictedFiles.Size = new System.Drawing.Size(441, 226);
+            this.ConflictedFiles.Size = new System.Drawing.Size(596, 245);
             this.ConflictedFiles.TabIndex = 0;
             this.ConflictedFiles.DoubleClick += new System.EventHandler(this.ConflictedFiles_DoubleClick);
+            this.ConflictedFiles.CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.ConflictedFiles_CellMouseDown);
+            this.ConflictedFiles.SelectionChanged += new System.EventHandler(this.ConflictedFiles_SelectionChanged);
+            // 
+            // ConflictedFilesContextMenu
+            // 
+            this.ConflictedFilesContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+            this.OpenMergetool,
+            this.ContextMarkAsSolved,
+            this.toolStripSeparator3,
+            this.ContextChooseBase,
+            this.ContextChooseLocal,
+            this.ContextChooseRemote,
+            this.toolStripSeparator1,
+            this.ContextOpenBaseWith,
+            this.ContextOpenLocalWith,
+            this.ContextOpenRemoteWith,
+            this.toolStripSeparator2,
+            this.ContextSaveBaseAs,
+            this.ContextSaveLocalAs,
+            this.ContextSaveRemoteAs});
+            this.ConflictedFilesContextMenu.Name = &quot;ConflictedFilesContextMenu&quot;;
+            this.ConflictedFilesContextMenu.Size = new System.Drawing.Size(196, 264);
+            // 
+            // OpenMergetool
+            // 
+            this.OpenMergetool.Name = &quot;OpenMergetool&quot;;
+            this.OpenMergetool.Size = new System.Drawing.Size(195, 22);
+            this.OpenMergetool.Text = &quot;Open in mergetool&quot;;
+            this.OpenMergetool.Click += new System.EventHandler(this.OpenMergetool_Click);
+            // 
+            // ContextMarkAsSolved
+            // 
+            this.ContextMarkAsSolved.Name = &quot;ContextMarkAsSolved&quot;;
+            this.ContextMarkAsSolved.Size = new System.Drawing.Size(195, 22);
+            this.ContextMarkAsSolved.Text = &quot;Mark conlfict as solved&quot;;
+            this.ContextMarkAsSolved.Click += new System.EventHandler(this.ContextMarkAsSolved_Click);
+            // 
+            // toolStripSeparator3
+            // 
+            this.toolStripSeparator3.Name = &quot;toolStripSeparator3&quot;;
+            this.toolStripSeparator3.Size = new System.Drawing.Size(192, 6);
+            // 
+            // ContextChooseBase
+            // 
+            this.ContextChooseBase.Name = &quot;ContextChooseBase&quot;;
+            this.ContextChooseBase.Size = new System.Drawing.Size(195, 22);
+            this.ContextChooseBase.Text = &quot;Choose base&quot;;
+            this.ContextChooseBase.Click += new System.EventHandler(this.ContextChooseBase_Click);
+            // 
+            // ContextChooseLocal
+            // 
+            this.ContextChooseLocal.Name = &quot;ContextChooseLocal&quot;;
+            this.ContextChooseLocal.Size = new System.Drawing.Size(195, 22);
+            this.ContextChooseLocal.Text = &quot;Choose local&quot;;
+            this.ContextChooseLocal.Click += new System.EventHandler(this.ContextChooseLocal_Click);
+            // 
+            // ContextChooseRemote
+            // 
+            this.ContextChooseRemote.Name = &quot;ContextChooseRemote&quot;;
+            this.ContextChooseRemote.Size = new System.Drawing.Size(195, 22);
+            this.ContextChooseRemote.Text = &quot;Choose remote&quot;;
+            this.ContextChooseRemote.Click += new System.EventHandler(this.ContextChooseRemote_Click);
+            // 
+            // toolStripSeparator1
+            // 
+            this.toolStripSeparator1.Name = &quot;toolStripSeparator1&quot;;
+            this.toolStripSeparator1.Size = new System.Drawing.Size(192, 6);
+            // 
+            // ContextOpenBaseWith
+            // 
+            this.ContextOpenBaseWith.Name = &quot;ContextOpenBaseWith&quot;;
+            this.ContextOpenBaseWith.Size = new System.Drawing.Size(195, 22);
+            this.ContextOpenBaseWith.Text = &quot;Open base with&quot;;
+            this.ContextOpenBaseWith.Click += new System.EventHandler(this.ContextOpenBaseWith_Click);
+            // 
+            // ContextOpenLocalWith
+            // 
+            this.ContextOpenLocalWith.Name = &quot;ContextOpenLocalWith&quot;;
+            this.ContextOpenLocalWith.Size = new System.Drawing.Size(195, 22);
+            this.ContextOpenLocalWith.Text = &quot;Open local with&quot;;
+            this.ContextOpenLocalWith.Click += new System.EventHandler(this.ContextOpenLocalWith_Click);
+            // 
+            // ContextOpenRemoteWith
+            // 
+            this.ContextOpenRemoteWith.Name = &quot;ContextOpenRemoteWith&quot;;
+            this.ContextOpenRemoteWith.Size = new System.Drawing.Size(195, 22);
+            this.ContextOpenRemoteWith.Text = &quot;Open remote with&quot;;
+            this.ContextOpenRemoteWith.Click += new System.EventHandler(this.ContextOpenRemoteWith_Click);
+            // 
+            // toolStripSeparator2
+            // 
+            this.toolStripSeparator2.Name = &quot;toolStripSeparator2&quot;;
+            this.toolStripSeparator2.Size = new System.Drawing.Size(192, 6);
+            // 
+            // ContextSaveBaseAs
+            // 
+            this.ContextSaveBaseAs.Name = &quot;ContextSaveBaseAs&quot;;
+            this.ContextSaveBaseAs.Size = new System.Drawing.Size(195, 22);
+            this.ContextSaveBaseAs.Text = &quot;Save base as&quot;;
+            this.ContextSaveBaseAs.Click += new System.EventHandler(this.ContextSaveBaseAs_Click);
+            // 
+            // ContextSaveLocalAs
+            // 
+            this.ContextSaveLocalAs.Name = &quot;ContextSaveLocalAs&quot;;
+            this.ContextSaveLocalAs.Size = new System.Drawing.Size(195, 22);
+            this.ContextSaveLocalAs.Text = &quot;Save local as&quot;;
+            this.ContextSaveLocalAs.Click += new System.EventHandler(this.ContextSaveLocalAs_Click);
+            // 
+            // ContextSaveRemoteAs
+            // 
+            this.ContextSaveRemoteAs.Name = &quot;ContextSaveRemoteAs&quot;;
+            this.ContextSaveRemoteAs.Size = new System.Drawing.Size(195, 22);
+            this.ContextSaveRemoteAs.Text = &quot;Save remote as&quot;;
+            this.ContextSaveRemoteAs.Click += new System.EventHandler(this.ContextSaveRemoteAs_Click);
             // 
             // gitItemBindingSource
             // 
@@ -88,11 +226,9 @@
             // 
             // splitContainer1.Panel2
             // 
-            this.splitContainer1.Panel2.Controls.Add(this.button1);
-            this.splitContainer1.Panel2.Controls.Add(this.Rescan);
-            this.splitContainer1.Panel2.Controls.Add(this.Mergetool);
-            this.splitContainer1.Size = new System.Drawing.Size(576, 255);
-            this.splitContainer1.SplitterDistance = 441;
+            this.splitContainer1.Panel2.Controls.Add(this.splitContainer3);
+            this.splitContainer1.Size = new System.Drawing.Size(732, 274);
+            this.splitContainer1.SplitterDistance = 596;
             this.splitContainer1.TabIndex = 1;
             // 
             // splitContainer2
@@ -110,7 +246,7 @@
             // splitContainer2.Panel2
             // 
             this.splitContainer2.Panel2.Controls.Add(this.ConflictedFiles);
-            this.splitContainer2.Size = new System.Drawing.Size(441, 255);
+            this.splitContainer2.Size = new System.Drawing.Size(596, 274);
             this.splitContainer2.SplitterDistance = 25;
             this.splitContainer2.TabIndex = 0;
             // 
@@ -119,23 +255,54 @@
             this.label1.AutoSize = true;
             this.label1.Location = new System.Drawing.Point(4, 4);
             this.label1.Name = &quot;label1&quot;;
-            this.label1.Size = new System.Drawing.Size(273, 13);
+            this.label1.Size = new System.Drawing.Size(135, 13);
             this.label1.TabIndex = 0;
-            this.label1.Text = &quot;Unresolved merge conflicts (doubleclick on row to solve)&quot;;
+            this.label1.Text = &quot;Unresolved merge conflicts&quot;;
+            // 
+            // splitContainer3
+            // 
+            this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
+            this.splitContainer3.Location = new System.Drawing.Point(0, 0);
+            this.splitContainer3.Name = &quot;splitContainer3&quot;;
+            this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
+            // 
+            // splitContainer3.Panel1
+            // 
+            this.splitContainer3.Panel1.Controls.Add(this.button1);
+            this.splitContainer3.Panel1.Controls.Add(this.Mergetool);
+            // 
+            // splitContainer3.Panel2
+            // 
+            this.splitContainer3.Panel2.Controls.Add(this.Rescan);
+            this.splitContainer3.Panel2.Controls.Add(this.Reset);
+            this.splitContainer3.Size = new System.Drawing.Size(132, 274);
+            this.splitContainer3.SplitterDistance = 207;
+            this.splitContainer3.TabIndex = 7;
             // 
             // button1
             // 
-            this.button1.Location = new System.Drawing.Point(3, 4);
+            this.button1.Location = new System.Drawing.Point(3, 3);
             this.button1.Name = &quot;button1&quot;;
-            this.button1.Size = new System.Drawing.Size(124, 23);
+            this.button1.Size = new System.Drawing.Size(125, 23);
             this.button1.TabIndex = 2;
-            this.button1.Text = &quot;Solve selected conflict&quot;;
+            this.button1.Text = &quot;Open in mergetool&quot;;
             this.button1.UseVisualStyleBackColor = true;
             this.button1.Click += new System.EventHandler(this.button1_Click);
             // 
+            // Mergetool
+            // 
+            this.Mergetool.Location = new System.Drawing.Point(3, 32);
+            this.Mergetool.Name = &quot;Mergetool&quot;;
+            this.Mergetool.Size = new System.Drawing.Size(125, 23);
+            this.Mergetool.TabIndex = 0;
+            this.Mergetool.Text = &quot;Run mergetool&quot;;
+            this.Mergetool.UseVisualStyleBackColor = true;
+            this.Mergetool.Click += new System.EventHandler(this.Mergetool_Click);
+            // 
             // Rescan
             // 
-            this.Rescan.Location = new System.Drawing.Point(3, 75);
+            this.Rescan.Location = new System.Drawing.Point(3, 3);
             this.Rescan.Name = &quot;Rescan&quot;;
             this.Rescan.Size = new System.Drawing.Size(125, 23);
             this.Rescan.TabIndex = 1;
@@ -143,29 +310,40 @@
             this.Rescan.UseVisualStyleBackColor = true;
             this.Rescan.Click += new System.EventHandler(this.Rescan_Click);
             // 
-            // Mergetool
+            // Reset
             // 
-            this.Mergetool.Location = new System.Drawing.Point(3, 29);
-            this.Mergetool.Name = &quot;Mergetool&quot;;
-            this.Mergetool.Size = new System.Drawing.Size(125, 23);
-            this.Mergetool.TabIndex = 0;
-            this.Mergetool.Text = &quot;Run mergetool&quot;;
-            this.Mergetool.UseVisualStyleBackColor = true;
-            this.Mergetool.Click += new System.EventHandler(this.Mergetool_Click);
+            this.Reset.Location = new System.Drawing.Point(3, 32);
+            this.Reset.Name = &quot;Reset&quot;;
+            this.Reset.Size = new System.Drawing.Size(125, 23);
+            this.Reset.TabIndex = 6;
+            this.Reset.Text = &quot;Abort&quot;;
+            this.Reset.UseVisualStyleBackColor = true;
+            this.Reset.Click += new System.EventHandler(this.Reset_Click);
             // 
             // Namex
             // 
+            this.Namex.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
             this.Namex.DataPropertyName = &quot;FileName&quot;;
             this.Namex.HeaderText = &quot;Filename&quot;;
             this.Namex.Name = &quot;Namex&quot;;
             this.Namex.ReadOnly = true;
             // 
+            // SolveConflictButton
+            // 
+            this.SolveConflictButton.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.SolveConflictButton.HeaderText = &quot;&quot;;
+            this.SolveConflictButton.Name = &quot;SolveConflictButton&quot;;
+            this.SolveConflictButton.ReadOnly = true;
+            this.SolveConflictButton.Text = &quot;Solve&quot;;
+            this.SolveConflictButton.UseColumnTextForButtonValue = true;
+            this.SolveConflictButton.Width = 60;
+            // 
             // FormResolveConflicts
             // 
             this.AcceptButton = this.button1;
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(576, 255);
+            this.ClientSize = new System.Drawing.Size(732, 274);
             this.Controls.Add(this.splitContainer1);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject(&quot;$this.Icon&quot;)));
             this.Name = &quot;FormResolveConflicts&quot;;
@@ -173,6 +351,7 @@
             this.Text = &quot;Resolve merge conflicts&quot;;
             this.Load += new System.EventHandler(this.FormResolveConflicts_Load);
             ((System.ComponentModel.ISupportInitialize)(this.ConflictedFiles)).EndInit();
+            this.ConflictedFilesContextMenu.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.gitItemBindingSource)).EndInit();
             this.splitContainer1.Panel1.ResumeLayout(false);
             this.splitContainer1.Panel2.ResumeLayout(false);
@@ -181,6 +360,9 @@
             this.splitContainer2.Panel1.PerformLayout();
             this.splitContainer2.Panel2.ResumeLayout(false);
             this.splitContainer2.ResumeLayout(false);
+            this.splitContainer3.Panel1.ResumeLayout(false);
+            this.splitContainer3.Panel2.ResumeLayout(false);
+            this.splitContainer3.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
@@ -196,6 +378,24 @@
         private System.Windows.Forms.BindingSource gitItemBindingSource;
         private System.Windows.Forms.Button button1;
         private System.Windows.Forms.ColorDialog colorDialog1;
+        private System.Windows.Forms.Button Reset;
+        private System.Windows.Forms.ContextMenuStrip ConflictedFilesContextMenu;
+        private System.Windows.Forms.ToolStripMenuItem ContextChooseBase;
+        private System.Windows.Forms.ToolStripMenuItem ContextChooseLocal;
+        private System.Windows.Forms.ToolStripMenuItem ContextChooseRemote;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+        private System.Windows.Forms.ToolStripMenuItem ContextOpenBaseWith;
+        private System.Windows.Forms.ToolStripMenuItem ContextOpenLocalWith;
+        private System.Windows.Forms.ToolStripMenuItem ContextOpenRemoteWith;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
+        private System.Windows.Forms.ToolStripMenuItem OpenMergetool;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
+        private System.Windows.Forms.ToolStripMenuItem ContextSaveBaseAs;
+        private System.Windows.Forms.ToolStripMenuItem ContextSaveLocalAs;
+        private System.Windows.Forms.ToolStripMenuItem ContextSaveRemoteAs;
+        private System.Windows.Forms.ToolStripMenuItem ContextMarkAsSolved;
+        private System.Windows.Forms.SplitContainer splitContainer3;
         private System.Windows.Forms.DataGridViewTextBoxColumn Namex;
+        private System.Windows.Forms.DataGridViewButtonColumn SolveConflictButton;
     }
 }
\ No newline at end of file</diff>
      <filename>GitUI/FormResolveConflicts.Designer.cs</filename>
    </modified>
    <modified>
      <diff>@@ -19,6 +19,12 @@ namespace GitUI
             ThereWhereMergeConflicts = GitCommands.GitCommands.InTheMiddleOfConflictedMerge();
         }
 
+        void ConflictedFiles_CellClick(object sender, DataGridViewCellEventArgs e)
+        {
+            if (e.ColumnIndex==SolveConflictButton.Index)
+                ConflictedFilesContextMenu.Show(Cursor.Position);
+        }
+
         private void Mergetool_Click(object sender, EventArgs e)
         {
             Directory.SetCurrentDirectory(GitCommands.Settings.WorkingDir);
@@ -40,6 +46,22 @@ namespace GitUI
             ConflictedFiles.DataSource = GitCommands.GitCommands.GetConflictedFiles();
             InitMergetool();
 
+            ConflictedFiles.CellClick += new DataGridViewCellEventHandler(ConflictedFiles_CellClick);
+            ConflictedFilesContextMenu.Text = &quot;Solve&quot;;
+            OpenMergetool.Text = &quot;Open in &quot; + mergetool;
+            button1.Text = &quot;Open in &quot; + mergetool;
+
+            if (GitCommands.GitCommands.InTheMiddleOfRebase())
+            {
+                ContextChooseLocal.Text = &quot;Choose local (theirs)&quot;;
+                ContextChooseRemote.Text = &quot;Choose remote (ours)&quot;;
+            }
+            else
+            {
+                ContextChooseLocal.Text = &quot;Choose local (ours)&quot;;
+                ContextChooseRemote.Text = &quot;Choose remote (theirs)&quot;;
+            }
+
             if (!GitCommands.GitCommands.InTheMiddleOfPatch() &amp;&amp; !GitCommands.GitCommands.InTheMiddleOfRebase() &amp;&amp; !GitCommands.GitCommands.InTheMiddleOfConflictedMerge() &amp;&amp; ThereWhereMergeConflicts)
             {
                 if (MessageBox.Show(&quot;All mergeconflicts are resolved, you can commit.&quot; + Environment.NewLine + &quot;Do you want to commit now?&quot;, &quot;Commit&quot;, MessageBoxButtons.YesNo) == DialogResult.Yes)
@@ -64,14 +86,22 @@ namespace GitUI
         private string mergetoolCmd;
         private string mergetoolPath;
 
+        private string GetFileName()
+        {
+            if (ConflictedFiles.SelectedRows.Count != 1)
+                return null;
+
+            DataGridViewRow row = ConflictedFiles.SelectedRows[0];
+            return ((GitItem)row.DataBoundItem).FileName;
+        }
+
         private void ConflictedFiles_DoubleClick(object sender, EventArgs e)
         {
             if (ConflictedFiles.SelectedRows.Count != 1)
                 return;
 
-            DataGridViewRow row = ConflictedFiles.SelectedRows[0];
+            string filename = GitCommands.GitCommands.GetConflictedFiles(GetFileName());
 
-            string filename = GitCommands.GitCommands.GetConflictedFiles(((GitItem)row.DataBoundItem).FileName);
 
             if (Directory.Exists(Settings.WorkingDir + filename) &amp;&amp; !File.Exists(Settings.WorkingDir + filename))
             {
@@ -98,6 +128,12 @@ namespace GitUI
 
             if (file1 &amp;&amp; file2 &amp;&amp; file3)
             {
+                if (FileHelper.IsBinaryFile(filename))
+                {
+                    if (MessageBox.Show(&quot;The selected file appears to be a binary file.&quot; + Environment.NewLine + &quot;Are you sure you want to open this file in &quot; + mergetool + &quot;?&quot;) == DialogResult.No)
+                        return;
+                }
+
                 arguments = arguments.Replace(&quot;$BASE&quot;, filename + &quot;.BASE&quot;);
                 arguments = arguments.Replace(&quot;$LOCAL&quot;, filename + &quot;.LOCAL&quot;);
                 arguments = arguments.Replace(&quot;$REMOTE&quot;, filename + &quot;.REMOTE&quot;);
@@ -194,5 +230,134 @@ namespace GitUI
         {
             ConflictedFiles_DoubleClick(sender, e);
         }
+
+        private void Reset_Click(object sender, EventArgs e)
+        {
+            if (Abort.AbortCurrentAction())
+                Close();
+        }
+
+        private void ConflictedFiles_SelectionChanged(object sender, EventArgs e)
+        {
+            
+        }
+
+        private void ContextChooseBase_Click(object sender, EventArgs e)
+        {
+            GitCommands.GitCommands.HandleConflice_SelectBase(GetFileName());
+            Initialize();
+        }
+
+        private void ContextChooseLocal_Click(object sender, EventArgs e)
+        {
+            GitCommands.GitCommands.HandleConflice_SelectLocal(GetFileName());
+            Initialize();
+        }
+
+        private void ContextChooseRemote_Click(object sender, EventArgs e)
+        {
+            GitCommands.GitCommands.HandleConflice_SelectRemote(GetFileName());
+            Initialize();
+        }
+
+        private void OpenMergetool_Click(object sender, EventArgs e)
+        {
+            ConflictedFiles_DoubleClick(sender, e);
+        }
+
+        private void ContextOpenBaseWith_Click(object sender, EventArgs e)
+        {
+            string fileName = GetFileName();
+            fileName = GetShortFileName(fileName);
+
+            fileName = Path.GetTempPath() + fileName;
+
+            GitCommands.GitCommands.HandeConflicts_SaveSide(GetFileName(), fileName, &quot;BASE&quot;);
+
+            OpenWith.OpenAs(fileName);
+        }
+
+        private void ContextOpenLocalWith_Click(object sender, EventArgs e)
+        {
+            string fileName = GetFileName();
+            fileName = GetShortFileName(fileName);
+
+            fileName = Path.GetTempPath() + fileName;
+
+            GitCommands.GitCommands.HandeConflicts_SaveSide(GetFileName(), fileName, &quot;LOCAL&quot;);
+
+            OpenWith.OpenAs(fileName);
+        }
+
+        private static string GetShortFileName(string fileName)
+        {
+            if (fileName.Contains(&quot;\\&quot;) &amp;&amp; fileName.LastIndexOf(&quot;\\&quot;) &lt; fileName.Length)
+                fileName = fileName.Substring(fileName.LastIndexOf('\\') + 1);
+            if (fileName.Contains(&quot;/&quot;) &amp;&amp; fileName.LastIndexOf(&quot;/&quot;) &lt; fileName.Length)
+                fileName = fileName.Substring(fileName.LastIndexOf('/') + 1);
+            return fileName;
+        }
+
+        private void ContextOpenRemoteWith_Click(object sender, EventArgs e)
+        {
+            string fileName = GetFileName();
+            fileName = GetShortFileName(fileName);
+
+            fileName = Path.GetTempPath() + fileName;
+
+            GitCommands.GitCommands.HandeConflicts_SaveSide(GetFileName(), fileName, &quot;REMOTE&quot;);
+
+            OpenWith.OpenAs(fileName);
+        }
+
+        private void ConflictedFiles_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
+        {
+            if (e.Button == MouseButtons.Right)
+            {
+                System.Drawing.Point pt = ConflictedFiles.PointToClient(Cursor.Position);
+                DataGridView.HitTestInfo hti = ConflictedFiles.HitTest(pt.X, pt.Y);
+                int LastRow = hti.RowIndex;
+                ConflictedFiles.ClearSelection();
+                if (LastRow &gt;= 0 &amp;&amp; ConflictedFiles.Rows.Count &gt; LastRow)
+                    ConflictedFiles.Rows[LastRow].Selected = true;
+            }
+        }
+
+        private void SaveAs(string side)
+        {
+            string fileName = GetFileName();
+            fileName = GetShortFileName(fileName);
+
+            SaveFileDialog fileDialog = new SaveFileDialog();
+            fileDialog.FileName = Settings.WorkingDir + fileName;
+            fileDialog.AddExtension = true;
+            fileDialog.DefaultExt = GitCommands.GitCommands.GetFileExtension(fileDialog.FileName);
+            fileDialog.Filter = &quot;Current format (*.&quot; + GitCommands.GitCommands.GetFileExtension(fileDialog.FileName) + &quot;)|*.&quot; + GitCommands.GitCommands.GetFileExtension(fileDialog.FileName) + &quot;|All files (*.*)|*.*&quot;;
+
+            if (fileDialog.ShowDialog() == DialogResult.OK)
+            {
+                GitCommands.GitCommands.HandeConflicts_SaveSide(GetFileName(), fileDialog.FileName, side);
+            }
+        }
+
+        private void ContextSaveBaseAs_Click(object sender, EventArgs e)
+        {
+            SaveAs(&quot;BASE&quot;);
+        }
+
+        private void ContextSaveLocalAs_Click(object sender, EventArgs e)
+        {
+            SaveAs(&quot;LOCAL&quot;);
+        }
+
+        private void ContextSaveRemoteAs_Click(object sender, EventArgs e)
+        {
+            SaveAs(&quot;REMOTE&quot;);
+        }
+
+        private void ContextMarkAsSolved_Click(object sender, EventArgs e)
+        {
+            GitCommands.GitCommands.RunCmd(Settings.GitDir + &quot;git.cmd&quot;, &quot;add -- \&quot;&quot; + GetFileName() + &quot;\&quot;&quot;);
+        }
     }
 }</diff>
      <filename>GitUI/FormResolveConflicts.cs</filename>
    </modified>
    <modified>
      <diff>@@ -120,6 +120,12 @@
   &lt;metadata name=&quot;Namex.UserAddedColumn&quot; type=&quot;System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;&gt;
     &lt;value&gt;True&lt;/value&gt;
   &lt;/metadata&gt;
+  &lt;metadata name=&quot;SolveConflictButton.UserAddedColumn&quot; type=&quot;System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&quot;&gt;
+    &lt;value&gt;True&lt;/value&gt;
+  &lt;/metadata&gt;
+  &lt;metadata name=&quot;ConflictedFilesContextMenu.TrayLocation&quot; type=&quot;System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot;&gt;
+    &lt;value&gt;307, 17&lt;/value&gt;
+  &lt;/metadata&gt;
   &lt;metadata name=&quot;gitItemBindingSource.TrayLocation&quot; type=&quot;System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot;&gt;
     &lt;value&gt;17, 17&lt;/value&gt;
   &lt;/metadata&gt;</diff>
      <filename>GitUI/FormResolveConflicts.resx</filename>
    </modified>
    <modified>
      <diff>@@ -52,6 +52,7 @@
     &lt;Reference Include=&quot;System.Xml&quot; /&gt;
   &lt;/ItemGroup&gt;
   &lt;ItemGroup&gt;
+    &lt;Compile Include=&quot;Abort.cs&quot; /&gt;
     &lt;Compile Include=&quot;AboutBox.cs&quot;&gt;
       &lt;SubType&gt;Form&lt;/SubType&gt;
     &lt;/Compile&gt;
@@ -84,6 +85,7 @@
       &lt;DependentUpon&gt;EditNetSpell.cs&lt;/DependentUpon&gt;
     &lt;/Compile&gt;
     &lt;Compile Include=&quot;EditorOptions.cs&quot; /&gt;
+    &lt;Compile Include=&quot;FileHelper.cs&quot; /&gt;
     &lt;Compile Include=&quot;FileViewer.cs&quot;&gt;
       &lt;SubType&gt;UserControl&lt;/SubType&gt;
     &lt;/Compile&gt;</diff>
      <filename>GitUI/GitUI.csproj</filename>
    </modified>
    <modified>
      <diff>@@ -8,6 +8,8 @@ Version 1.79
 	Added alt-c, alt-a and alt-r as keys for commit, amend and rescan.
 	Added checkbox &quot;close dialog after commit&quot; on commit dialog
 	Removed Load button from view patch dialog. Patch is now loaded when file is selected.
+	Added context menu to merge conflict dialog
+	Added &quot;Abort&quot; button to merge conflict dialog
 
 Version 1.78
 	Fixed bug causing the commitmessage to contain encoding marker bytes</diff>
      <filename>GitUI/Resources/ChangeLog.txt</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>aa6fd74d1995f46277727668b304459aecbfb8f0</id>
    </parent>
  </parents>
  <author>
    <name>Henk Westhuis</name>
    <email>Henk_Westhuis@hotmail.com</email>
  </author>
  <url>http://github.com/spdr870/gitextensions/commit/047113061a137f105f02b4ac9a9c8b673fd73de5</url>
  <id>047113061a137f105f02b4ac9a9c8b673fd73de5</id>
  <committed-date>2009-11-02T12:36:51-08:00</committed-date>
  <authored-date>2009-11-02T11:10:20-08:00</authored-date>
  <message>Added context menu in HandleMergeConflicts dialog.</message>
  <tree>74aab3cebcb0f3bffdb8284598ed8d1143ccef23</tree>
  <committer>
    <name>Henk Westhuis</name>
    <email>Henk_Westhuis@hotmail.com</email>
  </committer>
</commit>
