Changeset 8 for trunk/Units
- Timestamp:
- May 18, 2015, 12:15:30 AM (10 years ago)
- Location:
- trunk/Units
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note:
See TracChangeset
for help on using the changeset viewer.