githelper.git
/
githelper.pike
version
»
Context lines:
10
20
40
80
file
none
3
githelper.git/githelper.pike:59:
class NiceIdentFilter { static string replace_id(string f, function(string:string) replace) { int p=0; while((p=search(f, "$Id", p)) >= 0) { int p2 = search(f, "$", p+3), p3 = search(f, "\n", p+3); if (p2 > p && p2 < p3) { string r = replace(f[p..p2]); if (r) {
+
// werror("Replacing %O with %O\n", f[p..p2], r);
f = f[..p-1]+r+f[p2+1..]; p += sizeof(r);
-
} else p = p2+1;
+
} else
{
+
// werror("Not replacing %O\n", f[
p
..p2]);
+
p
= p2+1;
+
}
} else p += 3; } return f; } static string clean_ident(string i) {
-
if(has_prefix(i, "$Id:") && sizeof(i/" ")==
3
)
+
if(has_prefix(i, "$Id:") && sizeof(i/" ")==
13
)
return "$Id$"; } static string smudge_ident(string i) { return "$Id$"; } int clean() {