Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r32 - branches/SOPTIM/src/tsvnWizard.pas

delphiaddinfortortoisesvn
Discussion topic

Back to topic list

svn commit: r32 - branches/SOPTIM/src/tsvnWizard.pas

Author otto_noll
Full name Otto Noll
Date 2008-12-19 09:41:33 PST
Message Author: otto_noll
Date: 2008-12-19 09:41:32-0800
New Revision: 32

Modified:
   branches/SOPTIM/src/​tsvnWizard.pas

Log:
Add Diff to the PopUp menu

Modified: branches/SOPTIM/src/​tsvnWizard.pas
Url: http://delphiaddinfo​rtortoisesvn.tigris.​org/source/browse/de​lphiaddinfortortoise​svn/branches/SOPTIM/​src/tsvnWizard.pas?v​iew=diff&pathrev​=32&r1=31&r2​=32
====================​====================​====================​==================
--- branches/SOPTIM/src/​tsvnWizard.pas (original)
+++ branches/SOPTIM/src/​tsvnWizard.pas 2008-12-19 09:41:32-0800
@@ -17,7 +17,8 @@
         SVN_REVERT_SANDBOX,
         SVN_REPOSITORY_BROWSER,
         SVN_SETTINGS,
- SVN_ABOUT
+ SVN_ABOUT,
+ SVN_DIFF
     );
 type TTortoiseSVN = class(TNotifierObject, IOTANotifier, IOTAWizard)
 private
@@ -201,7 +202,7 @@
           MItem.Visible := True;
           PMenu.Items.Add(MItem);
           //Creating Submenu of the Popupmenu
- for J:= SVN_About to SVN_About do begin
+ for J:= SVN_About to SVN_DIFF do begin
             bmp:= TBitmap.create;
             try
               bmp.LoadFromResourceName( HInstance, getBitmapName(J) );
@@ -234,6 +235,12 @@
     submenu := popup.FindComponent(​'TortoiseSVN_popmenu​') as TMenuItem;
     files:= TStringList.create;
     (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_About​))) as TMenuItem).Enabled := true;
+ (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_DIFF)​)) as TMenuItem).Enabled := false;
+ GetCurrentModuleFile​List(files);
+ if files.Count > 0 then
+ begin
+ (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_DIFF)​)) as TMenuItem).Enabled := true;
+ end;
 end;
 
 
@@ -261,6 +268,8 @@
             Result:= 'update';
         SVN_COMMIT_SANDBOX:
             Result:= 'commit';
+ SVN_DIFF:
+ Result:= 'diff';
         SVN_REVERT_SANDBOX:
             Result:= 'revert';
         SVN_REPOSITORY_BROWSER:
@@ -287,6 +296,8 @@
             Result:= '&Update to revision...';
         SVN_COMMIT_SANDBOX:
             Result:= '&Commit...';
+ SVN_DIFF:
+ Result:= '&Diff...';
         SVN_REVERT_SANDBOX:
             Result:= '&Revert...';
         SVN_REPOSITORY_BROWSER:
@@ -322,6 +333,9 @@
         SVN_COMMIT_SANDBOX:
             if GetCurrentProject <> nil then
                 Result:= vsEnabled;
+ SVN_DIFF:
+ // this verb state is updated by TTortoiseSVN.CheckOn_Popup
+ ;
         SVN_REVERT_SANDBOX:
             if GetCurrentProject <> nil then
                 Result:= vsEnabled;
@@ -368,6 +382,24 @@
                     (BorlandIDEServices as IOTAModuleServices).saveAll;
                     TSVNExec( '/command:commit /notempfile /path:' + AnsiQuotedStr( ExtractFilePath(proj​ect.GetFileName), '"' ) );
                 end;
+ SVN_DIFF:
+ begin
+ if project <> nil then
+ begin
+ if MessageDlg( 'The file '+AnsiQuotedStr(Extr​actFileName(GetCurre​ntModuleFileList(TSt​ringList.create)[0])​,'"')+' will be saved before diff. Continue?', mtConfirmation, [mbYes, mbNo], 0 ) = mrYes then
+ begin
+ if SaveForegroundEditorFile() then
+ begin
+ if GetCurrentModuleFile​List(TStringList.cre​ate).Count > 1 then
+ TSVNExec( '/command:diff /notempfile /path:' + AnsiQuotedStr( ExtractFileName(GetC​urrentModuleFileList​(TStringList.create)​[0] ), '"' ) )
+ else if GetCurrentModuleFile​List(TStringList.cre​ate).Count = 1 then
+ TSVNExec( '/command:diff /notempfile /path:' + AnsiQuotedStr(GetCur​rentModuleFileList(T​StringList.create)[0​], '"' ) );
+ end
+ else
+ MessageDlg( 'The file '+AnsiQuotedStr(Extr​actFileName(GetCurre​ntModuleFileList(TSt​ringList.create)[0])​,'"')+' could not be saved before diff.', mtConfirmation, [mbYes], 0 )
+ end;
+ end;
+ end;
         SVN_REVERT_SANDBOX:
             if project <> nil then
                 TSVNExec( '/command:revert /notempfile /path:' + AnsiQuotedStr( ExtractFilePath(proj​ect.GetFileName), '"' ) );

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r32 - branches/SOPTIM/src/tsvnWizard.pas otto_noll Otto Noll 2008-12-19 09:41:33 PST
Messages per page: