Ignoring changed files

Alexis S. L. Carvalho alexis at cecm.usp.br
Sun Dec 3 11:37:57 CST 2006


Thus spake Steve Borho:
> On Saturday 02 December 2006 03:22, Thomas Arendsen Hein wrote:
> > * Chui Tey <teyc at cognoware.com> [20061201 13:42]:
> <snip>
> > - Use the mq extension to track changes to config.php:
> >   $ hg qnew mylocalconfig
> >   $ $EDITOR config.php
> >   $ hg qrefresh
> >   Whenever you want to pull in new changes from the original
> >   repository, you need some extra steps:
> >   $ hg qpop -a  # removes your local config.php changes
> >   $ hg pull
> >   $ hg update
> >   $ hg qpush -a # adds your local config.php changes again
> >
> > Today I'm mostly using the mq solution.
> 
> 
> I use this solution as well.  The only drawback is that I sometimes forget the 
> qpop -a step and end up having to do some nasty things with clone -r to get 
> my repo in a sane state again.

I think a qpop -a should work even after the pull (but it will be a much
more complex operation).  If you've used hg update to jump to the new
tip, you may have to hg update qtop to jump back to the top of the patch
queue before the qpop -a.

> Is there some way to force the pull to fail if there are locally applied 
> patches?

Something like this should work (not really tested...):

[hooks]
prechangegroup.mq-no-pull = ! hg qtop > /dev/null 2>&1

qtop exits with status 0 if there are patches applied and 1 otherwise
(and hg exits with 255 if mq is not loaded).

Alexis


More information about the Mercurial mailing list