### Debug in Experimental Instance with /rootSuffix Exp Source: https://github.com/ampscm/ankhsvn/blob/main/src/BUILD.md Launch Visual Studio with the /rootSuffix Exp argument to debug in the experimental instance. The package uses the modern AsyncPackage model and supports background loading. ```text /rootSuffix Exp ``` -------------------------------- ### Open the main solution: src/AnkhSvn.sln Source: https://github.com/ampscm/ankhsvn/blob/main/README.md The main solution file for AnkhSVN. Open this in Visual Studio to build and develop the project. ```text src/AnkhSvn.sln ``` -------------------------------- ### Run Ankh.Tests test project Source: https://github.com/ampscm/ankhsvn/blob/main/README.md Runs the Ankh.Tests test project with Release configuration, no build or restore, and treats no tests as an error. ```bat dotnet test src\Ankh.Tests\Ankh.Tests.csproj --configuration Release --no-build --no-restore -- RunConfiguration.TreatNoTestsAsError=true ``` -------------------------------- ### Run Ankh.VS.UnitTest test project Source: https://github.com/ampscm/ankhsvn/blob/main/README.md Runs the Ankh.VS.UnitTest test project with Release configuration, no build or restore, and treats no tests as an error. ```bat dotnet test src\Ankh.VS.UnitTest\Ankh.VS.UnitTest.csproj --configuration Release --no-build --no-restore -- RunConfiguration.TreatNoTestsAsError=true ``` -------------------------------- ### Build AnkhSVN with msbuild Source: https://github.com/ampscm/ankhsvn/blob/main/src/BUILD.md Build the solution from a Developer Command Prompt. Uses UseVsSdkVersion=17.0 and Configuration=Release. VisualStudioVersion and UseVsSdkVersion default to 17.0, the minimum supported Visual Studio version. ```bat msbuild /m /restore /t:rebuild /p:UseVsSdkVersion=17.0 /p:Configuration=Release src\AnkhSvn.sln ``` -------------------------------- ### Greedy LCS/SES Algorithm (Myers Diff) Source: https://github.com/ampscm/ankhsvn/blob/main/src/Ankh.Diff/DiffUtils/Docs/MyersDiff.pdf Pseudo-code for the greedy LCS/SES algorithm from Myers' diff paper. It searches for the shortest edit script (SES) by iterating over D (edit distance) and k diagonals, using a V array to track furthest reaching paths. The algorithm stops when it finds a path to (N,M) and reports the length of the SES; if no such path exists within MAX, it reports that any edit script must be longer than MAX. ```pseudocode Constant MAX ˛ [0,M+N] Var V: Array [- MAX .. MAX] of Integer 1. V[1] ‹ 0 2. For D‹0 to MAX Do 3. For k ‹ -D to D in steps of 2 Do 4. If k = -D or k „ D and V[k - 1] < V[k + 1] Then 5. x ‹ V[k + 1] 6. Else 7. x ‹ V[k - 1]+1 8. y ‹ x-k 9. While x < N and y < M and a[x+1] = b[y+1] Do (x,y) ‹ (x+1,y+1) 10. V[k] ‹ x 11. If x ‡ N and y ‡ M Then 12. Length of an SES is D 13. Stop 14. Length of an SES is greater than MAX ``` -------------------------------- ### Generated VSIX path Source: https://github.com/ampscm/ankhsvn/blob/main/src/BUILD.md The output path of the generated VSIX after building. The VSIX is x64 and uses the Visual Studio 2022+ manifest. ```text src\Ankh.Package\bin\Release\Ankh.Package.vsix ``` -------------------------------- ### OnePass procedure pseudocode Source: https://github.com/ampscm/ankhsvn/blob/main/src/Ankh.Diff/DiffUtils/Docs/BurnsBinaryDiff_Thesis.pdf Pseudo-code for the one pass differencing algorithm. It maintains hash tables for base and version files, emits codes for matches, and flushes buffers at the end. The algorithm runs in linear time and improves compression over the simple linear differencing algorithm. ```pseudocode procedure OnePass prefixLength : number; baseFile, verFile, diffFile : stream local baseh, verh, base pos, ver pos, ver start : number; local verhashtbl HASHTABLESIZE basehashtbl HASHTABLESIZE : number; local base active, version begin active : flag ver pos 0; base pos 0; base active TRUE; version active TRUE; while base active or version active if verh ver pos Footprint length verFile ver verFile - prefixLength pos ; verhashtbl verh ver pos; if SENTINEL basehashtbl verh and Verify baseFile basehashtbl length EmitCodes basehashtbl verh , ver pos, ver start, baseFile, verFile, diffFile; base pos max base pos, basehashtbl verh length; ver pos ver pos length; ver end if continue; else start ver pos; version end if active FALSE; if baseh base pos Footprint length baseFile base baseFile - prefixLength pos ; basehashtbl baseh base pos; if if SENTINEL ver start verhashtbl verhashtbl baseh baseh and Verify verFile verhashtbl length EmitCodes base pos, verehashtbl baseh , ver start, baseFile, verFile, diffFile; base pos base pos length ; ver pos verhashtbl baseh length; ver continue; else start ver pos; FixupEncoding end if end if else base pos, verhashtbl baseh , baseFile, verFile, diffFile; base active end if FALSE; ver pos ver pos 1; base pos end while base pos 1; FixupBufferInsertEnd EmitCodes length baseF diffFile; ile, length verFile, ver start, baseFile, verFile, diffFile; end FlushFixupBuffer verFile, diffFile; ``` -------------------------------- ### LinearDifference procedure pseudo-code Source: https://github.com/ampscm/ankhsvn/blob/main/src/Ankh.Diff/DiffUtils/Docs/BurnsBinaryDiff_Thesis.pdf Pseudo-code for the linear time differencing algorithm. It uses a hash table to find synchronization points (hashing mode) and then extends matches via byte identity checks (identity mode). The algorithm processes base and version files in a single pass, emitting add and copy codes to the diff file. ```pseudocode procedure LinearDifference footprintLength : number; baseFile, verFile, diffFile : stream local baseh, verh, base pos, ver pos, ver start : number; local hashtable HASHTABLESIZE : struct hash entry; local base active : flag begin ver pos ← 0; base pos ← 0; base active ← TRUE; while ver pos < length verFile − footprintLen do verh ← Footprint(verFile, ver pos); if base active then baseh ← Footprint(baseFile, base pos); end if if BASEFILE = hashtable[verh].file and Verify(baseFile[hashtable[verh].offset], verFile[ver pos], length) then length ← EmitCodes(hashtable[verh].offset, ver pos, ver start, baseFile, verFile, diffFile); base pos ← base pos + length; ver pos ← ver pos + length; ver start ← ver pos; FlushHashTable(hashtable); continue; else hashtable[verh].offset ← ver pos; hashtable[verh].file ← VERFILE; end if if base pos < length(baseFile) − footprintLen and base active then if VERFILE = hashtable[baseh].file and Verify(verFile[hashtable[baseh].offset], baseFile[base pos]) and ver start < hashtable[baseh].offset then length ← EmitCodes(base pos, hashtable[baseh].offset, ver start, baseFile, verFile, diffFile); ver pos ← ver pos + length; base pos ← base pos + length; ver start ← ver pos; FlushHashTable(hashtable); continue; else hashtable[baseh].offset ← ver pos; hashtable[baseh].file ← BASEFILE; end if else base active ← FALSE; end if ver pos ← ver pos + 1; base pos ← base pos + 1; end while EmitCodes(length(baseFile), length(verFile), ver start, baseFile, verFile, diffFile); EmitEnd(diffFile); end ``` -------------------------------- ### EmitCodes function pseudo-code Source: https://github.com/ampscm/ankhsvn/blob/main/src/Ankh.Diff/DiffUtils/Docs/BurnsBinaryDiff_Thesis.pdf Pseudo-code for the EmitCodes function, which is called by LinearDifference when a match is found. It emits an add code for the unmatched region, then finds the longest identical string between the matching footprints and emits a copy code. Returns the length of the copied match. ```pseudocode procedure EmitCodes basePos, verPos, verStart : number; baseFile, verFile, diffFile : stream local copy length : number; begin if verPos > verStart then EmitAdd(verStart, verPos − verStart, verFile, diffFile); end if /* Find the longest identical string between the matching footprints */ copy length ← ExtendMatch(baseFile[basePos], verFile[verPos]); length ← EmitCopy(verPos, basePos, copy length, verFile, baseFile, diffFile); return length; end ```