Whether cloning is recommended way of branching in Mercurial or not?
dvcs, git, mercurial, version-control
Solution
The article to which you link was written in 2008, that's 5 years ago, and it was inaccurate then. Steve's article to which you link:
http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/
is much better, and while it was written in 2009 it's been routinely updated. It clearly shows that Mercurial can do git-style branches (it calls them "bookmarks"), or clones as branches, or named branches (which git lacks) or anonymous branches (which git lacks).
The Mercurial developers themselves use various types for various purposes as described here: https://www.mercurial-scm.org/wiki/StandardBranching
Which roughly boils down to:
- named branches for `stable` and `release`
- bookmark (git-style) branches for individual features
- clones for different access groups (crew vs. matt's repo)
Problem
In this article author says: I was naive enough to think that branches living in entirely different directories was a thing of the past. How SVN of them. I cannot imagine living my life making local clones to effectively deal with long running branches. The book literally says: "In most instances, isolating branches in repositories is the right approach." Um, no thank you. It turns out that the more I get into branching stuff, the more I understand why they advocate that you clone to branch. Everything is on one track - you can't commit something and then easily leave it there for work later and ignore it for the time being, which is what I use branches mainly for. It's like Mercurial is a one-track mixer... and so on. In other source, for which I cant find link now, I read, that Mercurial developers use cloning for branching. It is strange for me that in Mercurial, where branching is 'first-class' concept - branches can be created just by commits from non-heading revisions - cloning linear repository is mainstream way of branching. Is it true at all? Or probably it was true in the pas? What history this issue have? ps I remembered where I noticed words about that Hg devs use cloning - it is popular Steve Losh's article: I personally don’t like this method and don’t use it. Others do though, so it’s good to understand it (Mercurial itself uses this model).