Login | Register
My pages Projects Community openCollabNet

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

delphiaddinfortortoisesvn
Discussion topic

Back to topic list

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

Author otto_noll
Full name Otto Noll
Date 2009-01-15 07:55:02 PST
Message Author: otto_noll
Date: 2009-01-15 07:55:01-0800
New Revision: 72

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

Log:
Add "Move" 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​=72&r1=71&r2​=72
====================​====================​====================​==================
--- branches/SOPTIM/src/​tsvnWizard.pas (original)
+++ branches/SOPTIM/src/​tsvnWizard.pas 2009-01-15 07:55:01-0800
@@ -5,7 +5,7 @@
 interface
 
 uses ToolsAPI, SysUtils,StrUtils, Windows, Dialogs, Menus, Registry, ShellApi,
- Classes, Controls, Graphics, ImgList, ExtCtrls, ActnList,Forms;
+ Classes, Controls, Graphics, ImgList, ExtCtrls, ActnList,Forms,FileCtrl;
 type
     ESVNFeature = (
         SVN_EXPLORE_SANDBOX,
@@ -39,6 +39,7 @@
         SVN_LOCK,
         SVN_LOG,
         SVN_RENAME,
+ SVN_MOVE,
         SVN_MERGE,
         SVN_PROPERTIES,
         SVN_DELETE,
@@ -321,6 +322,7 @@
     (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;
     (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_RENAM​E))) as TMenuItem).Enabled := false;
+ (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_MOVE)​)) as TMenuItem).Enabled := false;
     GetCurrentModuleFile​List(files);
     if files.Count > 0 then
     begin
@@ -347,6 +349,7 @@
     if (files.Count > 0) and not (SVNPath = '') and not (ExtractFileExt(curr​entfilename) = '.dproj') and not (ExtractFileExt(curr​entfilename) = '.dpr') then
     begin
       (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_RENAM​E))) as TMenuItem).Enabled := true;
+ (submenu.FindCompone​nt('ESVNFeature_'+in​ttostr(ord(SVN_MOVE)​)) as TMenuItem).Enabled := true;
     end;
 end;
 
@@ -441,6 +444,8 @@
             Result:= 'update';
         SVN_RENAME:
             Result:= 'rename';
+ SVN_MOVE:
+ Result:= 'move';
         SVN_UPDATE_TO:
             Result:= 'update';
     end;
@@ -527,6 +532,8 @@
             Result:= 'Unlock...';
         SVN_RENAME:
             Result:= 'Rename...';
+ SVN_MOVE:
+ Result:= 'Move...';
         SVN_UPDATE:
             Result:= 'Update...';
         SVN_UPDATE_TO:
@@ -586,6 +593,8 @@
             ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
         SVN_RENAME:
             ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
+ SVN_MOVE:
+ ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
         SVN_BLAME:
             ;// this verb state is updated by TTortoiseSVN.CheckOn_Popup
         SVN_BRANCH:
@@ -708,13 +717,41 @@
 
 
 procedure TTortoiseSVN.ExecuteVerb(Index: ESVNFeature);
+const
+ co_Caption = 'Open SVN Working Directory';
+ co_Root='';
 var project: IOTAProject;
+ MainForm : TForm;
     i,modulecount: integer;
- oldfilename,newfilen​ame,filestringbuff: string;
+ oldfilename,newfilen​ame,filestringbuff,r​enamestring,strPath:​ string;
 begin
     project:= GetCurrentProject();
     case index of
- SVN_RENAME:
+ SVN_MOVE:
+ if project <> nil then
+ begin
+ if MessageDlg( 'The file '+AnsiQuotedStr(Extr​actFileName(GetCurre​ntModuleFileList(TSt​ringList.create)[0])​,'"')+' will be saved before move. Continue?', mtConfirmation, [mbYes, mbNo], 0 ) = mrYes then
+ begin
+ SaveForegroundEditorFile();
+ renamestring:=GetCur​rentModuleFileList(T​StringList.create)[0​];;
+ filestringbuff:= GetCurrentModuleFile​List(TStringList.cre​ate)[0];
+ strPath := ExtractFilePath(GetC​urrentModuleFileList​(TStringList.create)​[0]);
+ Delete(renamestring,​1,Length(ExtractFile​Path(renamestring)))​;
+ Application.CreateForm (TForm, MainForm);
+ selectDirectory(co_Caption, ExtractFileDir((Borl​andIDEServices as IOTAModuleServices).​CurrentModule.GetOwn​er(0).GetFileName) , strPath,[filectrl.sd​NewUI],nil);
+ if DirectoryExists(strP​ath+'\.svn')then
+ begin
+ (BorlandIDEServices as IOTAModuleServices).​CurrentModule.SetFil​eName(strPath+'\'+E​xtractFileName(GetCu​rrentModuleFileList(​TStringList.create)[​0]));
+ (BorlandIDEServices as IOTAModuleServices).​CurrentModule.MarkMo​dified;
+ (BorlandIDEServices as IOTAModuleServices).​CurrentModule.Save(f​alse,true);
+ DeleteFile(PAnsiChar​(strPath+'\'+Extrac​tFileName(GetCurrent​ModuleFileList(TStri​ngList.create)[0])))​;
+ SVNExec(' move '+ filestringbuff +' '+ strPath+'\'+Extract​FileName(filestringb​uff) );
+ end
+ else
+ ShowMessage('Destination is no a vaild SVN path');
+ end;
+ end;
+ SVN_RENAME:
             if project <> nil then
             begin
               newfilename:=InputBox('Rename '+GetCurrentModuleFi​leList(TStringList.c​reate)[0],'The file will be saved before rename.'+#13#10+'To Continue insert the new Filename and press Ok','');

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

Messages

Show all messages in topic

svn commit: r72 - branches/SOPTIM/src/tsvnWizard.pas otto_noll Otto Noll 2009-01-15 07:55:02 PST
Messages per page: