I am not having any luck using Bookmarks in Mercurial for Git like branching.
From the article: http://mercurial.selenic.com/wiki/BookmarksExtension, I've set "track.current" to true in my .hgrc file.
Excerpt below:
By default, when several bookmarks point to the same changeset, they will all move forward together. It is possible to obtain a more Git-like experience by adding the following configuration option to your .hgrc
[bookmarks] track.current = True
However, as soon as I start trying to do parallel / independent development on more than one bookmark, then switch back and forth between the bookmarks, I run into the following:
abort: crosses branches (use 'hg merge' or 'hg update -C')
Example to reproduce:
# Make a new directory and Mercurial repository
$ mkdir bookmark
$ cd bookmark
$ hg init
# Create two bookmarks
$ hg bookmark bk1
$ hg bookmark bk2
# Checkout bk1
$ hg update bk1
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
# Create and commit a file to bk1
$ touch bk1.txt
$ hg add
adding bk1.txt
$ hg commit -m "bk1 file"
# Checkout bk2
$ hg update bk2
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
# Create and commit a file to bk2
$ touch bk2.txt
$ hg add
adding bk2.txt
$ hg commit -m "bk2 file"
created new head
# Checkout bk1
$ hg up bk1
abort: crosses branches (use 'hg merge' or 'hg update -C')
Is this normal behavior, for there to be "crosses branches" forcing a merge or file overwrite, when moving between bookmarks?
For a 'Git-like experience' I would expect to be able to flick back and forth between bk1 and bk2, committing and developing on either, merging if and when I needed to.