Changeset 8
- Timestamp:
- May 18, 2015, 12:15:30 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormBrowse.lfm
r7 r8 7 7 ClientHeight = 526 8 8 ClientWidth = 722 9 OnCreate = FormCreate 10 OnDestroy = FormDestroy 9 11 LCLVersion = '1.5' 10 12 object TreeView1: TTreeView -
trunk/Forms/UFormBrowse.pas
r7 r8 33 33 procedure ADeleteExecute(Sender: TObject); 34 34 procedure AOpenExecute(Sender: TObject); 35 procedure FormCreate(Sender: TObject); 36 procedure FormDestroy(Sender: TObject); 35 37 procedure ListView1Data(Sender: TObject; Item: TListItem); 36 38 procedure ListView1DblClick(Sender: TObject); … … 83 85 end; 84 86 87 procedure TFormBrowse.FormCreate(Sender: TObject); 88 begin 89 FileList := TStringList.Create; 90 end; 91 92 procedure TFormBrowse.FormDestroy(Sender: TObject); 93 begin 94 FileList.Free; 95 end; 96 85 97 procedure TFormBrowse.ReloadList; 86 98 var 87 99 FindFile: TFindFile; 100 FoundFileList: TStrings; 88 101 I: Integer; 89 102 begin 90 FindFile := TFindFile.Create(nil); 91 FindFile.Path := Directory; 92 FindFile.FileMask := AllFilesMask; 93 FindFile.InSubFolders := False; 94 FileList := FindFile.SearchForFiles; 95 for I := FileList.Count - 1 downto 0 do 96 if ExtractFileName(FileList[I]) = '.' then FileList.Delete(I); 97 FileList.Sort; 98 ListView1.Items.Count := FileList.Count; 103 if DirectoryExistsUTF8(Directory) then begin 104 FindFile := TFindFile.Create(nil); 105 try 106 FindFile.Path := Directory; 107 FindFile.FileMask := AllFilesMask; 108 FindFile.InSubFolders := False; 109 FoundFileList := FindFile.SearchForFiles; 110 FileList.Assign(FoundFileList); 111 for I := FileList.Count - 1 downto 0 do 112 if ExtractFileName(FileList[I]) = '.' then FileList.Delete(I); 113 FileList.Sort; 114 ListView1.Items.Count := FileList.Count; 115 finally 116 FindFile.Free; 117 end; 118 end else ListView1.Items.Count := 0; 99 119 ListView1.Refresh; 100 120 end; -
trunk/Forms/UFormConsole.lfm
r6 r8 39 39 object EditCommand: TEdit 40 40 Left = 4 41 Height = 3 241 Height = 35 42 42 Top = 7 43 43 Width = 884 -
trunk/Forms/UFormConsole.pas
r6 r8 92 92 Line: string; 93 93 CommandLine: string; 94 I: Integer; 94 95 begin 95 96 Text := ''; … … 104 105 Process.Environment.Text := Environment; 105 106 Environment := ''; 106 //Process.Executable := Executable; 107 //Process.Parameters.Assign(Parameters); 108 Process.CommandLine := Executable + ' ' + Parameters.Text; 107 Process.Executable := Executable; 108 Process.Parameters.Assign(Parameters); 109 //for I := 0 to Process.Parameters.Count - 1 do 110 // ShowMessage('"' + Process.Parameters[I] + '"'); 111 //Process.CommandLine := Executable + ' checkout http://svn.zdechov.net/svn/xtactics /home/chronos/Smazat/svn3'; 112 //Process.Parameters.Clear; 113 //Process.Parameters.Add('checkout'); 114 //Process.Parameters.Add('http://svn.zdechov.net/svn/xtactics'); 115 //Process.Parameters.Add('/home/chronos/Smazat/svn3'); 116 //Process.Parameters.Add('checkout'); 117 //Process.Parameters.Add('dasd');; 118 //Process.CommandLine := Executable + ' ' + Parameters.Text; 109 119 CommandLine := Executable + ' ' + StringReplace(Parameters.Text, LineEnding, ' ', [rfReplaceAll]); 110 120 if CommandLine[Length(CommandLine)] = LineEnding then -
trunk/Forms/UFormMain.lfm
r6 r8 5 5 Width = 667 6 6 Caption = 'VCSCommander' 7 ClientHeight = 4 717 ClientHeight = 468 8 8 ClientWidth = 667 9 9 Menu = MainMenu1 … … 25 25 object StatusBar1: TStatusBar 26 26 Left = 0 27 Height = 2 628 Top = 4 4527 Height = 29 28 Top = 439 29 29 Width = 667 30 30 Panels = <> … … 35 35 object MenuItemFile: TMenuItem 36 36 Caption = 'File' 37 object MenuItem17: TMenuItem 38 Action = Core.AProjectCheckout 39 end 37 40 object MenuItem8: TMenuItem 38 41 Action = Core.AProjectOpen … … 68 71 Action = Core.ACommandCleanup 69 72 end 70 object MenuItem15: TMenuItem71 Action = Core.ACommandCheckout72 end73 73 object MenuItem16: TMenuItem 74 74 Action = Core.ACommandStatus -
trunk/Forms/UFormMain.pas
r6 r8 21 21 MenuItem13: TMenuItem; 22 22 MenuItem14: TMenuItem; 23 MenuItem15: TMenuItem;24 23 MenuItem16: TMenuItem; 24 MenuItem17: TMenuItem; 25 25 MenuItemOpenRecent: TMenuItem; 26 26 MenuItem2: TMenuItem; -
trunk/UCore.lfm
r7 r8 3 3 OnDestroy = DataModuleDestroy 4 4 OldCreateOrder = False 5 Height = 3466 HorizontalOffset = 4827 VerticalOffset = 2658 Width = 4475 Height = 435 6 HorizontalOffset = 539 7 VerticalOffset = 195 8 Width = 693 9 9 object ActionList1: TActionList 10 10 left = 260 … … 45 45 OnExecute = ACommandCleanupExecute 46 46 end 47 object ACommandCheckout: TAction48 Caption = 'Checkout'49 OnExecute = ACommandCheckoutExecute50 end51 47 object ACommandCommit: TAction 52 48 Caption = 'Commit' … … 56 52 Caption = 'Status' 57 53 end 58 object Action1: TAction 59 Caption = 'Action1' 54 object AProjectCheckout: TAction 55 Caption = 'Checkout...' 56 OnExecute = AProjectCheckoutExecute 60 57 end 61 58 end … … 81 78 top = 168 82 79 end 80 object LastOpenedListRepoURL: TLastOpenedList 81 MaxCount = 10 82 left = 96 83 top = 240 84 end 85 object LastOpenedListNewDir: TLastOpenedList 86 MaxCount = 10 87 left = 465 88 top = 302 89 end 83 90 end -
trunk/UCore.pas
r7 r8 17 17 ACommandUpdate: TAction; 18 18 ACommandCleanup: TAction; 19 ACommandCheckout: TAction;20 19 ACommandCommit: TAction; 21 20 ACommandStatus: TAction; 22 A ction1: TAction;21 AProjectCheckout: TAction; 23 22 AProjectClose: TAction; 24 23 ActionList1: TActionList; … … 30 29 ImageList1: TImageList; 31 30 LastOpenedList1: TLastOpenedList; 31 LastOpenedListNewDir: TLastOpenedList; 32 LastOpenedListRepoURL: TLastOpenedList; 32 33 OpenDialog1: TOpenDialog; 33 34 XMLConfig1: TXMLConfig; … … 36 37 procedure ACommandCommitExecute(Sender: TObject); 37 38 procedure ACommandUpdateExecute(Sender: TObject); 39 procedure AProjectCheckoutExecute(Sender: TObject); 38 40 procedure AProjectCloseExecute(Sender: TObject); 39 41 procedure AProjectOpenExecute(Sender: TObject); … … 62 64 63 65 uses 64 UFormMain, UFormBrowse, UFormSettings, UFormCommit ;66 UFormMain, UFormBrowse, UFormSettings, UFormCommit, UFormCheckout; 65 67 66 68 { TCore } … … 100 102 begin 101 103 LastOpenedList1.LoadFromXMLConfig(XMLConfig1, 'LastOpenedProjects'); 104 LastOpenedListRepoURL.LoadFromXMLConfig(XMLConfig1, 'LastOpenedRepoURL'); 105 LastOpenedListNewDir.LoadFromXMLConfig(XMLConfig1, 'LastOpenedNewDir'); 102 106 end; 103 107 … … 105 109 begin 106 110 LastOpenedList1.SaveToXMLConfig(XMLConfig1, 'LastOpenedProjects'); 111 LastOpenedListRepoURL.SaveToXMLConfig(XMLConfig1, 'LastOpenedRepoURL'); 112 LastOpenedListNewDir.SaveToXMLConfig(XMLConfig1, 'LastOpenedNewDir'); 107 113 end; 108 114 … … 146 152 begin 147 153 FreeAndNil(Project); 154 FormBrowse.Directory := ''; 155 FormBrowse.ReloadList; 148 156 UpdateInterface; 149 157 end; … … 154 162 end; 155 163 164 procedure TCore.AProjectCheckoutExecute(Sender: TObject); 165 var 166 TempProject: TProject; 167 begin 168 if LastOpenedListRepoURL.Items.Count > 0 then 169 FormCheckout.EditURL.Text := LastOpenedListRepoURL.Items[0]; 170 if LastOpenedListNewDir.Items.Count > 0 then 171 FormCheckout.EditDir.Text := LastOpenedListNewDir.Items[0]; 172 if FormCheckout.ShowModal = mrOk then begin 173 LastOpenedListRepoURL.AddItem(FormCheckout.EditURL.Text); 174 LastOpenedListNewDir.AddItem(FormCheckout.EditDir.Text); 175 TempProject := TProject.Create; 176 try 177 TempProject.VCSType := vtSubversion; 178 TempProject.Directory := FormCheckout.EditDir.Text; 179 TempProject.RepositoryURL := FormCheckout.EditURL.Text; 180 TempProject.WorkingCopy.Checkout; 181 finally 182 TempProject.Free; 183 end; 184 ProjectOpen(FormCheckout.EditDir.Text); 185 end; 186 end; 187 156 188 procedure TCore.ACommandCleanupExecute(Sender: TObject); 157 189 begin 158 Project.WorkingCopy.Clean Up;190 Project.WorkingCopy.Cleanup; 159 191 end; 160 192 161 193 procedure TCore.ACommandCheckoutExecute(Sender: TObject); 162 194 begin 163 Project.WorkingCopy.Checkout; 195 164 196 end; 165 197 -
trunk/Units/UProject.pas
r4 r8 18 18 FVCSType: TVCSType; 19 19 function GetDirectory: string; 20 function GetRepositoryURL: string; 20 21 procedure SetDirectory(AValue: string); 22 procedure SetRepositoryURL(AValue: string); 21 23 procedure SetVCSType(AValue: TVCSType); 22 24 public … … 27 29 property VCSType: TVCSType read FVCSType write SetVCSType; 28 30 property Directory: string read GetDirectory write SetDirectory; 31 property RepositoryURL: string read GetRepositoryURL write SetRepositoryURL; 29 32 end; 30 33 … … 41 44 if FVCSType = AValue then Exit; 42 45 FVCSType := AValue; 43 WorkingCopy.Free;46 FreeAndNil(WorkingCopy); 44 47 case AValue of 45 48 vtSubversion: WorkingCopy := TSubversion.Create; … … 53 56 end; 54 57 58 function TProject.GetRepositoryURL: string; 59 begin 60 Result := WorkingCopy.RepositoryURL; 61 end; 62 55 63 procedure TProject.SetDirectory(AValue: string); 56 64 begin 57 65 WorkingCopy.Path := AValue; 66 end; 67 68 procedure TProject.SetRepositoryURL(AValue: string); 69 begin 70 WorkingCopy.RepositoryURL := AValue; 58 71 end; 59 72 -
trunk/Units/USubversion.pas
r7 r8 35 35 try 36 36 Params.AddStrings(Parameters); 37 ExecuteProcess(' svn', Params);37 ExecuteProcess('/usr/bin/svn', Params); 38 38 finally 39 39 Params.Free; … … 43 43 procedure TSubversion.Checkout; 44 44 begin 45 Execute(['checkout' ]);45 Execute(['checkout', RepositoryURL, Path]); 46 46 end; 47 47 -
trunk/Units/UVCS.pas
r7 r8 6 6 7 7 uses 8 Classes, SysUtils ;8 Classes, SysUtils, FileUtil; 9 9 10 10 type … … 15 15 private 16 16 FPath: string; 17 FRepositoryURL: string; 17 18 procedure SetPath(AValue: string); 19 procedure SetRepositoryURL(AValue: string); 18 20 protected 19 21 procedure ExecuteProcess(Command: string; Parameters: TStrings); virtual; … … 26 28 procedure Merge; virtual; 27 29 procedure Refresh; virtual; 30 property RepositoryURL: string read FRepositoryURL write SetRepositoryURL; 28 31 property Path: string read FPath write SetPath; 29 32 end; … … 48 51 end; 49 52 53 procedure TWorkingCopy.SetRepositoryURL(AValue: string); 54 begin 55 if FRepositoryURL=AValue then Exit; 56 FRepositoryURL:=AValue; 57 end; 58 50 59 procedure TWorkingCopy.ExecuteProcess(Command: string; Parameters: TStrings); 51 60 begin 52 61 FormConsole.Executable := Command; 53 62 FormConsole.Parameters.Assign(Parameters); 54 FormConsole.WorkingDir := Path; 63 if DirectoryExistsUTF8(Path) then FormConsole.WorkingDir := Path 64 else FormConsole.WorkingDir := ''; 55 65 FormConsole.ShowModal; 56 66 end; -
trunk/VCSCommander.lpi
r7 r8 83 83 </Item4> 84 84 </RequiredPackages> 85 <Units Count="1 1">85 <Units Count="12"> 86 86 <Unit0> 87 87 <Filename Value="VCSCommander.lpr"/> … … 149 149 <ResourceBaseClass Value="Form"/> 150 150 </Unit10> 151 <Unit11> 152 <Filename Value="Forms/UFormCheckout.pas"/> 153 <IsPartOfProject Value="True"/> 154 <ComponentName Value="FormCheckout"/> 155 <HasResources Value="True"/> 156 <ResourceBaseClass Value="Form"/> 157 </Unit11> 151 158 </Units> 152 159 </ProjectOptions> … … 165 172 <SyntaxMode Value="Delphi"/> 166 173 <CStyleOperator Value="False"/> 174 <IncludeAssertionCode Value="True"/> 167 175 <AllowLabel Value="False"/> 168 176 <CPPInline Value="False"/> … … 176 184 <StackChecks Value="True"/> 177 185 </Checks> 186 <VerifyObjMethodCallValidity Value="True"/> 178 187 </CodeGeneration> 179 188 <Linking> … … 187 196 </Options> 188 197 </Linking> 198 <Other> 199 <CustomOptions Value="-dDEBUG"/> 200 </Other> 189 201 </CompilerOptions> 190 202 <Debugging> -
trunk/VCSCommander.lpr
r7 r8 9 9 Interfaces, // this includes the LCL widgetset 10 10 Forms, UFormMain, UCore, Common, TemplateGenerics, UFormBrowse, UVCS, 11 UFormFavorites, UFormSettings, UFormConsole, USubversion, UProject, 12 UFormCommit11 UFormFavorites, UFormSettings, UFormConsole, USubversion, UProject, SysUtils, 12 UFormCommit, UFormCheckout 13 13 { you can add units after this }; 14 14 15 15 {$R *.res} 16 16 17 {$IFDEF DEBUG} 18 const 19 HeapTraceLog = 'heaptrclog.trc'; 20 {$ENDIF} 21 22 17 23 begin 24 {$IFDEF DEBUG} 25 // Heap trace 26 DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 27 SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 28 {$ENDIF} 29 18 30 RequireDerivedFormResource := True; 19 31 Application.Initialize; … … 25 37 Application.CreateForm(TFormConsole, FormConsole); 26 38 Application.CreateForm(TFormCommit, FormCommit); 39 Application.CreateForm(TFormCheckout, FormCheckout); 27 40 Application.Run; 28 41 end.
Note:
See TracChangeset
for help on using the changeset viewer.