Changeset 9 for trunk/Units


Ignore:
Timestamp:
May 18, 2015, 11:49:39 PM (10 years ago)
Author:
chronos
Message:
  • Added: Simple Bazaar backend.\n* Added: Support for backends dynamic registration.\n* Added: Backend selection in checkout form.
Location:
trunk/Units
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Units/UProject.pas

    r8 r9  
    66
    77uses
    8   Classes, SysUtils, UVCS;
     8  Classes, SysUtils, UVCS, UBackend;
    99
    1010type
    11 
    12   TVCSType = (vtNone, vtSubversion, vtCVS, vtMercurial, vtBazaar, vzGit);
    1311
    1412{ TProject }
     
    1614  TProject = class
    1715  private
    18     FVCSType: TVCSType;
     16    FBackend: TBackend;
    1917    function GetDirectory: string;
    2018    function GetRepositoryURL: string;
    2119    procedure SetDirectory(AValue: string);
    2220    procedure SetRepositoryURL(AValue: string);
    23     procedure SetVCSType(AValue: TVCSType);
     21    procedure SetBackend(AValue: TBackend);
    2422  public
    2523    WorkingCopy: TWorkingCopy;
     
    2725    constructor Create;
    2826    destructor Destroy; override;
    29     property VCSType: TVCSType read FVCSType write SetVCSType;
     27    property Backend: TBackend read FBackend write SetBackend;
    3028    property Directory: string read GetDirectory write SetDirectory;
    3129    property RepositoryURL: string read GetRepositoryURL write SetRepositoryURL;
     
    4038{ TProject }
    4139
    42 procedure TProject.SetVCSType(AValue: TVCSType);
     40procedure TProject.SetBackend(AValue: TBackend);
    4341begin
    44   if FVCSType = AValue then Exit;
    45   FVCSType := AValue;
     42  if FBackend = AValue then Exit;
     43  FBackend := AValue;
    4644  FreeAndNil(WorkingCopy);
    47   case AValue of
    48     vtSubversion: WorkingCopy := TSubversion.Create;
    49     else WorkingCopy := TWorkingCopy.Create;
    50   end;
     45  WorkingCopy := AValue.WorkingCopyClass.Create;
    5146end;
    5247
  • trunk/Units/UVCS.pas

    r8 r9  
    1919    procedure SetRepositoryURL(AValue: string);
    2020  protected
    21     procedure ExecuteProcess(Command: string; Parameters: TStrings); virtual;
     21    procedure ExecuteProcess(Command: string; Parameters: array of string); virtual;
    2222  public
    2323    procedure Checkout; virtual;
     
    2525    procedure CleanUp; virtual;
    2626    procedure Commit(Message: TStrings); virtual;
    27     procedure Move; virtual;
     27    procedure Move(Source, Dest: string); virtual;
    2828    procedure Merge; virtual;
    2929    procedure Refresh; virtual;
     
    3535    Path: string;
    3636  end;
     37
    3738
    3839
     
    5758end;
    5859
    59 procedure TWorkingCopy.ExecuteProcess(Command: string; Parameters: TStrings);
     60procedure TWorkingCopy.ExecuteProcess(Command: string; Parameters: array of string);
    6061begin
    6162  FormConsole.Executable := Command;
    62   FormConsole.Parameters.Assign(Parameters);
     63  FormConsole.Parameters.Clear;
     64  FormConsole.Parameters.AddStrings(Parameters);
    6365  if DirectoryExistsUTF8(Path) then FormConsole.WorkingDir := Path
    6466    else FormConsole.WorkingDir := '';
     
    8688end;
    8789
    88 procedure TWorkingCopy.Move;
     90procedure TWorkingCopy.Move(Source, Dest: string);
    8991begin
    9092
Note: See TracChangeset for help on using the changeset viewer.