title: Mercurial: allow merge from a release branch to the default one, but not vice versa
body: <p>I'm using <code>default</code> branch for ongoing development, and now going to create a new named branch to mark a release. All further development will be on the default branch, all production bugfixes will be done on the new one (with subsequent merge to <code>default</code>), like this:</p>
  
  <pre><code>#&gt;hg branches
     aristotle   42:dbd...
     default     41:da5...
  #&gt;hg branch
     default
  #&gt;echo "Feature #1 for the next release" &gt;&gt; feature1.txt
  #&gt;hg add
  #&gt;hg commit -m "Implement feature #1 for the next release" 
  
  ...... eek, need to make an urgent fix on Production .....
  
  #&gt;hg update aristotle
  #&gt;echo "Fixed urgent bug #123 on Production" &gt;&gt; fix123.txt
  #&gt;hg add
  #&gt;hg commit -m "Fixed bug #123 on Production" 
     created new head
  #&gt;hg update default
  #&gt;hg merge aristotle
     1 files updated, 0 files merged, 0 files removed, 0 files unresolved
     (branch merge, dont forget to commit)
  #&gt;hg commit -m "Merge in the fix for bug #123"
  #&gt;hg push
  </code></pre>
  
  <p>The above seems the way to go, <strong>however it seems easy to mess things up and merge the other way around</strong> (from <code>default</code> to <code>aristotle</code> which means all the new features will appear in the production branch).</p>
  
  <p>Maybe my fears are groundless because one will notice the mess before pushing the commit to the central repo, but I'd like to see if it's possible to make the approach more foolproof.</p>
  
  <p>So I started looking into hooks:</p>
  
  <pre><code>[hooks]
  pretxnchangegroup.branch = hg heads --template "{branches} " | find "aristotle" &amp;&amp; exit 1 || exit 0
  </code></pre>
  
  <p>..but then realized it's not what I need, because this will not allow me to push aristotle changes at all.</p>
  
  <p>So I'm not sure what to do. Ideally, I want developers to see the "wrong way merge" message when they attempt to commit a merge from <code>default</code> to <code>aristotle</code> <strong>locally</strong> (obviously, there should be a double-check on the central repo), while merging from production branch to the default one should be possible.  </p>
  
  <p>Thanks!</p>