title: How to correctly close a feature branch in Mercurial?
body: <p>I've finished working on a feature branch <code>feature-x</code>. I want to merge results back to the <code>default</code> branch and close <code>feature-x</code> in order to get rid of it in the output of <code>hg branches</code>.</p>
  
  <p>I came up with the following scenario, but it has some issues:</p>
  
  <pre><code>$ hg up default
  $ hg merge feature-x
  $ hg ci -m merge
  $ hg up feature-x
  $ hg ci -m 'Closed branch feature-x' --close-branch
  </code></pre>
  
  <p>So the <code>feature-x</code> branch (changests <code>40</code>-<code>41</code>) is closed, but there is <em>one new head</em>, the closing branch changeset <code>44</code>, that will be listed in <code>hg heads</code> every time:</p>
  
  <pre><code>$ hg log ...
  o  44 Closed branch feature-x
  |
  | @  43 merge
  |/|
  | o  42 Changeset C
  | |
  o |  41 Changeset 2
  | |
  o |  40 Changeset 1
  |/
  o  39 Changeset B
  |
  o  38 Changeset A
  |
  </code></pre>
  
  <p><strong>Update</strong>: It appears that since version 1.5 Mercurial doesn't show heads of closed branches in the output of <code>hg heads</code> anymore.</p>
  
  <p>Is it possible to close a merged branch without leaving one more head? Is there more correct way to close a feature branch?</p>
  
  <p>Related questions:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/3638987/is-there-a-downside-to-this-mercurial-workflow-named-branch-dead-head">Is there a downside to this Mercurial workflow: named branch "dead" head?</a></li>
  </ul>