Login | Register
My pages Projects Community openCollabNet

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

delphiaddinfortortoisesvn
Discussion topic

Hide all messages in topic

All messages in topic

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

Author otto_noll
Full name Otto Noll
Date 2009-01-08 11:42:53 PST
Message Author: otto_noll
Date: 2009-01-08 11:42:52-0800
New Revision: 42

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

Log:
Add "Lock" 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​=42&r1=41&r2​=42
====================​====================​====================​==================
--- branches/SOPTIM/src/​tsvnWizard.pas (original)
+++ branches/SOPTIM/src/​tsvnWizard.pas 2009-01-08 11:42:52-0800
@@ -24,7 +24,8 @@
         SVN_COMMIT,
         SVN_DIFF,
         SVN_EXPLORE,
- SVN_GRAPH
+ SVN_GRAPH,
+ SVN_LOCK
     );
 type TTortoiseSVN = class(TNotifierObject, IOTANotifier, IOTAWizard)
 private
@@ -96,7 +97,6 @@
       end;
 end;
 
-
 //Refactor procedure to function
 //Now the function can be use as a variable in other functions
 function GetCurrentModuleFileList( fileList: TStrings ):TStrings;
@@ -208,7 +208,7 @@
           MItem.Visible := True;
           PMenu.Items.Add(MItem);
           //Creating Submenu of the Popupmenu
- for J:= SVN_Add to SVN_GRAPH do begin
+ for J:= SVN_Add to SVN_LOCK do begin
             bmp:= TBitmap.create;
             try
               bmp.LoadFromResourceName( HInstance, getBitmapName(J) );
@@ -247,6 +247,7 @@
     (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_COMMI​T))) as TMenuItem).Enabled := false;
     (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_EXPLO​RE))) as TMenuItem).Enabled := false;
     (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_GRAPH​))) as TMenuItem).Enabled := false;
+ (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_LOCK)​)) as TMenuItem).Enabled := false;
     GetCurrentModuleFile​List(files);
     if files.Count > 0 then
     begin
@@ -257,6 +258,7 @@
       (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_COMMI​T))) as TMenuItem).Enabled := true;
       (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_EXPLO​RE))) as TMenuItem).Enabled := true;
       (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_GRAPH​))) as TMenuItem).Enabled := true;
+ (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_LOCK)​)) as TMenuItem).Enabled := true;
     end;
 end;
 
@@ -307,6 +309,8 @@
             Result:= 'explore';
         SVN_GRAPH:
             Result:= 'revisiongraph';
+ SVN_LOCK:
+ Result:= 'lock';
     end;
 end;
 
@@ -347,6 +351,8 @@
             Result:= 'Explore folder...';
         SVN_GRAPH:
             Result:= 'Revisiongraph...';
+ SVN_LOCK:
+ Result:= 'Lock...';
     end;
 end;
 
@@ -380,6 +386,8 @@
             ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
         SVN_GRAPH:
             ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
+ SVN_LOCK:
+ ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
         SVN_UPDATE_TO_SANDBOX:
             if GetCurrentProject <> nil then
                 Result:= vsEnabled;
@@ -430,6 +438,9 @@
   CloseHandle(ProcInfo.hThread);
 end;
 
+
+
+
 procedure TTortoiseSVN.ExecuteVerb(Index: ESVNFeature);
 var project: IOTAProject;
 begin
@@ -505,6 +516,21 @@
               else if GetCurrentModuleFile​List(TStringList.cre​ate).Count = 1 then
                   ShellExecute( 0, 'open', pchar( ExtractFilePath(GetC​urrentModuleFileList​(TStringList.create)​[0])), '', '', SW_SHOWNORMAL )
             end;
+ SVN_LOCK:
+ if project <> nil then
+ begin
+ if GetCurrentModuleFile​List(TStringList.cre​ate).Count > 1 then
+ begin
+ TSVNExec( '/command:lock /notempfile /path:' + AnsiQuotedStr( ExtractFileName(GetC​urrentModuleFileList​(TStringList.create)​[0] ), '"' ) );
+ (BorlandIDEServices as IOTAActionServices).​ReloadFile(GetCurren​tModuleFileList(TStr​ingList.create)[0]);​
+ end
+ else if GetCurrentModuleFile​List(TStringList.cre​ate).Count = 1 then
+ begin
+ TSVNExec( '/command:lock /notempfile /path:' + AnsiQuotedStr(GetCur​rentModuleFileList(T​StringList.create)[0​], '"'));
+ (BorlandIDEServices as IOTAActionServices).​ReloadFile(GetCurren​tModuleFileList(TStr​ingList.create)[0]);​
+
+ end;
+ end;
         SVN_BLAME:
             if project <> nil then
             begin
Messages per page: