Changeset 11 for trunk/Units/UVCS.pas


Ignore:
Timestamp:
May 19, 2015, 11:33:02 PM (9 years ago)
Author:
chronos
Message:
  • Added: Log form to show history of object. Implemented for Subversion partialy.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Units/UVCS.pas

    r10 r11  
    66
    77uses
    8   Classes, SysUtils, FileUtil;
     8  Classes, SysUtils, FileUtil, Contnrs;
    99
    1010type
     11
     12  { TLogItem }
     13
     14  TLogItem = class
     15    Author: string;
     16    Actions: string;
     17    Time: TDateTime;
     18    Revision: string;
     19    Messages: TStringList;
     20    ChangedFiles: TStringList;
     21    constructor Create;
     22    destructor Destroy; override;
     23  end;
     24
     25  TLogList = class(TObjectList)
     26
     27  end;
    1128
    1229  { TWorkingCopy }
     
    2037  protected
    2138    procedure ExecuteProcess(Command: string; Parameters: array of string); virtual;
     39    function GetNext(var Text: string; Separator: string): string;
    2240  public
     41    ExecutionOutput: TStringList;
    2342    procedure Checkout; virtual;
    2443    procedure Update; virtual;
     
    2948    procedure Refresh; virtual;
    3049    procedure Add(FileName: string); virtual;
     50    procedure GetLog(FileName: string; Log: TLogList); virtual;
     51    constructor Create;
     52    destructor Destroy; override;
    3153    property RepositoryURL: string read FRepositoryURL write SetRepositoryURL;
    3254    property Path: string read FPath write SetPath;
     
    4365uses
    4466  UFormConsole;
     67
     68{ TLogItem }
     69
     70constructor TLogItem.Create;
     71begin
     72  Messages := TStringList.Create;
     73  ChangedFiles := TStringList.Create;
     74end;
     75
     76destructor TLogItem.Destroy;
     77begin
     78  Messages.Free;
     79  ChangedFiles.Free;
     80  inherited Destroy;
     81end;
    4582
    4683{ TWorkingCopy }
     
    67104    else FormConsole.WorkingDir := '';
    68105  FormConsole.ShowModal;
     106  ExecutionOutput.Assign(FormConsole.Log);
     107end;
     108
     109function TWorkingCopy.GetNext(var Text: string; Separator: string): string;
     110begin
     111  if Pos(Separator, Text) > 0 then begin
     112    Result := Copy(Text, 1, Pos(Separator, Text) - 1);
     113    Delete(Text, 1, Pos(Separator, Text) + Length(Separator));
     114  end else begin
     115    Result := Text;
     116    Text := '';
     117  end;
    69118end;
    70119
     
    109158end;
    110159
     160procedure TWorkingCopy.GetLog(FileName: string; Log: TLogList);
     161begin
     162  Log.Clear;
     163end;
     164
     165constructor TWorkingCopy.Create;
     166begin
     167  ExecutionOutput := TStringList.Create;
     168  FPath := '';
     169  FRepositoryURL := '';
     170end;
     171
     172destructor TWorkingCopy.Destroy;
     173begin
     174  FreeAndNil(ExecutionOutput);
     175  inherited Destroy;
     176end;
     177
    111178end.
    112179
Note: See TracChangeset for help on using the changeset viewer.