Changeset 5


Ignore:
Timestamp:
Sep 1, 2014, 7:26:35 PM (10 years ago)
Author:
chronos
Message:
  • Added: Form for console window. Working copy actions will call command line tool to perform operation.
Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r4 r5  
    5050      end
    5151    end
     52    object MenuItem11: TMenuItem
     53      Caption = 'Actions'
     54      object MenuItem12: TMenuItem
     55        Action = Core.ACommandUpdate
     56      end
     57      object MenuItem13: TMenuItem
     58        Action = Core.ACommandCommit
     59      end
     60      object MenuItem14: TMenuItem
     61        Action = Core.ACommandCleanup
     62      end
     63      object MenuItem15: TMenuItem
     64        Action = Core.ACommandCheckout
     65      end
     66      object MenuItem16: TMenuItem
     67        Action = Core.ACommandStatus
     68      end
     69    end
    5270    object MenuItem1: TMenuItem
    5371      Caption = 'General'
  • trunk/Forms/UFormMain.pas

    r4 r5  
    1717    MenuItem1: TMenuItem;
    1818    MenuItem10: TMenuItem;
     19    MenuItem11: TMenuItem;
     20    MenuItem12: TMenuItem;
     21    MenuItem13: TMenuItem;
     22    MenuItem14: TMenuItem;
     23    MenuItem15: TMenuItem;
     24    MenuItem16: TMenuItem;
    1925    MenuItem2: TMenuItem;
    2026    MenuItem3: TMenuItem;
  • trunk/UCore.lfm

    r4 r5  
    3636      OnExecute = AProjectCloseExecute
    3737    end
     38    object ACommandUpdate: TAction
     39      Caption = 'Update'
     40      OnExecute = ACommandUpdateExecute
     41    end
     42    object ACommandCleanup: TAction
     43      Caption = 'Cleanup'
     44      OnExecute = ACommandCleanupExecute
     45    end
     46    object ACommandCheckout: TAction
     47      Caption = 'Checkout'
     48      OnExecute = ACommandCheckoutExecute
     49    end
     50    object ACommandCommit: TAction
     51      Caption = 'Commit'
     52      OnExecute = ACommandCommitExecute
     53    end
     54    object ACommandStatus: TAction
     55      Caption = 'Status'
     56    end
    3857  end
    3958  object ImageList1: TImageList
  • trunk/UCore.pas

    r4 r5  
    1515  TCore = class(TDataModule)
    1616    AAbout: TAction;
     17    ACommandUpdate: TAction;
     18    ACommandCleanup: TAction;
     19    ACommandCheckout: TAction;
     20    ACommandCommit: TAction;
     21    ACommandStatus: TAction;
    1722    AProjectClose: TAction;
    1823    ActionList1: TActionList;
     
    2429    ImageList1: TImageList;
    2530    OpenDialog1: TOpenDialog;
     31    procedure ACommandCheckoutExecute(Sender: TObject);
     32    procedure ACommandCleanupExecute(Sender: TObject);
     33    procedure ACommandCommitExecute(Sender: TObject);
     34    procedure ACommandUpdateExecute(Sender: TObject);
    2635    procedure AProjectCloseExecute(Sender: TObject);
    2736    procedure AProjectOpenExecute(Sender: TObject);
     
    8998end;
    9099
     100procedure TCore.ACommandUpdateExecute(Sender: TObject);
     101begin
     102  Project.WorkingCopy.Update;
     103end;
     104
     105procedure TCore.ACommandCleanupExecute(Sender: TObject);
     106begin
     107  Project.WorkingCopy.CleanUp;
     108end;
     109
     110procedure TCore.ACommandCheckoutExecute(Sender: TObject);
     111begin
     112  Project.WorkingCopy.Checkout;
     113end;
     114
     115procedure TCore.ACommandCommitExecute(Sender: TObject);
     116begin
     117  Project.WorkingCopy.Commit;
     118end;
     119
    91120end.
    92121
  • trunk/Units/USubversion.pas

    r4 r5  
    1313
    1414  TSubversion = class(TWorkingCopy)
     15  protected
     16    procedure Execute(Command: string); override;
     17  public
    1518    procedure Checkout; override;
    1619    procedure Update; override;
     
    2528{ TSubversion }
    2629
     30procedure TSubversion.Execute(Command: string);
     31begin
     32  inherited Execute('svn ' + Command);
     33end;
     34
    2735procedure TSubversion.Checkout;
    2836begin
    29 
     37  Execute('checkout');
    3038end;
    3139
    3240procedure TSubversion.Update;
    3341begin
    34 
     42  Execute('update');
    3543end;
    3644
    3745procedure TSubversion.CleanUp;
    3846begin
    39 
     47  Execute('cleanup');
    4048end;
    4149
    4250procedure TSubversion.Commit;
    4351begin
    44 
     52  Execute('commit');
    4553end;
    4654
    4755procedure TSubversion.Move;
    4856begin
    49 
     57  Execute('move');
    5058end;
    5159
    5260procedure TSubversion.Merge;
    5361begin
    54 
     62  Execute('merge');
    5563end;
    5664
  • trunk/Units/UVCS.pas

    r4 r5  
    1616    FPath: string;
    1717    procedure SetPath(AValue: string);
     18  protected
     19    procedure Execute(Command: string); virtual;
    1820  public
    1921    procedure Checkout; virtual;
     
    3436implementation
    3537
     38uses
     39  UFormConsole;
    3640
    3741{ TWorkingCopy }
     
    3943procedure TWorkingCopy.SetPath(AValue: string);
    4044begin
    41   if FPath=AValue then Exit;
     45  if FPath = AValue then Exit;
    4246  FPath := AValue;
    4347  Refresh;
     48end;
     49
     50procedure TWorkingCopy.Execute(Command: string);
     51begin
     52  FormConsole.Executable := 'svn';
     53  FormConsole.Parameters.Add(Command);
     54  FormConsole.WorkingDir := Path;
     55  FormConsole.Perform;
    4456end;
    4557
  • trunk/VCSCommander.lpi

    r4 r5  
    7272      </Item1>
    7373    </RequiredPackages>
    74     <Units Count="9">
     74    <Units Count="10">
    7575      <Unit0>
    7676        <Filename Value="VCSCommander.lpr"/>
     
    132132        <UnitName Value="UProject"/>
    133133      </Unit8>
     134      <Unit9>
     135        <Filename Value="Forms/UFormConsole.pas"/>
     136        <IsPartOfProject Value="True"/>
     137        <ComponentName Value="FormConsole"/>
     138        <HasResources Value="True"/>
     139        <ResourceBaseClass Value="Form"/>
     140        <UnitName Value="UFormConsole"/>
     141      </Unit9>
    134142    </Units>
    135143  </ProjectOptions>
  • trunk/VCSCommander.lpr

    r4 r5  
    99  Interfaces, // this includes the LCL widgetset
    1010  Forms, UFormMain, UCore, UFormBrowse, UVCS, UFormFavorites, UFormSettings,
    11   USubversion, UProject
     11  UFormConsole, USubversion, UProject
    1212  { you can add units after this };
    1313
Note: See TracChangeset for help on using the changeset viewer.