Changeset 23 for trunk/Units/VCS.pas
- Timestamp:
- Apr 4, 2025, 9:22:05 AM (2 weeks ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Units/VCS.pas
r22 r23 1 unit UVCS;1 unit VCS; 2 2 3 3 interface 4 4 5 5 uses 6 Classes, SysUtils, LazFileUtils, Contnrs;6 Classes, SysUtils, LazFileUtils, Generics.Collections; 7 7 8 8 type … … 21 21 end; 22 22 23 TLogList = class(TObjectList) 24 23 TLogList = class(TObjectList<TLogItem>) 25 24 end; 26 25 … … 40 39 { TFileStatusList } 41 40 42 TFileStatusList = class(TObjectList )41 TFileStatusList = class(TObjectList<TFileStatus>) 43 42 function SearchByName(Name: string): TFileStatus; 44 43 end; … … 102 101 103 102 uses 104 UFormConsole;103 FormConsole; 105 104 106 105 function URLFromDirectory(DirName: string; Relative: Boolean): string; … … 138 137 procedure TRepository.ExecuteProcess(Command: string; 139 138 Parameters: array of string); 140 begin 141 FormConsole.Executable := Command; 142 FormConsole.Parameters.Clear; 143 FormConsole.Parameters.AddStrings(Parameters); 144 if DirectoryExistsUTF8(Path) then FormConsole.WorkingDir := Path 145 else FormConsole.WorkingDir := ''; 146 FormConsole.ShowModal; 147 ExecutionOutput.Assign(FormConsole.Log); 139 var 140 FormConsole: TFormConsole; 141 begin 142 FormConsole := TFormConsole.Create(nil); 143 try 144 FormConsole.Executable := Command; 145 FormConsole.Parameters.Clear; 146 FormConsole.Parameters.AddStrings(Parameters); 147 if DirectoryExistsUTF8(Path) then FormConsole.WorkingDir := Path 148 else FormConsole.WorkingDir := ''; 149 FormConsole.ShowModal; 150 ExecutionOutput.Assign(FormConsole.Log); 151 finally 152 FormConsole.Free; 153 end; 148 154 end; 149 155 … … 162 168 begin 163 169 FreeAndNil(ExecutionOutput); 164 inherited Destroy;170 inherited; 165 171 end; 166 172 … … 175 181 destructor TLogItem.Destroy; 176 182 begin 177 Messages.Free;178 ChangedFiles.Free;179 inherited Destroy;183 FreeAndNil(Messages); 184 FreeAndNil(ChangedFiles); 185 inherited; 180 186 end; 181 187 … … 191 197 procedure TWorkingCopy.SetRepositoryURL(AValue: string); 192 198 begin 193 if FRepositoryURL =AValue then Exit;194 FRepositoryURL :=AValue;199 if FRepositoryURL = AValue then Exit; 200 FRepositoryURL := AValue; 195 201 end; 196 202 197 203 procedure TWorkingCopy.ExecuteProcess(Command: string; Parameters: array of string); 198 begin 199 FormConsole.Executable := Command; 200 FormConsole.EnvironmentVariables.Assign(EnvVars); 201 FormConsole.Parameters.Clear; 202 FormConsole.Parameters.AddStrings(Parameters); 203 if DirectoryExistsUTF8(Path) then FormConsole.WorkingDir := Path 204 else FormConsole.WorkingDir := ''; 205 if SilentExecution then FormConsole.Perform 206 else FormConsole.ShowModal; 207 ExecutionOutput.Assign(FormConsole.Log); 204 var 205 FormConsole: TFormConsole; 206 begin 207 FormConsole := TFormConsole.Create(nil); 208 try 209 FormConsole.Executable := Command; 210 FormConsole.EnvironmentVariables.Assign(EnvVars); 211 FormConsole.Parameters.Clear; 212 FormConsole.Parameters.AddStrings(Parameters); 213 if DirectoryExistsUTF8(Path) then FormConsole.WorkingDir := Path 214 else FormConsole.WorkingDir := ''; 215 if SilentExecution then FormConsole.Perform 216 else FormConsole.ShowModal; 217 ExecutionOutput.Assign(FormConsole.Log); 218 finally 219 FormConsole.Free; 220 end; 208 221 end; 209 222 … … 286 299 FreeAndNil(EnvVars); 287 300 FreeAndNil(ExecutionOutput); 288 inherited Destroy;301 inherited; 289 302 end; 290 303
Note:
See TracChangeset
for help on using the changeset viewer.