Ignoring changed files

Steve Borho steve at ageia.com
Tue Dec 5 06:02:19 UTC 2006


On Monday 04 December 2006 23:28, Theodore Tso wrote:
> On Mon, Dec 04, 2006 at 05:31:54PM -0600, Steve Borho wrote:
> > 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?
>
> Pulling is perfectly safe.  If there is a mq-patch changeset applied,
> then an "hg pull" will result in the new changesets creating a new
> head revision.  It's only if you do an "hg merge" followed by an "hg
> commit" that you will run into problems, and the "hg commit" will
> result in an error.  Hg probably shouldn't allow you to do the "hg
> merge", though.
>
> In contrast, an "hg push" to a remote repository is far more
> dangerous, since the mq changeset is potentially emphemeral and could
> change after the next "hg qrefresh", the result is a mess --- and it
> gets even worse if other people pull down the change from the remote
> repository and then commit on top of it.

Yes, this is similar to the scenario I run into a lot.  I'll pull from a 
repository which has mq-patches applied to it.  On this local repository the 
mq-patch changeset is not special in any way so hg allows me to commit over 
the top of it.  Pushing these changes back (or pulling back from the patched 
repo)  gets me into trouble.

It's mainly a symptom of sloppiness on my part as I experiment with mq and 
various import tools, trying to come up with workable solutions to my 
problems.  Once I get my process settled out, I imagine it won't be as much 
of a problem anymore.

You're right, it's only a problem if you're re-pulling from a repository that 
has pulled from a mq-patched repository.  In normal situations the pulled 
changesets would be on another head, ready to be merged after popping off all 
the patches.

The only way to make this safe would be to not allow the mq patch changesets 
to be pulled in the first place.  But in most situations you do want to allow 
them to be pulled, so I can't suggest any solution other than to be more 
careful :)

-- 
Steve Borho (steve at ageia.com)



More information about the Mercurial mailing list