git_sync.ps1: -OrphanExempt, texte fara binar prin design
Un text .??2 al carui binar e gitignored si se genereaza local din text (txt2vcx) nu e orfan, dar era raportat ca atare la fiecare sync. Pattern-urile din -OrphanExempt sunt sarite inainte de verificarea binarului, deci nici raportate nici sterse la -OrphanCleanup. Implicit acopera stub-ul de formular verificare.sc2 din testele headless de achizitie import. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EiizMcQA6NEYCftpqCtPtC
This commit is contained in:
13
git_sync.ps1
13
git_sync.ps1
@@ -26,7 +26,8 @@
|
||||
|
||||
Curatare orfani: textele .??2 fara binar corespondent (binar sters din SVN) si .db2-urile ale
|
||||
caror tabele au IESIT din lista -DbfList sunt DOAR RAPORTATE implicit; se sterg numai cu
|
||||
-OrphanCleanup explicit.
|
||||
-OrphanCleanup explicit. Textele din -OrphanExempt sunt sarite de la verificare (text fara
|
||||
binar prin design).
|
||||
|
||||
Toate invocarile FoxBin2Prg.EXE trec prin Invoke-FoxBin2PrgSafe (timeout + taskkill).
|
||||
|
||||
@@ -59,6 +60,10 @@
|
||||
.PARAMETER OrphanCleanup
|
||||
Sterge efectiv textele orfane. Implicit orfanii sunt DOAR raportati, nu stersi.
|
||||
|
||||
.PARAMETER OrphanExempt
|
||||
Pattern-uri (-like, relative la ProjectRoot) de texte .??2 care NU sunt orfani chiar fara binar
|
||||
langa ele: binarul e gitignored si se genereaza local din text (txt2vcx), textul e sursa.
|
||||
|
||||
.EXAMPLE
|
||||
powershell -ExecutionPolicy Bypass -File D:\ROA\UTIL\foxbin2prg\git_sync.ps1 -ProjectRoot D:\ROA\ROACONT
|
||||
#>
|
||||
@@ -76,6 +81,8 @@ param(
|
||||
'utile\ListProperty\lproperty.dbf','utile\hpdf\*.dbf','utile\hpdf\ReportOutput\*.dbf'),
|
||||
# clase FFC/third-party cu #INCLUDE: roundtrip izolat = fals-negativ; editare doar in IDE, fara write-back
|
||||
[string[]]$RoundtripExempt = @('COMUN\clase\accessibility.vcx','COMUN\clase\oinventar.vcx','COMUN\clase\_gdiplus.vcx','COMUN\clase\_reportlistener.vcx','COMUN\utile\foxcharts\foxcharts.vcx','COMUN\utile\web\_webview.vcx'),
|
||||
# texte a caror sursa de adevar e textul: binarul e gitignored si se genereaza local, nu sunt orfani
|
||||
[string[]]$OrphanExempt = @('*utile\Teste\achizitie_import\stub_verificare\verificare.sc2'),
|
||||
[string]$SubDir = '',
|
||||
[int]$TimeoutSeconds = 60,
|
||||
[int]$MaxDb2Mb = 5,
|
||||
@@ -280,6 +287,8 @@ if (-not $SubDir) {
|
||||
$allText = Get-ChildItem -LiteralPath $ProjectRoot -Recurse -File -ErrorAction SilentlyContinue |
|
||||
Where-Object { $script:TextExts.ContainsKey($_.Extension.ToLower()) }
|
||||
foreach ($t in $allText) {
|
||||
$tRel = Get-RelPath $t.FullName
|
||||
if (@($OrphanExempt | Where-Object { $tRel -like $_ }).Count -gt 0) { continue }
|
||||
$tExt = $t.Extension.ToLower()
|
||||
$binExt = $script:TextExts[$tExt]
|
||||
$base = [IO.Path]::GetFileNameWithoutExtension($t.Name)
|
||||
@@ -291,7 +300,7 @@ if (-not $SubDir) {
|
||||
$isOrphan = $true # tabela a iesit din lista
|
||||
}
|
||||
if ($isOrphan) {
|
||||
$orphansDeleted += (Get-RelPath $t.FullName)
|
||||
$orphansDeleted += $tRel
|
||||
if ($OrphanCleanup -and -not $NoOrphanCleanup) { Remove-Item -LiteralPath $t.FullName -Force -ErrorAction SilentlyContinue }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user