Project

General

Profile

Actions

Bug #25378

closed

Remove SVN auto properties $Id$

Added by Xavier Perseguers about 13 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2011-03-23
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.6
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

As we moved to GIT, SVN auto properties are now completely useless and are not updated anymore. We should get rid of them.

(issue imported from #M18016)

Actions #1

Updated by Xavier Perseguers about 13 years ago

This command should basically do the job:

$ for f in $(grep -isr "\$Id" * | cut -d":" -f1); do awk '{ if (!/\$Id/) print }' $f > $f.new; mv $f.new $f; done

Actions #3

Updated by Xavier Perseguers about 13 years ago

This code was finally used before some manual tweaking:

function main() {
$files = array();
exec('grep -isr "\$Id" * | cut -d":" -f1', $files);

foreach ($files as $file) {
$ext = substr($file, strrpos($file, '.') + 1);
if (!in_array($ext, array('txt', 'php', 'sh', 'js', 'sql', 'inc', 'phpsh', 'html', 'htm', 'css', 'xml'))) {
continue;
}
if ($file === basename(FILE)) {
continue;
}
remove_id($file);
}
}

function remove_id($file) {
$isPHP = substr($file, -4) === '.php';
$content = file_get_contents($file);
$lines = explode("\n", $content);

$newLines = array();
$previousLine = '';
foreach ($lines as $line) {
if (preg_match('/\$Id/', $line)) {
if (trim($previousLine) === '*' || trim($previousLine) === '#') {
array_pop($newLines);
}
continue;
}
$newLines[] = $line;
$previousLine = $line;
}
$content = implode("\n", $newLines);
$fd = fopen($file, 'wb');
$res = fwrite($fd, $content);
fclose($fd);
}

main();
?>

Actions #4

Updated by Xavier Perseguers about 12 years ago

  • Status changed from Resolved to Closed
Actions #5

Updated by Ernesto Baschny almost 11 years ago

  • Target version deleted (4.6.0-beta1)
Actions

Also available in: Atom PDF