Permalink
Browse files

fix workitem 17795: Automatically save items when refreshing

  • Loading branch information...
yysun committed Oct 28, 2012
1 parent 2270ddf commit c3c5d0629c714255dd7297cd714d6b7e53cefd0d
Showing with 14 additions and 4 deletions.
  1. +1 −1 BasicSccProvider.Tests/PackageTest.cs
  2. +10 −1 PendingChangesToolWindow.cs
  3. +3 −2 Readme.htm
@@ -69,7 +69,7 @@ public void TestHasProjectOpened()
//Get the global service provider and the dte
IServiceProvider sp = VsIdeTestHostContext.ServiceProvider;
DTE dte = (DTE)sp.GetService(typeof(DTE));
- dte.Solution.Open(@"C:\Users\Eric\Documents\Visual Studio 2010\Projects\Solution1 - Multiple Git\Solution1 - Multiple Git.sln");
+ dte.Solution.Open(@"E:\Users\Public\My Projects\GitScc\Publish\TestProjects\UTF8Test\UTF8Test.sln");
});
}
@@ -63,20 +63,29 @@ public override void OnToolWindowCreated()
{
sccProviderService = BasicSccProvider.GetServiceEx<SccProviderService>();
Refresh(sccProviderService.CurrentTracker, true); // refresh when the tool window becomes visible
- }
+ }
+
+ internal bool hasFileSaved()
+ {
+ var dte = BasicSccProvider.GetServiceEx<EnvDTE.DTE>();
+ return dte.ItemOperations.PromptToSave != EnvDTE.vsPromptResult.vsPromptResultCancelled;
+ }
internal void OnCommitCommand()
{
+ if (!hasFileSaved()) return;
((PendingChangesView)control).Commit();
}
internal void OnAmendCommitCommand()
{
+ if (!hasFileSaved()) return;
((PendingChangesView)control).AmendCommit();
}
private void OnRefreshCommand(object sender, EventArgs e)
{
+ hasFileSaved(); //just a reminder, refresh anyway
sccProviderService.OpenTracker();
sccProviderService.RefreshNodesGlyphs();
Refresh(sccProviderService.CurrentTracker, true);
View
@@ -30,8 +30,9 @@ <h2>Change Logs</h2>
<li>Prompt user to set name and email for git, if not already</li>
<li>Support bulk file deletion</li>
<li>Merge pull requests, #27, #28, #32, #34 from github</li>
- <li>Bug fix: <a href="http://gitscc.codeplex.com/workitem/17798">Allow commit of selected changes via Ctrl+Enter</a></li>
- <li>Bug fix: <a href="http://gitscc.codeplex.com/workitem/17792">Git Refresh not working in Pending Changes when auto refresh is disabled</a></li>
+ <li><a href="http://gitscc.codeplex.com/workitem/17798">Allow commit of selected changes via Ctrl+Enter</a></li>
+ <li><a href="http://gitscc.codeplex.com/workitem/17795">Automatically save items when refreshing</a>
+ <li><a href="http://gitscc.codeplex.com/workitem/17792">Git Refresh not working in Pending Changes when auto refresh is disabled</a></li>
</ul>
<strong>V 0.9.6.1 </strong>
<ul>

0 comments on commit c3c5d06

Please sign in to comment.