This commit is contained in:
EH 2026-06-19 05:11:50 +00:00 committed by GitHub
commit be2b53f270
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 5 deletions

View file

@ -197,7 +197,10 @@ object frmSyncDirsDlg: TfrmSyncDirsDlg
Width = 82
Caption = 'asymmetric'
Enabled = False
Hint = 'One-way mirror: right panel becomes an exact copy of the left. Right-only files are deleted; right-newer files are overwritten by left.'
ParentFont = False
ParentShowHint = False
ShowHint = True
TabOrder = 0
end
object chkSubDirs: TCheckBox

View file

@ -465,7 +465,12 @@ begin
end;
if R.FAction = srsUnknown then
begin
R.FAction := R.FState;
// Mirror asymmetric logic from TFileSyncRec.Recalc:
// in asymmetric mode srsNotEq means left wins → srsCopyRight.
if chkAsymmetric.Checked and (R.FState = srsNotEq) then
R.FAction := srsCopyRight
else
R.FAction := R.FState;
end;
except
on E: Exception do
@ -562,11 +567,19 @@ begin
if FileTimeDiff < 0 then
FState := srsCopyLeft;
end;
if FForm.chkAsymmetric.Checked and (FState = srsCopyLeft) then
FAction := srsDoNothing
else begin
if FForm.chkAsymmetric.Checked then
begin
// In asymmetric/mirror mode left is unconditionally authoritative.
// srsCopyLeft means right is newer — left still wins (overwrite right).
// srsNotEq means ambiguous diff (e.g. content check) — left still wins.
if FState in [srsCopyLeft, srsNotEq] then
FAction := srsCopyRight
else
FAction := FState;
end
else
FAction := FState;
end;
end;
end;
{ TfrmSyncDirsDlg }