- Timestamp:
- May 19, 2015, 11:33:02 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Backends/Subversion/USubversion.pas
r10 r11 31 31 procedure Merge; override; 32 32 procedure Add(FileName: string); override; 33 procedure GetLog(FileName: string; Log: TLogList); override; 33 34 end; 34 35 … … 91 92 end; 92 93 94 procedure TSubversion.GetLog(FileName: string; Log: TLogList); 95 var 96 NewItem: TLogItem; 97 I: Integer; 98 Line: string; 99 ChangedFiles: Boolean; 100 Action: string; 101 begin 102 NewItem := nil; 103 Log.Clear; 104 Execute(['log', FileName, '-v']); 105 for I := 0 to ExecutionOutput.Count - 1 do begin 106 Line := Trim(ExecutionOutput[I]); 107 if Line = '------------------------------------------------------------------------' then begin 108 if Assigned(NewItem) then Log.Add(NewItem); 109 NewItem := TLogItem.Create; 110 end else 111 if Pos('|', Line) > 0 then begin 112 NewItem.Revision := Trim(GetNext(Line, '|')); 113 NewItem.Author := Trim(GetNext(Line, '|')); 114 GetNext(Line, '|'); 115 //NewItem.Time := StrToDateTime(Trim(GetNext(Line, '|'))); 116 end else 117 if Line = 'Changed paths:' then begin 118 ChangedFiles := True; 119 end else 120 if ChangedFiles then begin 121 if (Line <> '') and (Copy(ExecutionOutput[I], 1, 3) = ' ') then begin 122 Action := GetNext(Line, ' '); 123 NewItem.Actions := NewItem.Actions + Action; 124 NewItem.ChangedFiles.Add(Line); 125 end else 126 if Line = '' then begin 127 ChangedFiles := False; 128 end; 129 end else 130 NewItem.Messages.Add(Line); 131 end; 132 if Assigned(NewItem) then Log.Add(NewItem); 133 end; 134 93 135 end. 94 136 -
trunk/Forms/UFormBrowse.lfm
r10 r11 9 9 OnCreate = FormCreate 10 10 OnDestroy = FormDestroy 11 OnShow = FormShow 11 12 LCLVersion = '1.5' 12 13 object TreeView1: TTreeView … … 61 62 OnData = ListView1Data 62 63 OnDblClick = AOpenExecute 64 OnSelectItem = ListView1SelectItem 63 65 end 64 66 object PopupMenu1: TPopupMenu … … 83 85 object MenuItem6: TMenuItem 84 86 Action = AOpen 87 end 88 object MenuItem7: TMenuItem 89 Action = ALogShow 85 90 end 86 91 end … … 111 116 OnExecute = AOpenExecute 112 117 end 118 object ALogShow: TAction 119 Caption = 'Show log' 120 OnExecute = ALogShowExecute 121 end 113 122 end 114 123 end -
trunk/Forms/UFormBrowse.pas
r10 r11 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 9 ExtCtrls, Menus, ActnList, UFindFile ;9 ExtCtrls, Menus, ActnList, UFindFile, UVCS; 10 10 11 11 type … … 15 15 TFormBrowse = class(TForm) 16 16 AAdd: TAction; 17 ALogShow: TAction; 17 18 AOpen: TAction; 18 19 AProperties: TAction; … … 28 29 MenuItem5: TMenuItem; 29 30 MenuItem6: TMenuItem; 31 MenuItem7: TMenuItem; 30 32 PopupMenu1: TPopupMenu; 31 33 Splitter1: TSplitter; … … 33 35 procedure AAddExecute(Sender: TObject); 34 36 procedure ADeleteExecute(Sender: TObject); 37 procedure ALogShowExecute(Sender: TObject); 35 38 procedure AOpenExecute(Sender: TObject); 36 39 procedure ARenameExecute(Sender: TObject); 37 40 procedure FormCreate(Sender: TObject); 38 41 procedure FormDestroy(Sender: TObject); 42 procedure FormShow(Sender: TObject); 39 43 procedure ListView1Data(Sender: TObject; Item: TListItem); 40 44 procedure ListView1DblClick(Sender: TObject); 45 procedure ListView1SelectItem(Sender: TObject; Item: TListItem; 46 Selected: Boolean); 41 47 private 42 48 FileList: TStringList; … … 53 59 54 60 uses 55 UCore ;61 UCore, UFormLog; 56 62 57 63 {$R *.lfm} … … 71 77 end; 72 78 79 procedure TFormBrowse.ListView1SelectItem(Sender: TObject; Item: TListItem; 80 Selected: Boolean); 81 begin 82 UpdateInterface; 83 end; 84 73 85 procedure TFormBrowse.ADeleteExecute(Sender: TObject); 74 86 begin 75 87 88 end; 89 90 procedure TFormBrowse.ALogShowExecute(Sender: TObject); 91 begin 92 FormLog.FileName := Directory + DirectorySeparator + ListView1.Selected.Caption; 93 FormLog.ShowModal; 76 94 end; 77 95 … … 114 132 end; 115 133 134 procedure TFormBrowse.FormShow(Sender: TObject); 135 begin 136 UpdateInterface; 137 end; 138 116 139 procedure TFormBrowse.ReloadList; 117 140 var … … 145 168 ARename.Enabled := Assigned(ListView1.Selected); 146 169 AProperties.Enabled := Assigned(ListView1.Selected); 170 AOpen.Enabled := Assigned(ListView1.Selected); 171 ALogShow.Enabled := Assigned(ListView1.Selected); 147 172 end; 148 173 -
trunk/UCore.lfm
r8 r11 4 4 OldCreateOrder = False 5 5 Height = 435 6 HorizontalOffset = 5397 VerticalOffset = 1956 HorizontalOffset = 695 7 VerticalOffset = 306 8 8 Width = 693 9 9 object ActionList1: TActionList -
trunk/Units/UVCS.pas
r10 r11 6 6 7 7 uses 8 Classes, SysUtils, FileUtil ;8 Classes, SysUtils, FileUtil, Contnrs; 9 9 10 10 type 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; 11 28 12 29 { TWorkingCopy } … … 20 37 protected 21 38 procedure ExecuteProcess(Command: string; Parameters: array of string); virtual; 39 function GetNext(var Text: string; Separator: string): string; 22 40 public 41 ExecutionOutput: TStringList; 23 42 procedure Checkout; virtual; 24 43 procedure Update; virtual; … … 29 48 procedure Refresh; virtual; 30 49 procedure Add(FileName: string); virtual; 50 procedure GetLog(FileName: string; Log: TLogList); virtual; 51 constructor Create; 52 destructor Destroy; override; 31 53 property RepositoryURL: string read FRepositoryURL write SetRepositoryURL; 32 54 property Path: string read FPath write SetPath; … … 43 65 uses 44 66 UFormConsole; 67 68 { TLogItem } 69 70 constructor TLogItem.Create; 71 begin 72 Messages := TStringList.Create; 73 ChangedFiles := TStringList.Create; 74 end; 75 76 destructor TLogItem.Destroy; 77 begin 78 Messages.Free; 79 ChangedFiles.Free; 80 inherited Destroy; 81 end; 45 82 46 83 { TWorkingCopy } … … 67 104 else FormConsole.WorkingDir := ''; 68 105 FormConsole.ShowModal; 106 ExecutionOutput.Assign(FormConsole.Log); 107 end; 108 109 function TWorkingCopy.GetNext(var Text: string; Separator: string): string; 110 begin 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; 69 118 end; 70 119 … … 109 158 end; 110 159 160 procedure TWorkingCopy.GetLog(FileName: string; Log: TLogList); 161 begin 162 Log.Clear; 163 end; 164 165 constructor TWorkingCopy.Create; 166 begin 167 ExecutionOutput := TStringList.Create; 168 FPath := ''; 169 FRepositoryURL := ''; 170 end; 171 172 destructor TWorkingCopy.Destroy; 173 begin 174 FreeAndNil(ExecutionOutput); 175 inherited Destroy; 176 end; 177 111 178 end. 112 179 -
trunk/VCSCommander.lpi
r10 r11 84 84 </Item4> 85 85 </RequiredPackages> 86 <Units Count="1 5">86 <Units Count="16"> 87 87 <Unit0> 88 88 <Filename Value="VCSCommander.lpr"/> … … 169 169 <IsPartOfProject Value="True"/> 170 170 </Unit14> 171 <Unit15> 172 <Filename Value="Forms/UFormLog.pas"/> 173 <IsPartOfProject Value="True"/> 174 <ComponentName Value="FormLog"/> 175 <HasResources Value="True"/> 176 <ResourceBaseClass Value="Form"/> 177 </Unit15> 171 178 </Units> 172 179 </ProjectOptions> -
trunk/VCSCommander.lpr
r9 r11 10 10 Forms, UFormMain, UCore, Common, TemplateGenerics, UFormBrowse, UVCS, 11 11 UFormFavorites, UFormSettings, UFormConsole, USubversion, UProject, SysUtils, 12 UFormCommit, UFormCheckout, UBazaar, UBackend 12 UFormCommit, UFormCheckout, UBazaar, UBackend, UFormLog 13 13 { you can add units after this }; 14 14 … … 38 38 Application.CreateForm(TFormCommit, FormCommit); 39 39 Application.CreateForm(TFormCheckout, FormCheckout); 40 Application.CreateForm(TFormLog, FormLog); 40 41 Application.Run; 41 42 end.
Note:
See TracChangeset
for help on using the changeset viewer.