title: Mercurial: How to push a bookmarked changeset which creates a new remote head as if I was pushing a new branch?
body: <p><H1>General question.</H1></p>
  
  <p>I'm trying to use bookmarks instead of branches in mercurial. The reason of it is that I don't want to have a lot of unnecessary fixed-named permanent items in <strong>branches</strong>.</p>
  
  <p>The problem appears when I use a separate bookmark for a new feature development and I want to push it to the out repository. Well, <strong>hg</strong> doesn't allow me to push if creates 'new remote head'. What should I to to be able to make such a push as if I was creating a new branch?</p>
  
  <p><H1>Example (a way to reproduce the problem).</H1></p>
  
  <p>Alice creates repository:</p>
  
  <pre><code>C:\TestHg&gt;mkdir Alice
  C:\TestHg&gt;cd Alice
  C:\TestHg\Alice&gt;hg init
  C:\TestHg\Alice&gt;echo line1&gt;&gt;file.txt
  C:\TestHg\Alice&gt;hg addremove
  adding file.txt
  C:\TestHg\Alice&gt;hg commit -m "Initial commit."
  </code></pre>
  
  <p>Bob clones Alice's repository:</p>
  
  <pre><code>C:\TestHg\Alice&gt;cd ..
  C:\TestHg&gt;hg clone Alice Bob
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  </code></pre>
  
  <p>Alice makes some changes in the code of the project:</p>
  
  <pre><code>C:\TestHg&gt;cd Alice
  C:\TestHg\Alice&gt;echo line2 by Alice&gt;&gt;file.txt
  C:\TestHg\Alice&gt;hg commit -m "Alice continues her work on the project."
  </code></pre>
  
  <p>Bob starts his work on New Cool Feature using a separate bookmark to identify his independent 'branch' of work:</p>
  
  <pre><code>C:\TestHg\Alice&gt;cd ..\Bob
  C:\TestHg\Bob&gt;hg bookmarks
  no bookmarks set
  C:\TestHg\Bob&gt;hg bookmark NewCoolFeature
  C:\TestHg\Bob&gt;hg bookmarks
   * NewCoolFeature            0:792db6cfc262
  C:\TestHg\Bob&gt;echo line2 by Bob (as a part of New Cool Feature implementation)&gt;&gt;file.txt
  C:\TestHg\Bob&gt;hg commit -m "Bob starts his work on New Cool Feature"
  </code></pre>
  
  <p>Bob tries to push his changes to Alice's directory:</p>
  
  <pre><code>C:\TestHg\Bob&gt;hg push -B NewCoolFeature
  pushing to C:\TestHg\Alice
  searching for changes
  abort: push creates new remote head 38506e28a438!
  (you should pull and merge or use push -f to force)
  </code></pre>
  
  <p>Ok, first Bob has to pull Alice's changes to his own repository:</p>
  
  <pre><code>C:\TestHg\Bob&gt;hg pull
  pulling from C:\TestHg\Alice
  searching for changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files (+1 heads)
  (run 'hg heads' to see heads, 'hg merge' to merge)
  </code></pre>
  
  <p>Well, now Bob has two heads in his repository which is fine.</p>
  
  <pre><code>C:\TestHg\Bob&gt;hg glog
  o  changeset:   2:66beef200ba4
  |  tag:         tip
  |  parent:      0:792db6cfc262
  |  user:        Alice
  |  date:        Sun May 20 13:10:04 2012 +0400
  |  summary:     Alice continues her work on the project.
  |
  | @  changeset:   1:38506e28a438
  |/   bookmark:    NewCoolFeature
  |    user:        Bob
  |    date:        Sun May 20 13:12:26 2012 +0400
  |    summary:     Bob starts his work on New Cool Feature
  |
  o  changeset:   0:792db6cfc262
     user:        Alice
     date:        Sun May 20 13:08:39 2012 +0400
     summary:     Initial commit.
  </code></pre>
  
  <p>After trying to make one more push Bob is asked for merge. <strong>Bob doesn't want to make the merge, because his results of work on New Cool Feature are not ready yet for the merge.</strong></p>
  
  <pre><code>C:\TestHg\Bob&gt;hg push -B NewCoolFeature
  pushing to C:\TestHg\Alice
  searching for changes
  abort: push creates new remote head 38506e28a438!
  (did you forget to merge? use push -f to force)
  </code></pre>
  
  <p><H1>Example related question.</H1></p>
  
  <p><strong>What should Bob do to be able to push his changes to Alice's repo as if his changes are in a separate branch?</strong></p>
  
  <p><H1>Updates</H1></p>
  
  <p><strong>UPD1: In a real life situation Alice's repo is used as a central sync point for all members of the development team.</strong></p>