Login | Register
My pages Projects Community openCollabNet

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

delphiaddinfortortoisesvn
Discussion topic

Hide all messages in topic

All messages in topic

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

Author otto_noll
Full name Otto Noll
Date 2009-01-09 06:45:37 PST
Message Author: otto_noll
Date: 2009-01-09 06:45:37-0800
New Revision: 51

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

Log:
Add "Delete" 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​=51&r1=50&r2​=51
====================​====================​====================​==================
--- branches/SOPTIM/src/​tsvnWizard.pas (original)
+++ branches/SOPTIM/src/​tsvnWizard.pas 2009-01-09 06:45:37-0800
@@ -28,7 +28,8 @@
         SVN_LOCK,
         SVN_LOG,
         SVN_MERGE,
- SVN_PROPERTIES
+ SVN_PROPERTIES,
+ SVN_DELETE
     );
 type TTortoiseSVN = class(TNotifierObject, IOTANotifier, IOTAWizard)
 private
@@ -238,7 +239,7 @@
           MItem.Visible := True;
           PMenu.Items.Add(MItem);
           //Creating Submenu of the Popupmenu
- for J:= SVN_Add to SVN_PROPERTIES do begin
+ for J:= SVN_Add to SVN_DELETE do begin
             bmp:= TBitmap.create;
             try
               bmp.LoadFromResourceName( HInstance, getBitmapName(J) );
@@ -281,6 +282,7 @@
     (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_LOG))​) as TMenuItem).Enabled := false;
     (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_MERGE​))) as TMenuItem).Enabled := false;
     (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_PROPE​RTIES))) as TMenuItem).Enabled := false;
+ (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_DELET​E))) as TMenuItem).Enabled := false;
     GetCurrentModuleFile​List(files);
     if files.Count > 0 then
     begin
@@ -294,7 +296,7 @@
       (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_LOCK)​)) as TMenuItem).Enabled := true;
       (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_LOG))​) as TMenuItem).Enabled := true;
       (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_MERGE​))) as TMenuItem).Enabled := true;
- (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_PROPE​RTIES))) as TMenuItem).Enabled := true;
+ (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_DELET​E))) as TMenuItem).Enabled := true;
     end;
 end;
 
@@ -351,6 +353,8 @@
             Result:= 'log';
         SVN_MERGE:
             Result:= 'merge';
+ SVN_DELETE:
+ Result:= 'delete';
         SVN_PROPERTIES:
             Result:= 'properties'
     end;
@@ -399,6 +403,8 @@
             Result:= 'Log...';
         SVN_MERGE:
             Result:= 'Merge...';
+ SVN_DELETE:
+ Result:= 'Delete...';
         SVN_PROPERTIES:
             Result:= 'Properties...';
     end;
@@ -442,6 +448,8 @@
             ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
         SVN_PROPERTIES:
             ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
+ SVN_DELETE:
+ ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
         SVN_UPDATE_TO_SANDBOX:
             if GetCurrentProject <> nil then
                 Result:= vsEnabled;
@@ -497,6 +505,8 @@
 
 procedure TTortoiseSVN.ExecuteVerb(Index: ESVNFeature);
 var project: IOTAProject;
+ i: integer;
+ filestringbuff: string;
 begin
     project:= GetCurrentProject();
     case index of
@@ -562,6 +572,22 @@
               else if GetCurrentModuleFile​List(TStringList.cre​ate).Count = 1 then
                   TSVNExec( '/command:revisiongraph /notempfile /path:' + AnsiQuotedStr(GetCur​rentModuleFileList(T​StringList.create)[0​], '"' ) );
             end;
+ SVN_DELETE:
+ if project <> nil then
+ begin
+ filestringbuff := GetCurrentModuleFile​List(TStringList.cre​ate)[0];
+ if MessageDlg( 'The file '+AnsiQuotedStr(Extr​actFileName(filestri​ngbuff),'"')+' will be deleted and removed from all Projects which owns this file. Continue?', mtConfirmation, [mbYes, mbNo], 0 ) = mrYes then
+ begin
+ (BorlandIDEServices as IOTAActionServices).​CloseFile(filestring​buff);
+ for i := 0 to (BorlandIDEServices as IOTAModuleServices).​CurrentModule.GetOwn​erCount - 1 do
+ (BorlandIDEServices as IOTAModuleServices).​CurrentModule.GetOwn​er(i).RemoveFile(fil​estringbuff);
+ if GetCurrentModuleFile​List(TStringList.cre​ate).Count > 1 then
+ TSVNExec( '/command:remove /notempfile /path:' + AnsiQuotedStr( ExtractFileName(file​stringbuff), '"' ) )
+ else if GetCurrentModuleFile​List(TStringList.cre​ate).Count = 1 then
+ TSVNExec( '/command:remove /notempfile /path:' + AnsiQuotedStr(filestringbuff, '"' ) );
+ end;
+ filestringbuff:='';
+ end;
         SVN_LOG:
             if project <> nil then
             begin
Messages per page: