-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathudCheckout.pas
102 lines (89 loc) · 2.92 KB
/
udCheckout.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
unit udCheckout;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TdCheckout = class(TForm)
btnGo: TButton;
lblTaskName: TLabel;
edtTask: TComboBox;
lblTask: TLabel;
rgCheckout: TRadioGroup;
procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure FormShow(Sender: TObject);
procedure edtTaskChange(Sender: TObject);
procedure btnGoClick(Sender: TObject);
private
fTask : string;
public
property Task : string write fTask;
end;
implementation
uses uuGlobals, uuTask;
{$R *.dfm}
procedure TdCheckout.btnGoClick(Sender: TObject);
var
StartInfo: TStartupInfo;
ProcInfo: TProcessInformation;
procHandle : THandle;
lLogMessage : string;
lCommandToRun : string;
const
NEXUS_REPOS = 'https://rdsvn/svn/rd/SMS/branches/NexusDB';
TRUNK_REPOS = 'https://rdsvn/svn/rd/SMS/trunk';
procedure RunCommandAndWait(aCommand : String);
begin
CreateProcess(PChar(CmdLine),PChar(aCommand),Nil,Nil,False,CREATE_NO_WINDOW,nil,nil,StartInfo,ProcInfo);
procHandle:= ProcInfo.hProcess;
WaitForSingleObject(procHandle, INFINITE);
end;
begin
//lLogMessage := '"[' + lVersion + ']' + ' ' + edtTask.Text + ' ' + lblTaskName.Caption + '"';
// CmdLine := 'C:\\windows\\system32\\cmd.exe';
// //Copy mainstream to version folder
// if rgCheckout.ItemIndex = 0 then
// begin
// lCommandToRun := '/C TortoiseProc.exe /command:copy /path:"' + TRUNK_REPOS + '" /url:"' + gSettings.ReposDir + edtTask.Text + '"';
// RunCommandAndWait(lCommandToRun);
// end
// else if rgCheckout.ItemIndex = 1 then
// begin
// lCommandToRun := '/C TortoiseProc.exe /command:copy /path:"' + NEXUS_REPOS + '" /url:"' + gSettings.ReposDir + edtTask.Text + '"';
// RunCommandAndWait(lCommandToRun);
// end;
//
// lCommandToRun := '/C TortoiseProc.exe /command:checkout /path:"' + gSettings.BranchDir + '\' + edtTask.Text + '" /url:"' + gSettings.ReposDir + edtTask.Text + '"';
// RunCommandAndWait(lCommandToRun);
ShowMessage('...coming soon');
ModalResult := mrOk;
end;
procedure TdCheckout.edtTaskChange(Sender: TObject);
begin
TaskChange(edtTask, lblTaskName);
end;
procedure TdCheckout.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if Key = VK_ESCAPE then
Close;
end;
procedure TdCheckout.FormShow(Sender: TObject);
begin
if gSettings.ReposDir = '' then
begin
ShowMessage('Set your Branch Repositry Directory in Settings.' + ^M + 'e.g. https://rdsvn/svn/rd/SMS/branches/DCL/');
Close;
end
else if gSettings.BranchDir = '' then
begin
ShowMessage('Set your SMS Branch Directory in Settings');
Close;
end
else
begin
edtTask.Text := fTask;
edtTaskChange(self);
end;
end;
end.