Why can't I merge when there are uncommitted outstanding changes?

Mike Meyer mwm at mired.org
Thu Apr 22 11:28:43 CDT 2010


On Thu, 22 Apr 2010 08:06:10 -0700 (PDT)
Aardwolf <toiletpot at gmail.com> wrote:

> Still, why do I encounter all these problems? Isn't it normal for a
> developer to have various files he doesn't want to (currently) commit? I
> know it is for me and most people here. There are so many reasons: partially
> wanting to commit some of your work while keeping the rest local due to
> still needing to work it out further. Local config file changes. Local test
> code, .... Why is hg made so inconvenient for this case?

Yes, it's normal. But I always treat it as a bad habit, and try and
break my users of it - even if we're using SVN or Perforce.  Actually,
*especially* if we're using SVN or Perforce, where committing the
files creates a backup on a different disk/machine.

While the trunk may (or may not, depending on policy) need to always
be production quality, that's no reason to deprive yourself of the
facilities of a VCS for non-trivial changes. Branches (or repo clones
in hg) are cheap, so you should feel free to create them for anything
that's going to take more than a day or so to complete. That way you
can check in code that's not fully functional, but has otherwise
reached a milestone, or just because it's the end of the day, or
whatever - without breaking the trunk. Those also make good times to
merge appropriate changes from the trunk.

As for other things: config files shouldn't be in the repo, and tests
should generally be committed along with the code they test - or on a
different branch if they're not ready for the trunk yet.

> Also, what's the point of actually creating branches and merges in the hg
> repository, just because someone else changed *different* files? The history
> could be perfectly linear there...

I, on the other hand, don't understand this desire for a history
that's perfectly linear - especially when said history is
revisionist. But that also seems to be a common desire among DVCS
users...

	<mike
-- 
Mike Meyer <mwm at mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org


More information about the Mercurial mailing list