title: Mercurial, "Branching with bookmarks"
body: <p>I read this document: <a href="http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/" rel="noreferrer">A Guide to Branching with Mercurial</a>, specifically the section titled <a href="http://stevelosh.com/blog/2009/08/a-guide-to-branching-in-mercurial/#branching-with-bookmarks" rel="noreferrer">Branching with Bookmarks</a>.</p>
  <p>It says:</p>
  <blockquote>
  <p>Now you’ve got two bookmarks (essentially a tag) for your two branches at the current changeset.</p>
  <p>To switch to one of these branches you can use <code>hg update feature</code> to update to the tip changeset of that branch and mark yourself as working on that branch. When you commit, it will move the bookmark to the newly created changeset.</p>
  </blockquote>
  <p>I tried this, but it ended up moving both bookmarks at the same time.</p>
  <p>Is that guide wrong, outdated, or did I do something wrong? Note that I know that having bookmarks on separate branches only moves the bookmark related to the branch I'm currently working on, but that guide (which a lot of people says is the definite guide to this) specifically says the above text, which indicates that it should've worked by &quot;telling&quot; Mercurial which bookmark (branch) I'm working on.</p>
  <p>Testing shows otherwise though.</p>
  <p>Any ideas?</p>
  <p>Example:</p>
  <pre>
  &gt; hg init
  &gt; echo 1 &gt;test.txt
  &gt; hg commit -m "initial" --addremove
  adding test.txt
  
  &gt; hg bookmark main
  &gt; hg bookmark feature
  &gt; hg log
  changeset:   0:c56ceb49ee20
  tag:         feature
  tag:         main
  tag:         tip
  user:        Lasse V. Karlsen &lt;lasse@vkarlsen.no&gt;
  date:        Tue Nov 30 23:06:16 2010 +0100
  summary:     initial
  
  &gt; hg update feature
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  
  &gt; echo 2 &gt;test2.txt
  &gt; hg commit -m "feature 1" --addremove
  adding test2.txt
  
  &gt; hg log
  changeset:   1:9f2f5869b57b
  tag:         feature                             &lt;---- both were moved
  tag:         main                                &lt;----
  tag:         tip
  user:        Lasse V. Karlsen &lt;lasse@vkarlsen.no&gt;
  date:        Tue Nov 30 23:06:45 2010 +0100
  summary:     feature 1
  
  changeset:   0:c56ceb49ee20
  user:        Lasse V. Karlsen &lt;lasse@vkarlsen.no&gt;
  date:        Tue Nov 30 23:06:16 2010 +0100
  summary:     initial</pre>