From caf823381254d0a7741a5eb469c66aa6491789a3 Mon Sep 17 00:00:00 2001 From: Linquize Date: Sat, 31 Aug 2013 20:32:28 +0800 Subject: [PATCH] Add git sync --- data/resources/StringResources.resx | 4 ++++ src/AddIns/VersionControl/GitAddIn/GitAddIn.addin | 4 ++++ src/AddIns/VersionControl/GitAddIn/Src/Commands.cs | 8 ++++++++ src/AddIns/VersionControl/GitAddIn/Src/GitGuiWrapper.cs | 5 +++++ 4 files changed, 21 insertions(+) diff --git a/data/resources/StringResources.resx b/data/resources/StringResources.resx index ed5268815f..759c54798c 100644 --- a/data/resources/StringResources.resx +++ b/data/resources/StringResources.resx @@ -403,6 +403,10 @@ They will stop working after removing this AddIn! Are you sure you want to conti Show Class Diagram + + Sync + Synchronize changes with remote repository + TortoiseGit needs to be installed to execute this action. Error message when executing git command but TortoiseGit cannot be found diff --git a/src/AddIns/VersionControl/GitAddIn/GitAddIn.addin b/src/AddIns/VersionControl/GitAddIn/GitAddIn.addin index 0406befc5b..f5ba229d00 100644 --- a/src/AddIns/VersionControl/GitAddIn/GitAddIn.addin +++ b/src/AddIns/VersionControl/GitAddIn/GitAddIn.addin @@ -41,6 +41,10 @@ label = "Git ${res:AddIns.Subversion.ShowLog}..." class = "ICSharpCode.GitAddIn.GitLogCommand"/> + + diff --git a/src/AddIns/VersionControl/GitAddIn/Src/Commands.cs b/src/AddIns/VersionControl/GitAddIn/Src/Commands.cs index b1be2ca685..b88c118b1b 100644 --- a/src/AddIns/VersionControl/GitAddIn/Src/Commands.cs +++ b/src/AddIns/VersionControl/GitAddIn/Src/Commands.cs @@ -101,6 +101,14 @@ namespace ICSharpCode.GitAddIn } } + public class GitSyncCommand : GitCommand + { + protected override void Run(string filename, Action callback) + { + GitGuiWrapper.Sync(filename, callback); + } + } + public class GitBlameCommand : GitCommand { protected override void Run(string filename, Action callback) diff --git a/src/AddIns/VersionControl/GitAddIn/Src/GitGuiWrapper.cs b/src/AddIns/VersionControl/GitAddIn/Src/GitGuiWrapper.cs index 5babad447f..f71259edf6 100644 --- a/src/AddIns/VersionControl/GitAddIn/Src/GitGuiWrapper.cs +++ b/src/AddIns/VersionControl/GitAddIn/Src/GitGuiWrapper.cs @@ -101,6 +101,11 @@ namespace ICSharpCode.GitAddIn Proc("log", fileName, callback); } + public static void Sync(string fileName, Action callback) + { + Proc("sync", fileName, callback); + } + public static void Blame(string fileName, Action callback) { Proc("blame", fileName, callback);