Changeset 8 for trunk/Units


Ignore:
Timestamp:
May 18, 2015, 12:15:30 AM (10 years ago)
Author:
chronos
Message:
  • Added: Checkout form and ability to checkout new working copy.
Location:
trunk/Units
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Units/UProject.pas

    r4 r8  
    1818    FVCSType: TVCSType;
    1919    function GetDirectory: string;
     20    function GetRepositoryURL: string;
    2021    procedure SetDirectory(AValue: string);
     22    procedure SetRepositoryURL(AValue: string);
    2123    procedure SetVCSType(AValue: TVCSType);
    2224  public
     
    2729    property VCSType: TVCSType read FVCSType write SetVCSType;
    2830    property Directory: string read GetDirectory write SetDirectory;
     31    property RepositoryURL: string read GetRepositoryURL write SetRepositoryURL;
    2932  end;
    3033
     
    4144  if FVCSType = AValue then Exit;
    4245  FVCSType := AValue;
    43   WorkingCopy.Free;
     46  FreeAndNil(WorkingCopy);
    4447  case AValue of
    4548    vtSubversion: WorkingCopy := TSubversion.Create;
     
    5356end;
    5457
     58function TProject.GetRepositoryURL: string;
     59begin
     60  Result := WorkingCopy.RepositoryURL;
     61end;
     62
    5563procedure TProject.SetDirectory(AValue: string);
    5664begin
    5765  WorkingCopy.Path := AValue;
     66end;
     67
     68procedure TProject.SetRepositoryURL(AValue: string);
     69begin
     70  WorkingCopy.RepositoryURL := AValue;
    5871end;
    5972
  • trunk/Units/USubversion.pas

    r7 r8  
    3535  try
    3636    Params.AddStrings(Parameters);
    37     ExecuteProcess('svn', Params);
     37    ExecuteProcess('/usr/bin/svn', Params);
    3838  finally
    3939    Params.Free;
     
    4343procedure TSubversion.Checkout;
    4444begin
    45   Execute(['checkout']);
     45  Execute(['checkout', RepositoryURL, Path]);
    4646end;
    4747
  • trunk/Units/UVCS.pas

    r7 r8  
    66
    77uses
    8   Classes, SysUtils;
     8  Classes, SysUtils, FileUtil;
    99
    1010type
     
    1515  private
    1616    FPath: string;
     17    FRepositoryURL: string;
    1718    procedure SetPath(AValue: string);
     19    procedure SetRepositoryURL(AValue: string);
    1820  protected
    1921    procedure ExecuteProcess(Command: string; Parameters: TStrings); virtual;
     
    2628    procedure Merge; virtual;
    2729    procedure Refresh; virtual;
     30    property RepositoryURL: string read FRepositoryURL write SetRepositoryURL;
    2831    property Path: string read FPath write SetPath;
    2932  end;
     
    4851end;
    4952
     53procedure TWorkingCopy.SetRepositoryURL(AValue: string);
     54begin
     55  if FRepositoryURL=AValue then Exit;
     56  FRepositoryURL:=AValue;
     57end;
     58
    5059procedure TWorkingCopy.ExecuteProcess(Command: string; Parameters: TStrings);
    5160begin
    5261  FormConsole.Executable := Command;
    5362  FormConsole.Parameters.Assign(Parameters);
    54   FormConsole.WorkingDir := Path;
     63  if DirectoryExistsUTF8(Path) then FormConsole.WorkingDir := Path
     64    else FormConsole.WorkingDir := '';
    5565  FormConsole.ShowModal;
    5666end;
Note: See TracChangeset for help on using the changeset viewer.