Ignoring changed files

Steve Borho steve at ageia.com
Mon Dec 4 23:31:54 UTC 2006


On Monday 04 December 2006 4:24 pm, Giorgos Keramidas wrote:
> On 2006-12-04 14:33, Steve Borho <steve at ageia.com> wrote:
> > On Sunday 03 December 2006 11:37 am, Alexis S. L. Carvalho wrote:
> > > Thus spake Steve Borho:
> > > > 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).
> >
> > This did work as advertised, thanks.
>
> This is such a useful tip, for a problem which can bite people using
> MQ so often, that it deserves a place in the wiki, if it's not
> already there.  I can't do this tonight (i.e. if you beat me to it it
> should be fine), but can you please check that this is listed in a
> promiment place in the MQ section of the wiki and add it if it's not
> already there?

It's such a common problem that I wonder if it should be enforced 
internally.  Mercurial will prevent you from commiting any local 
changes on top of a patch changeset.  Why not prevent the user from 
pulling changes on top of a patched changeset?

% hg qpush
applying patch0
% echo foo >> file.txt
% hg commit -m "foo"
abort: cannot commit over an applied mq patch

-- 
Steve Borho (steve at ageia.com)
http://www.borho.org/~steve/steveAgeia.asc
Key fingerprint = 3D9C 67D5 F426 4322 075B  0795 C9B2 C3A0 97D0 C090



More information about the Mercurial mailing list