Permalink
Browse files

Merge remote-tracking branch 'origin/master'

  • Loading branch information...
2 parents c71799e + 41f07eb commit 994a950df38c48f1ab1b77279afc793987063a03 @yysun committed Sep 18, 2012
View
@@ -358,8 +358,16 @@ private void OnGitExtensionCommand(object sender, EventArgs e)
internal void RunDiffCommand(string file1, string file2)
{
- var difftoolPath = GitSccOptions.Current.DifftoolPath;
- RunCommand(difftoolPath, "\"" + file1 + "\" \"" + file2 + "\"");
+ var diffService = (IVsDifferenceService)GetService(typeof(SVsDifferenceService));
+ if (GitSccOptions.Current.UseVsDiff && diffService != null)
+ {
+ diffService.OpenComparisonWindow(file1, file2);
+ }
+ else
+ {
+ var difftoolPath = GitSccOptions.Current.DifftoolPath;
+ RunCommand(difftoolPath, "\"" + file1 + "\" \"" + file2 + "\"");
+ }
}
private void OnInitCommand(object sender, EventArgs e)
View
@@ -58,6 +58,10 @@
<Reference Include="Microsoft.VisualStudio.Shell.Interop.10.0, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<EmbedInteropTypes>True</EmbedInteropTypes>
</Reference>
+ <Reference Include="Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <EmbedInteropTypes>True</EmbedInteropTypes>
+ <HintPath>C:\Program Files (x86)\Microsoft Visual Studio 11.0\VSSDK\VisualStudioIntegration\Common\Assemblies\v4.0\Microsoft.VisualStudio.Shell.Interop.11.0.dll</HintPath>
+ </Reference>
<Reference Include="Microsoft.VisualStudio.Shell.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Shell.Interop.9.0, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<Reference Include="Microsoft.VisualStudio.Text.Data, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
@@ -289,6 +289,9 @@ public GitFileStatus GetFileStatusNoCacheOld(string fileName)
{
if (treeEntry == null)
{
+ if (indexEntry.IsModified(repository.WorkTree, true))
+ return GitFileStatus.Modified;
+
return GitFileStatus.Added;
}
if (!File.Exists(fileName))
View
@@ -4,6 +4,8 @@
using System.Text;
using System.IO;
using System.Xml.Serialization;
+using Microsoft.VisualStudio.Shell;
+using Microsoft.VisualStudio.Shell.Interop;
namespace GitScc
{
@@ -24,6 +26,7 @@ public class GitSccOptions
public bool DisableAutoRefresh { get; set; }
public bool DisableAutoLoad { get; set; }
public bool NotUseUTF8FileNames { get; set; }
+ public bool UseVsDiff { get; set; }
private static GitSccOptions gitSccOptions;
@@ -96,6 +99,10 @@ private void Init()
}
if (string.IsNullOrEmpty(DifftoolPath)) DifftoolPath = "diffmerge.exe";
+
+ bool diffServiceAvailable = Package.GetGlobalService(typeof(SVsDifferenceService)) != null;
+ if (!diffServiceAvailable)
+ UseVsDiff = false;
}
internal void SaveConfig()
@@ -64,7 +64,7 @@
<Label Content="Commits" Height="28" HorizontalAlignment="Left" Margin="10,61,0,0" VerticalAlignment="Top" FontSize="10" />
<TextBox VerticalAlignment="Bottom" Margin="60,0,250,5.04" x:Name="txtSearch" TextChanged="txtSearch_TextChanged" PreviewKeyDown="txtSearch_PreviewKeyDown" PreviewMouseDown="txtSearch_PreviewMouseDown" />
<ListBox Height="100" Margin="60,0,250,-95.96" VerticalAlignment="Bottom" x:Name="lstSearch" PreviewKeyDown="lstSearch_PreviewKeyDown" MouseDoubleClick="lstSearch_MouseDoubleClick" />
- <Button Content="Compare" HorizontalAlignment="Right" Margin="0,46,107,0" Template="{DynamicResource CompareButtonControlTemplate}" ToolTip="Compare ..." x:Name="btnCompare" Click="btnCompare_Click" RenderTransformOrigin="1.917,0.512"/>
+ <Button Content="Compare" HorizontalAlignment="Right" Margin="0,46,107,0" Template="{DynamicResource CompareButtonControlTemplate}" ToolTip="Compare..." x:Name="btnCompare" Click="btnCompare_Click" RenderTransformOrigin="1.917,0.512"/>
<TextBlock HorizontalAlignment="Right" Margin="0,0,144,14" TextWrapping="NoWrap" Text="123456" Width="88.38" Foreground="#FFFF5656" x:Name="txtCommit1" FontSize="10" Height="24" VerticalAlignment="Bottom" />
<TextBlock HorizontalAlignment="Right" Height="24" Margin="0,0,144,0" TextWrapping="NoWrap" Text="123456" VerticalAlignment="Bottom" Width="88.38" Foreground="#FFFF5656" x:Name="txtCommit2" FontSize="10" />
<Label Content="Selected Commits &#xd;&#xa;to compare" Height="46" HorizontalAlignment="Right" Margin="0,11,137,0" VerticalAlignment="Top" FontSize="10" Width="99.897" x:Name="lblSelectedCommits"/>
@@ -132,7 +132,7 @@
<ContextMenu>
<MenuItem Header="Stage File" Name="menuStage" Click="menuStage_Click" />
<MenuItem Header="Un-Stage File" Name="menuUnstage" Click="menuUnstage_Click" />
- <MenuItem Header="Compare ..." Name="menuCompare" Click="menuCompare_Click" Visibility="Collapsed" />
+ <MenuItem Header="Compare..." Name="menuCompare" Click="menuCompare_Click" Visibility="Collapsed" />
<MenuItem Header="Undo File Changes" Name="menuUndo" Click="menuUndo_Click"/>
<MenuItem Header="Delete File" Name="menuDeleteFile" Click="menuDeleteFile_Click"/>
<MenuItem Header="Ignore File" Name="menuIgnore" Click="menuIgnore_Click" >
View
@@ -87,7 +87,7 @@
<ContextMenu>
<MenuItem Header="Stage File" Name="menuStage" Click="menuStage_Click" />
<MenuItem Header="Un-Stage File" Name="menuUnstage" Click="menuUnstage_Click" />
- <MenuItem Header="Compare ..." Name="menuCompare" Click="menuCompare_Click" />
+ <MenuItem Header="Compare..." Name="menuCompare" Click="menuCompare_Click" />
<MenuItem Header="Undo File Changes" Name="menuUndo" Click="menuUndo_Click"/>
<MenuItem Header="Delete File" Name="menuDeleteFile" Click="menuDeleteFile_Click"/>
<MenuItem Header="Ignore file" Name="menuIgnore" Click="menuIgnore_Click" >
View
@@ -71,6 +71,11 @@
<Group guid="guidSccProviderCmdSet" id="igrpPendingChangesToolWindowGitTor" priority="0x0000">
<Parent guid="guidSccProviderCmdSet" id="imnuPendingChangesToolWindowGitTor"/>
</Group>
+
+ <!-- Document TabWnd context menu -->
+ <Group guid="guidSccProviderCmdSet" id="igrpDocTabWnd" priority="0x0600">
+ <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_EZDOCWINTAB"/>
+ </Group>
</Groups>
@@ -110,13 +115,12 @@
</Button>
<Button guid="guidSccProviderCmdSet" id="icmdSccCommandCompare" priority="0x0101" type="Button">
- <Parent guid="guidSccProviderCmdSet" id="igrpSourceControlCommands"/>
<Icon guid="guidSccProviderImages" id="iconCompare" />
<CommandFlag>DynamicVisibility</CommandFlag>
<CommandFlag>DefaultInvisible</CommandFlag>
<CommandFlag>IconAndText</CommandFlag>
<Strings>
- <ButtonText>Compare ...</ButtonText>
+ <ButtonText>Compare...</ButtonText>
</Strings>
</Button>
@@ -301,6 +305,16 @@
<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_SOLUTION_SCC"/>
</CommandPlacement>
+ <!-- Item context menu | Compare -->
+ <CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandCompare" priority="0x0003">
+ <Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_ITEM_SCC"/>
+ </CommandPlacement>
+
+ <!-- Document Tab context menu | Compare -->
+ <CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandCompare" priority="0x0600">
+ <Parent guid="guidSccProviderCmdSet" id="igrpDocTabWnd"/>
+ </CommandPlacement>
+
<!--<CommandPlacement guid="guidSccProviderCmdSet" id="icmdSccCommandAbout" priority="0x0004">
<Parent guid="guidSHLMainMenu" id="IDG_VS_CTXT_ITEM_SCC"/>
</CommandPlacement>
@@ -380,6 +394,7 @@
<IDSymbol name="imnuGitSourceControlMenu" value="0x205"/>
<IDSymbol name="igrpSourceControlCommands" value="0x301"/>
+ <IDSymbol name="igrpDocTabWnd" value="0x302"/>
<IDSymbol name="imnuHistoryToolWindowToolbarMenu" value="0x200"/>
<IDSymbol name="igrpHistoryToolWindowToolbarGroup" value="0x201"/>
Oops, something went wrong.

0 comments on commit 994a950

Please sign in to comment.