Search code examples
mercurial

Hg Mercurial over Google Drive issue


I have a Mercurial-Hg repository on a Google Drive folder. I use it as a base repo to be used on few computers. Using Tortoise-Hg in all of them.

It used to work fine like a charm, but last week I got a trouble I don't understand: doing normal operation (local commmit, hg push, hg pull from other local repo...) I got an error with Google Drive user. I fixed it and since then local repos diverge. I have tried many HG tricks (revert, back-out, creating new local repos...) but... the fact is:

  • In computer 1: I create a new clone and last rev is 314.

  • In computer 2: I create a new clone and last rev is 311. Last 3 revisions are missing!!! How is this possible?

Apparently Google drive folder is synchronized correctly (I tested it creating a new dummy file in computer 1 and having it synchronized to computer 2).

How is this possible? Any hint? Suggestions?


Solution

  • Self-answered question. Just in case it can be useful for someone else:

    @Lasse Vågsæther Karlsen comments are absolutely right:

    DO NOT under any circumstances use any kind of file-level synchronization tool, such as Dropbox, Google Drive, OneDrive, Jottacloud, or any other such tool, to synchronize distributed version control repositories between computers. [...]

    You should move your repository out of Google Drive, fix it, and then set up a proper distributed version control repository somewhere that you can push/pull against.

    Done! Cloned from one of the diverging Google drive folders Drive to a brand-new Bitbucket repo (configured as HG-Mercurial repo). It was very straight-forward to do.

    Then re-cloned back from Bitbucket to all the computers where the repo was used. Google Drive folders abandoned.

    Now all repos clones are working fine again! ...I wonder why I didn't do that before with this old repo. Actually I realize it's a MUST.