Search code examples
svntortoisesvn

How to recover from file sync mix-up with TortoiseSVN


I have a file-based TortoiseSVN repo that requires the files to be kept in sync if I need to work across multiple machines (rare... but courtesy of a pandemic, you guessed it).

The inevitable happens: two distinct machines (PC1, PC2) each commit changes, and are assigned the same revision number due to an undetected sync backlog on PC2. Subsequently, PC2 clears the sync backlog, but ends up with a muddled view of the repo:

  • PC1 revision history ("Show Log") shows the affected revision has the author and revision comment from PC1, but also files committed from PC2.

PC2 seems totally fine, so the changes submitted on PC1 are re-submitted there. This filters through to PC1 where the revision history shows the latest revision correctly, but the history entry for the previous revision remains muddled as described above.

It seems like a reasonable idea to delete/rename the affected project, and do a fresh checkout. That results in:

  • Checksum mismatch for
  • Try a 'Cleanup'. If that doesn't work you need to do a fresh checkout
    • Cleanup fails; fresh checkout consistently leads to checksum mismatch

So I'm stuck. I guess that something in the .svn folder needs deleting. How can I find out what that something is and remove it without losing either history or affecting other projects from the same repo?

(There are multiple projects/branches in the repo root, and a single .svn file spanning all checkouts from it as far as I can tell. I'm running TortoiseSVN 1.10.5 on Windows 10... and further complicating things by encrypting all the source in the repo using Cryptomator.org)


Solution

  • This answer provided the basis for at least a partial solution... with some careful attention to svn:externals - where there were sub-folders with svn:externals, there were complaints that "the node already exists" (or something to that effect). Every instance like this had to be separately deleted, and the update command run again.

    For the most part, existing files from other folders were "versioned" by the SVN update, and not updated. Missing files (or deliberately deleted ones) were replaced. Applying this to all folders/projects led to an error-free result.

    But there is one small quirk remaining: the revision history shows the wrong author and log message. However, when I attempt to edit them, the popup dialogs contain the correct author/message. The code changes submitted in error are gone. So there is still some locally duplicated data somewhere, but its effect is cosmetic.

    I dare not try to update to the faulty revision...