title: Mercurial hook not executing properly
body: <p>This should be a very simple thing to have run, but for some reason it won't work with my Mercurial repository. All I want is for the remote repo to automatically run <code>hg update</code> whenever someone pushes to it. So I have this in my .hg/hgrc file:</p>
  
  <pre><code>[hook]
  changegroup = hg update
  </code></pre>
  
  <p>Simple, right? But for some reason, this never executes. I also tried writing a shell script that did this. .hg/hgrc looked like this:</p>
  
  <pre><code>[hooks]
  changegroup = /home/marc/bin/hg-update
  </code></pre>
  
  <p>and hg-update looked like this:</p>
  
  <pre><code>#!/bin/sh
  hg help &gt;&gt; /home/marc/works.txt;
  hg update &gt;&gt; /home/marc/works.txt;
  exit 0;
  </code></pre>
  
  <p>But again, this doesn't update. The contents of <code>hg help</code> are written out to <code>works.txt</code>, but nothing is written out for <code>hg update</code>. Is there something obvious I'm missing here? This has been plaguing me for days and I just can't seem to get it to work.</p>
  
  <p><strong>Update</strong></p>
  
  <p>Okay so again, using the <code>-v</code> switch on the command line from my workstation pushing to the remote repo doesn't print any verbose messages even when I have those <code>echo</code> lines in <code>.hg/hgrc</code>. However, when I do a push from a clone of the repo on the same filesystem (I'm logged in via SSH), this is what I get:</p>
  
  <pre>
  bash-3.00$ hg -v push ../test-repo/
  pushing to ../test-repo/
  searching for changes
  1 changesets found
  running hook prechangegroup: echo "Remote repo is at `hg tip -q`"
  echo "Remote repo wdir is at `hg parents -q`"
  Remote repo is at 821:1f2656753c98
  Remote repo wdir is at 821:1f2656753c98
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files
  running hook changegroup: echo "Updating.... `hg update -v`"
  echo "Remote repo is at `hg tip -q`"
  echo "Remote repo wdir is at `hg parents -q`"
  Updating.... resolving manifests
  getting license.txt
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  Remote repo is at 822:389a6c7276c6
  Remote repo wdir is at 822:389a6c7276c6
  </pre>
  
  <p>So it works, but again only when I push from the same filesystem. It doesn't work if I try pushing to the repo from another workstation over the network.</p>