1. 7

  2. 6

    As a former Mercurial developer, i have to say the datastructure used by Mercurial is really nice, as long as you consider it immutable, append-only storage. There are a few problems with it. Firstly, you need to keep track of ongoing transaction and rollback accordingly. If a user CTRL-C+CTRL-C out of a Mercurial transaction, it can leave the repository in a bad state. In Git this problem doesn’t arise, since objects are written to disk separately and only at the very end the pointer of master is atomically moved. Secondly, the Mercurial object storage is highly optimized for immutable data but the model becomes tricky to deal with when you need to rewrite history. This required stripping a changelog to the previous point and reapply all changes after a given change. This can become very slow in large repositoires and is very error prone, hence hg histedit took a long time to stabelize. The Git model of taking basically what is a filesystem snapshots, is more suitable for rewriting as a ton of objectes can be reused in this case, unlike in Mercurial. As a drawback on the git model is that you have to deal wtih more complex datastructures for more optimized storage (packs)