| src/IDF/Scm/Git.php |
| 28 | 28 | class IDF_Scm_Git extends IDF_Scm |
| 29 | 29 | { |
| 30 | 30 | public $mediumtree_fmt = 'commit %H%nAuthor: %an <%ae>%nTree: %T%nDate: %ai%n%n%s%n%n%b'; |
| 31 | public $date_fmt = |
| 31 | 32 | |
| 32 | 33 | /* ============================================== * |
| 33 | 34 | * * |
| ... | ... | |
| 228 | 229 | escapeshellarg($this->repo), |
| 229 | 230 | escapeshellarg($hash)); |
| 230 | 231 | $ret = 0; $out = array(); |
| 232 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 231 | 233 | exec($cmd, $out, $ret); |
| 232 | 234 | if ($ret != 0) return false; |
| 233 | 235 | return trim($out[0]); |
| ... | ... | |
| 277 | 279 | escapeshellarg($this->repo), |
| 278 | 280 | escapeshellarg($commit)); |
| 279 | 281 | $out = array(); |
| 282 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 280 | 283 | exec($cmd, $out); |
| 281 | 284 | foreach ($out as $line) { |
| 282 | 285 | list($perm, $type, $hash, $size, $file) = preg_split('/ |\t/', $line, 5, PREG_SPLIT_NO_EMPTY); |
| ... | ... | |
| 322 | 325 | escapeshellarg($commit)); |
| 323 | 326 | } |
| 324 | 327 | $out = array(); |
| 328 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 325 | 329 | exec($cmd, $out, $ret); |
| 326 | 330 | if ($ret != 0 or count($out) == 0) { |
| 327 | 331 | return false; |
| ... | ... | |
| 357 | 361 | "'commit %H%n'", |
| 358 | 362 | escapeshellarg($commit)); |
| 359 | 363 | $out = array(); |
| 364 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 360 | 365 | exec($cmd, $out); |
| 361 | 366 | $affected = count($out) - 2; |
| 362 | 367 | $added = 0; |
| ... | ... | |
| 389 | 394 | escapeshellarg($this->repo), $n, $this->mediumtree_fmt, |
| 390 | 395 | escapeshellarg($commit)); |
| 391 | 396 | $out = array(); |
| 397 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 392 | 398 | exec($cmd, $out); |
| 393 | 399 | return self::parseLog($out, 4); |
| 394 | 400 | } |
| src/IDF/Scm/Mercurial.php |
| 84 | 84 | $cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -r %s', |
| 85 | 85 | escapeshellarg($this->repo), |
| 86 | 86 | escapeshellarg($rev)); |
| 87 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 87 | 88 | exec($cmd, $out, $ret); |
| 88 | 89 | return ($ret == 0); |
| 89 | 90 | } |
| ... | ... | |
| 102 | 103 | escapeshellarg($hash)); |
| 103 | 104 | $ret = 0; |
| 104 | 105 | $out = array(); |
| 106 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 105 | 107 | exec($cmd, $out, $ret); |
| 106 | 108 | return ($ret != 0) ? false : 'commit'; |
| 107 | 109 | } |
| ... | ... | |
| 145 | 147 | $cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $tree, ($recurse) ? '' : ''); |
| 146 | 148 | $out = array(); |
| 147 | 149 | $res = array(); |
| 150 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 148 | 151 | exec($cmd, $out); |
| 149 | 152 | $tmp_hack = array(); |
| 150 | 153 | while (null !== ($line = array_pop($out))) { |
| ... | ... | |
| 191 | 194 | $cmd_tmpl = Pluf::f('hg_path', 'hg').' manifest -R %s --debug -r %s'; |
| 192 | 195 | $cmd = sprintf($cmd_tmpl, escapeshellarg($this->repo), $commit); |
| 193 | 196 | $out = array(); |
| 197 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 194 | 198 | exec($cmd, $out); |
| 195 | 199 | $tmp_hack = array(); |
| 196 | 200 | while (null !== ($line = array_pop($out))) { |
| ... | ... | |
| 242 | 246 | escapeshellarg($this->repo), |
| 243 | 247 | escapeshellarg($def->commit), |
| 244 | 248 | escapeshellarg($this->repo.'/'.$def->file)); |
| 249 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 245 | 250 | return ($cmd_only) ? $cmd : shell_exec($cmd); |
| 246 | 251 | } |
| 247 | 252 | |
| ... | ... | |
| 256 | 261 | return $this->cache['branches']; |
| 257 | 262 | } |
| 258 | 263 | $out = array(); |
| 264 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 259 | 265 | exec(sprintf(Pluf::f('hg_path', 'hg').' branches -R %s', |
| 260 | 266 | escapeshellarg($this->repo)), $out); |
| 261 | 267 | $res = array(); |
| ... | ... | |
| 287 | 293 | $cmd = sprintf($tmpl, |
| 288 | 294 | escapeshellarg($commit), escapeshellarg($this->repo)); |
| 289 | 295 | $out = array(); |
| 296 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 290 | 297 | exec($cmd, $out); |
| 291 | 298 | $log = array(); |
| 292 | 299 | $change = array(); |
| ... | ... | |
| 328 | 335 | { |
| 329 | 336 | $cmd = sprintf(Pluf::f('hg_path', 'hg').' log -R %s -l%s ', escapeshellarg($this->repo), $n, $commit); |
| 330 | 337 | $out = array(); |
| 338 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 331 | 339 | exec($cmd, $out); |
| 332 | 340 | return self::parseLog($out, 6); |
| 333 | 341 | } |
| src/IDF/Scm/Svn.php |
| 146 | 146 | escapeshellarg($this->password), |
| 147 | 147 | escapeshellarg($this->repo), |
| 148 | 148 | escapeshellarg($rev)); |
| 149 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 149 | 150 | exec($cmd, $out, $ret); |
| 150 | 151 | return (0 == $ret); |
| 151 | 152 | } |
| ... | ... | |
| 170 | 171 | escapeshellarg($this->password), |
| 171 | 172 | escapeshellarg($this->repo.'/'.$path), |
| 172 | 173 | escapeshellarg($rev)); |
| 174 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 173 | 175 | $xmlInfo = shell_exec($cmd); |
| 174 | 176 | |
| 175 | 177 | // If exception is thrown, return false |
| ... | ... | |
| 196 | 198 | escapeshellarg($this->password), |
| 197 | 199 | escapeshellarg($this->repo.'/'.$folder), |
| 198 | 200 | escapeshellarg($commit)); |
| 201 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 199 | 202 | $xml = simplexml_load_string(shell_exec($cmd)); |
| 200 | 203 | $res = array(); |
| 201 | 204 | $folder = (strlen($folder) and ($folder != '/')) ? $folder.'/' : ''; |
| ... | ... | |
| 236 | 239 | escapeshellarg($this->password), |
| 237 | 240 | escapeshellarg($this->repo), |
| 238 | 241 | escapeshellarg($rev)); |
| 242 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 239 | 243 | $xml = simplexml_load_string(shell_exec($cmd)); |
| 240 | 244 | $this->cache['commitmess'][$rev] = (string) $xml->logentry->msg; |
| 241 | 245 | return $this->cache['commitmess'][$rev]; |
| ... | ... | |
| 251 | 255 | escapeshellarg($this->password), |
| 252 | 256 | escapeshellarg($this->repo.'/'.$filename), |
| 253 | 257 | escapeshellarg($rev)); |
| 258 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 254 | 259 | $xml = simplexml_load_string(shell_exec($cmd)); |
| 255 | 260 | if (!isset($xml->entry)) { |
| 256 | 261 | return false; |
| ... | ... | |
| 277 | 282 | escapeshellarg($this->password), |
| 278 | 283 | escapeshellarg($this->repo.'/'.$def->fullpath), |
| 279 | 284 | escapeshellarg($def->rev)); |
| 285 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 280 | 286 | return ($cmd_only) ? $cmd : shell_exec($cmd); |
| 281 | 287 | } |
| 282 | 288 | |
| ... | ... | |
| 295 | 301 | escapeshellarg($this->username), |
| 296 | 302 | escapeshellarg($this->password), |
| 297 | 303 | escapeshellarg($this->repo.'/branches')); |
| 304 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 298 | 305 | exec($cmd, $out, $ret); |
| 299 | 306 | if ($ret == 0) { |
| 300 | 307 | foreach ($out as $entry) { |
| ... | ... | |
| 309 | 316 | escapeshellarg($this->username), |
| 310 | 317 | escapeshellarg($this->password), |
| 311 | 318 | escapeshellarg($this->repo.'/trunk')); |
| 319 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 312 | 320 | exec($cmd, $out, $ret); |
| 313 | 321 | if ($ret == 0) { |
| 314 | 322 | $res = array('trunk' => 'trunk') + $res; |
| ... | ... | |
| 348 | 356 | escapeshellarg($this->password), |
| 349 | 357 | escapeshellarg($this->repo), |
| 350 | 358 | escapeshellarg($commit)); |
| 359 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 351 | 360 | $xmlRes = shell_exec($cmd); |
| 352 | 361 | $xml = simplexml_load_string($xmlRes); |
| 353 | 362 | $res['author'] = (string) $xml->logentry->author; |
| ... | ... | |
| 376 | 385 | $cmd = sprintf(Pluf::f('svnlook_path', 'svnlook').' changed -r %s %s', |
| 377 | 386 | escapeshellarg($commit), |
| 378 | 387 | escapeshellarg($repo)); |
| 388 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 379 | 389 | $out = shell_exec($cmd); |
| 380 | 390 | $lines = preg_split("/\015\012|\015|\012/", $out); |
| 381 | 391 | return (count($lines) > 100); |
| ... | ... | |
| 389 | 399 | escapeshellarg($this->username), |
| 390 | 400 | escapeshellarg($this->password), |
| 391 | 401 | escapeshellarg($this->repo)); |
| 402 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 392 | 403 | return shell_exec($cmd); |
| 393 | 404 | } |
| 394 | 405 | |
| ... | ... | |
| 414 | 425 | escapeshellarg($this->password), |
| 415 | 426 | escapeshellarg($this->repo), |
| 416 | 427 | escapeshellarg($branch)); |
| 428 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 417 | 429 | $xmlRes = shell_exec($cmd); |
| 418 | 430 | $xml = simplexml_load_string($xmlRes); |
| 419 | 431 | foreach ($xml->logentry as $entry) { |
| ... | ... | |
| 445 | 457 | escapeshellarg($this->password), |
| 446 | 458 | escapeshellarg($this->repo.'/'.$path), |
| 447 | 459 | escapeshellarg($rev)); |
| 460 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 448 | 461 | $xmlProps = shell_exec($cmd); |
| 449 | 462 | $props = simplexml_load_string($xmlProps); |
| 450 | 463 | |
| ... | ... | |
| 480 | 493 | escapeshellarg($this->password), |
| 481 | 494 | escapeshellarg($this->repo.'/'.$path), |
| 482 | 495 | escapeshellarg($rev)); |
| 496 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 483 | 497 | $xmlProp = shell_exec($cmd); |
| 484 | 498 | $prop = simplexml_load_string($xmlProp); |
| 485 | 499 | |
| ... | ... | |
| 502 | 516 | escapeshellarg($this->password), |
| 503 | 517 | escapeshellarg($this->repo), |
| 504 | 518 | escapeshellarg($rev)); |
| 519 | $cmd = Pluf::f('idf_exec_cmd_prefix', '').$cmd; |
| 505 | 520 | $xmlInfo = shell_exec($cmd); |
| 506 | 521 | |
| 507 | 522 | $xml = simplexml_load_string($xmlInfo); |