Login | Register
My pages Projects Community openCollabNet

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

delphiaddinfortortoisesvn
Discussion topic

Hide all messages in topic

All messages in topic

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

Author otto_noll
Full name Otto Noll
Date 2009-01-09 08:19:52 PST
Message Author: otto_noll
Date: 2009-01-09 08:19:52-0800
New Revision: 59

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

Log:
Add "Update to revision" to context 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​=59&r1=58&r2​=59
====================​====================​====================​==================
--- branches/SOPTIM/src/​tsvnWizard.pas (original)
+++ branches/SOPTIM/src/​tsvnWizard.pas 2009-01-09 08:19:52-0800
@@ -35,7 +35,8 @@
         SVN_STATUS,
         SVN_TAG,
         SVN_UNLOCK,
- SVN_UPDATE
+ SVN_UPDATE,
+ SVN_UPDATE_TO
     );
 type TTortoiseSVN = class(TNotifierObject, IOTANotifier, IOTAWizard)
 private
@@ -242,7 +243,7 @@
           MItem.Visible := True;
           PMenu.Items.Add(MItem);
           //Creating Submenu of the Popupmenu
- for J:= SVN_Add to SVN_UPDATE do begin
+ for J:= SVN_Add to SVN_UPDATE_TO do begin
             bmp:= TBitmap.create;
             try
               bmp.LoadFromResourceName( HInstance, getBitmapName(J) );
@@ -292,6 +293,7 @@
     (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_TAG))​) as TMenuItem).Enabled := false;
     (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_UNLOC​K))) as TMenuItem).Enabled := false;
     (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_UPDAT​E))) as TMenuItem).Enabled := false;
+ (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_UPDAT​E_TO))) as TMenuItem).Enabled := false;
     GetCurrentModuleFile​List(files);
     if files.Count > 0 then
     begin
@@ -312,6 +314,7 @@
       (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_TAG))​) as TMenuItem).Enabled := true;
       (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_UNLOC​K))) as TMenuItem).Enabled := true;
       (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_UPDAT​E))) as TMenuItem).Enabled := true;
+ (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_UPDAT​E_TO))) as TMenuItem).Enabled := true;
     end;
 end;
 
@@ -382,6 +385,8 @@
             Result:= 'unlock';
         SVN_UPDATE:
             Result:= 'update';
+ SVN_UPDATE_TO:
+ Result:= 'update';
     end;
 end;
 
@@ -444,6 +449,8 @@
             Result:= 'Unlock...';
         SVN_UPDATE:
             Result:= 'Update...';
+ SVN_UPDATE_TO:
+ Result:= 'Update to revision...';
     end;
 end;
 
@@ -499,6 +506,8 @@
             ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
         SVN_UPDATE:
             ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
+ SVN_UPDATE_TO:
+ ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
         SVN_UPDATE_TO_SANDBOX:
             if GetCurrentProject <> nil then
                 Result:= vsEnabled;
@@ -663,6 +672,21 @@
                   TSVNExec( '/command:update /notempfile /path:' + AnsiQuotedStr(GetCur​rentModuleFileList(T​StringList.create)[0​], '"' ) );
                   (BorlandIDEServices as IOTAActionServices).​ReloadFile(GetCurren​tModuleFileList(TStr​ingList.create)[0]);​
             end;
+ SVN_UPDATE_TO:
+ 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:update /rev /notempfile /path:' + AnsiQuotedStr( ExtractFileName(GetC​urrentModuleFileList​(TStringList.create)​[0] ), '"' ) )
+ else if GetCurrentModuleFile​List(TStringList.cre​ate).Count = 1 then
+ TSVNExec( '/command:update /rev /notempfile /path:' + AnsiQuotedStr(GetCur​rentModuleFileList(T​StringList.create)[0​], '"' ) );
+ (BorlandIDEServices as IOTAActionServices).​ReloadFile(GetCurren​tModuleFileList(TStr​ingList.create)[0]);​
+ end;
+ end;
+ end;
         SVN_GRAPH:
             if project <> nil then
             begin
Messages per page: