The biggest problem here, regarding repository corruption, is that you're using Dropbox and Google Drive to synchronize repositories across machines.
Don't do that!
This will surely lead to repository corruption unless you can guarantee that:
- Your machines will never lose internet connection
- You will never have new changes unsynchronized on more than one machine at a time (including times where you have had internet problems)
- That Dropbox will always run (variant of never lose internet connection)
- You're not just plain unlucky regarding timing
To verify that Dropbox can easily lead to repository corruption, do the following:
- Navigate to a folder inside your Dropbox or Google Drive folder and create a Mercurial repository here. Do this on one machine, let's call this machine A.
- Add 3 text files to it, with some content (not empty), and commit those 3 text files.
- Wait for Dropbox/Google Drive to synchronize all those files onto your second computer, let's call this machine B
- Either disconnect the internet on one of the machines, or stop Dropbox/Google Drive on it (doesn't matter which one)
- On Machine A, change file 1 and 2, by adding or modifying content in them. On Machine B, change file 2 and 3, making sure to add/modify in some different content from what you did on machine A. Commit all the changes on both machines.
- Reconnect to the internet or restart Dropbox/Google Drive, depending on what you did in step 4
- Wait for synchronization to complete (Dropbox will show a green checkmark in its tray icon, unsure what Google Drive will display)
- Run
hg verify
in the repositories on both machine A and B
Notice that they are now both corrupt:
D:\Dropbox\Temp\repotest>hg verify
checking changesets
checking manifests
crosschecking files in changesets and manifests
checking files
3.txt@?: rev 1 points to unexpected changeset 1
(expected 0)
3.txt@?: 89ab3388d4d1 not in manifests
3 files, 2 changesets, 6 total revisions
1 warnings encountered!
2 integrity errors encountered!
Instead get a free bitbucket or kiln account and use that to push and pull between to synchronize across multiple computers.