fpsvnsync: fixed setting svn:eolstyle on files that are not text/plain, needed for lazarus r13688.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@323 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
vsnijders
2008-01-11 23:13:23 +00:00
parent 77f2ea719a
commit e65d145159
2 changed files with 24 additions and 12 deletions

View File

@@ -26,10 +26,10 @@
</RunParams> </RunParams>
<RequiredPackages Count="2"> <RequiredPackages Count="2">
<Item1> <Item1>
<PackageName Value="FCL"/> <PackageName Value="svnpkg"/>
</Item1> </Item1>
<Item2> <Item2>
<PackageName Value="svnpkg"/> <PackageName Value="FCL"/>
</Item2> </Item2>
</RequiredPackages> </RequiredPackages>
<Units Count="1"> <Units Count="1">

View File

@@ -204,7 +204,8 @@ var
procedure CopyFileProp(SourceProp, DestProp: TSvnFileProp); procedure CopyFileProp(SourceProp, DestProp: TSvnFileProp);
var var
j: integer; j, pass: integer;
IsSvnEolProp: boolean;
Command: string; Command: string;
begin begin
if SourceProp.Properties.Text=DestProp.Properties.Text then exit; if SourceProp.Properties.Text=DestProp.Properties.Text then exit;
@@ -221,7 +222,13 @@ var
writeln('svn ', Command); writeln('svn ', Command);
writeln('svn result: ', ExecuteSvnCommand(Command)); writeln('svn result: ', ExecuteSvnCommand(Command));
end; end;
// first pass set svn:eolstyle, later it might not be possible
// because of the mime style is non-text.
for pass := 1 to 2 do begin
for j:=0 to SourceProp.Properties.Count-1 do begin for j:=0 to SourceProp.Properties.Count-1 do begin
IsSvnEolProp := SourceProp.Properties.Names[j]='svn:eol-style';
if ((pass=1) and (IsSvnEolProp=true)) or
((pass=2) and (IsSvnEolProp=false)) then begin
Command := format('propset %s "%s" "%s"', Command := format('propset %s "%s" "%s"',
[SourceProp.Properties.Names[j], [SourceProp.Properties.Names[j],
SourceProp.Properties.ValueFromIndex[j], SourceProp.Properties.ValueFromIndex[j],
@@ -230,6 +237,8 @@ var
writeln('svn result: ', ExecuteSvnCommand(Command)); writeln('svn result: ', ExecuteSvnCommand(Command));
end; end;
end; end;
end;
end;
begin begin
SourcePropInfo := CreatePropInfo(FSourceWC); SourcePropInfo := CreatePropInfo(FSourceWC);
@@ -309,9 +318,12 @@ begin
DestRoot := GetRepositoryRoot(FDestWC); DestRoot := GetRepositoryRoot(FDestWC);
writeln('------'); writeln('------');
except except on E: Exception do
begin
writeln(E.Message);
halt(9); halt(9);
end; end;
end;
XmlOutput := TMemoryStream.Create; XmlOutput := TMemoryStream.Create;
SvnLog := TSvnLog.Create; SvnLog := TSvnLog.Create;