mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 14:09:06 +02:00
* small diffs from Sergey applied
This commit is contained in:
parent
bba2be8243
commit
66aa8ba662
@ -44,7 +44,7 @@ procedure dofile(const fn:string);
|
|||||||
var
|
var
|
||||||
t,f : text;
|
t,f : text;
|
||||||
s : string;
|
s : string;
|
||||||
skip : boolean;
|
skip, truncated : boolean;
|
||||||
year,month,day,
|
year,month,day,
|
||||||
found,revs,i : integer;
|
found,revs,i : integer;
|
||||||
fbuf,tbuf : pointer;
|
fbuf,tbuf : pointer;
|
||||||
@ -68,14 +68,127 @@ begin
|
|||||||
found:=0;
|
found:=0;
|
||||||
revs:=0;
|
revs:=0;
|
||||||
skip:=false;
|
skip:=false;
|
||||||
|
truncated:=false;
|
||||||
while not eof(t) do
|
while not eof(t) do
|
||||||
begin
|
begin
|
||||||
readln(t,s);
|
readln(t,s);
|
||||||
case found of
|
case found of
|
||||||
0 :
|
0 :
|
||||||
begin
|
begin
|
||||||
|
if pos('$Log: ',s)>0 then
|
||||||
|
found:=1;
|
||||||
|
skip:=false;
|
||||||
|
writeln(f,s);
|
||||||
|
end;
|
||||||
|
1 :
|
||||||
|
begin
|
||||||
|
i:=pos('Revision',s);
|
||||||
|
if i>0 then
|
||||||
|
begin
|
||||||
|
inc(revs);
|
||||||
|
if revs>maxrevs then
|
||||||
|
begin
|
||||||
|
skip:=true;
|
||||||
|
truncated:=true;
|
||||||
|
found:=2;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
inc(i,10);
|
||||||
|
while (i<length(s)) and (s[i]<>' ') do
|
||||||
|
inc(i);
|
||||||
|
while (i<length(s)) and (s[i]=' ') do
|
||||||
|
inc(i);
|
||||||
|
if (i<length(s)) and (s[i] in ['0'..'9']) then
|
||||||
|
begin
|
||||||
|
Date2Int(Copy(s,i,10),year,month,day);
|
||||||
|
if (year<Myear) or
|
||||||
|
((year=MYear) and (month<Mmonth)) or
|
||||||
|
((year=MYear) and (month=Mmonth) and (day<Mday)) then
|
||||||
|
begin
|
||||||
|
skip:=true;
|
||||||
|
truncated:=true;
|
||||||
|
found:=2;
|
||||||
|
// write(year,'/',month,'/',day,' date');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if pos('}',s)>0 then
|
||||||
|
begin
|
||||||
|
skip:=false;
|
||||||
|
found:=0;
|
||||||
|
end;
|
||||||
|
if not skip then
|
||||||
|
writeln(f,s);
|
||||||
|
end;
|
||||||
|
2 :
|
||||||
|
begin
|
||||||
|
if pos('}',s)>0 then
|
||||||
|
begin
|
||||||
|
skip:=false;
|
||||||
|
found:=0;
|
||||||
|
end;
|
||||||
|
if not skip then
|
||||||
|
writeln(f,s);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
close(t);
|
||||||
|
close(f);
|
||||||
|
if revs=0 then
|
||||||
|
writeln(' no log found')
|
||||||
|
else
|
||||||
|
if truncated then
|
||||||
|
writeln(revs-1,' revisions')
|
||||||
|
else
|
||||||
|
writeln(revs,' revisions');
|
||||||
|
erase(t);
|
||||||
|
rename(f,fn);
|
||||||
|
freemem(tbuf);
|
||||||
|
freemem(fbuf);
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
dir : tsearchrec;
|
||||||
|
i : integer;
|
||||||
|
begin
|
||||||
|
writeln('fixlog v1.00 (C) 1999-2000 Peter Vreman');
|
||||||
|
if paramcount<3 then
|
||||||
|
begin
|
||||||
|
writeln('usage: fixlog <revisions> <yyyy-mm-dd> <files> [files]');
|
||||||
|
halt(1);
|
||||||
|
end;
|
||||||
|
MaxRevs:=StrToInt(ParamStr(1));
|
||||||
|
Date2Int(ParamStr(2),MYear,MMonth,MDay);
|
||||||
|
for i:=3 to paramcount do
|
||||||
|
begin
|
||||||
|
if findfirst(paramstr(i),faAnyFile,dir)=0 then
|
||||||
|
repeat
|
||||||
|
dofile(dir.name);
|
||||||
|
until findnext(dir)<>0;
|
||||||
|
findclose(dir);
|
||||||
|
end;
|
||||||
|
end.
|
||||||
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 2000-07-13 11:32:55 michael
|
Revision 1.3 2001-03-05 21:44:16 peter
|
||||||
+ removed logs
|
* small diffs from Sergey applied
|
||||||
|
|
||||||
|
Revision 1.1 2000/07/13 06:30:14 michael
|
||||||
|
+ Initial import
|
||||||
|
|
||||||
|
Revision 1.4 2000/02/09 13:08:27 peter
|
||||||
|
* usage shows yyyy-mm-dd
|
||||||
|
|
||||||
|
Revision 1.3 2000/01/08 13:52:02 peter
|
||||||
|
* max date added
|
||||||
|
|
||||||
|
Revision 1.2 2000/01/07 01:15:00 peter
|
||||||
|
* updated copyright to 2000
|
||||||
|
|
||||||
|
Revision 1.1 1999/10/06 06:29:03 peter
|
||||||
|
* new tool
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,19 +26,13 @@ var
|
|||||||
begin
|
begin
|
||||||
assign(t,paramstr(1));
|
assign(t,paramstr(1));
|
||||||
reset(t);
|
reset(t);
|
||||||
assign(f,'errorm.msg');
|
assign(f,'New.msg');
|
||||||
rewrite(f);
|
rewrite(f);
|
||||||
while not eof(t) do
|
while not eof(t) do
|
||||||
begin
|
begin
|
||||||
readln(t,s);
|
readln(t,s);
|
||||||
if (s<>'') and not(s[1] in ['#','%']) then
|
if (s<>'') and not(s[1] in ['#','%']) then
|
||||||
begin
|
begin
|
||||||
if copy(s,1,11)='option_info' then
|
|
||||||
delete(s,1,13)
|
|
||||||
else
|
|
||||||
if copy(s,1,2)='ol' then
|
|
||||||
delete(s,1,6)
|
|
||||||
else
|
|
||||||
for i:=0 to 10 do
|
for i:=0 to 10 do
|
||||||
if Copy(s,1,length(trtab[i].name))=trtab[i].name then
|
if Copy(s,1,length(trtab[i].name))=trtab[i].name then
|
||||||
begin
|
begin
|
||||||
@ -69,12 +63,13 @@ begin
|
|||||||
end;
|
end;
|
||||||
close(f);
|
close(f);
|
||||||
close(t);
|
close(t);
|
||||||
erase(t);
|
|
||||||
rename(f,paramstr(1));
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.2 2000-07-13 11:32:55 michael
|
Revision 1.3 2001-03-05 21:44:16 peter
|
||||||
|
* small diffs from Sergey applied
|
||||||
|
|
||||||
|
Revision 1.2 2000/07/13 11:32:55 michael
|
||||||
+ removed logs
|
+ removed logs
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -311,6 +311,7 @@ end;
|
|||||||
procedure WriteReorderedFile(FileName : string;orgnext,diffnext : PMsg);
|
procedure WriteReorderedFile(FileName : string;orgnext,diffnext : PMsg);
|
||||||
var t,t2,t3 : text;
|
var t,t2,t3 : text;
|
||||||
i,ntcount : longint;
|
i,ntcount : longint;
|
||||||
|
j : integer;
|
||||||
s,s2,s3 : string;
|
s,s2,s3 : string;
|
||||||
is_msg : boolean;
|
is_msg : boolean;
|
||||||
nextdiffkept : pmsg;
|
nextdiffkept : pmsg;
|
||||||
@ -365,11 +366,13 @@ procedure WriteReorderedFile(FileName : string;orgnext,diffnext : PMsg);
|
|||||||
inc(ntcount);
|
inc(ntcount);
|
||||||
end;
|
end;
|
||||||
s2:=orgnext^.text;
|
s2:=orgnext^.text;
|
||||||
s2:=upcase(copy(s2,1,pos('_',s2)));
|
j:=pos('_',copy(s2,7,20)) + 6;
|
||||||
|
s2:=upcase(copy(s2,1,j));
|
||||||
s3:=orgnext^.equivalent^.text;
|
s3:=orgnext^.equivalent^.text;
|
||||||
s3:=upcase(copy(s3,1,pos('_',s3)));
|
j:=pos('_',copy(s3,7,20)) + 6;
|
||||||
|
s3:=upcase(copy(s3,1,j));
|
||||||
{ that are the conditions in verbose unit }
|
{ that are the conditions in verbose unit }
|
||||||
if (length(s3)<5) and (s2<>s3) then
|
if (length(s3)<12) and (s2<>s3) then
|
||||||
begin
|
begin
|
||||||
Writeln('Warning: different options for ',orgnext^.enum);
|
Writeln('Warning: different options for ',orgnext^.enum);
|
||||||
Writeln('in ',orgFileName,' : ',s2);
|
Writeln('in ',orgFileName,' : ',s2);
|
||||||
@ -434,7 +437,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.3 2001-02-09 23:04:56 peter
|
Revision 1.4 2001-03-05 21:44:16 peter
|
||||||
|
* small diffs from Sergey applied
|
||||||
|
|
||||||
|
Revision 1.3 2001/02/09 23:04:56 peter
|
||||||
* updated for new message file by Sergey Korshunoff
|
* updated for new message file by Sergey Korshunoff
|
||||||
|
|
||||||
Revision 1.2 2000/07/13 11:32:55 michael
|
Revision 1.2 2000/07/13 11:32:55 michael
|
||||||
|
Loading…
Reference in New Issue
Block a user