Search code examples
gitversion-controlmercurial

What does it mean that Mercurial stores branch information as a permanent part of each commit?


My understanding is that Git is sort of a linked list when each node is a self-sufficient object that has all information about the commit such as differences between current and previous commits.

I thought that Mercurial is also sort of a linked list. But, then I read that mercurial stores branch information as a permanent part of each commit and therefore branches cannot be removed

What does that mean "cannot be removed"? How the commits are stored then, like a huge one node?


Solution

    1. Both Git and HG use DAG (Directed Acyclic Graph) topology, which is not just "linked list"
    2. Yes, in core Mercurial (not in evolve extension in game) existing branches can't be removed (see hg help branch), but it's nohow related to storing additional metadata (branch-name) in changeset