[PATCH RFC] update: add an option to allow to merge local changes when crossing branches

Martin Geisler martin at geisler.net
Wed Mar 13 13:07:55 CDT 2013


Pierre-Yves David <pierre-yves.david at logilab.fr> writes:

> On Fri, Feb 22, 2013 at 11:22:07AM +0100, Gilles Moris wrote:
>> # HG changeset patch
>> # User Gilles Moris <gilles.moris at free.fr>
>> # Date 1361528509 -3600
>> # Node ID 567106adefd309717d8f0538197dc7dde45d34f1
>> # Parent  013fcd112f13f31a35ea6a40d8cd1c6923cdaf20
>> update: add an option to allow to merge local changes when crossing branches
>
> Let's sum up my opinion on that:
>
> 1) We cannot have this behavior by default. preventing such update by default
>    frequently save my changes.
>
>    The same as mercurial prevent multiple operation in the middle of
>    merge or a rebase.
>
>    We need more of such safety

Looking at this again, I realized that I have never understood the idea
behind the --check option. I looked at the code and saw that 'hg update'
takes me to the tip of the current *named* branch.

That's often, but not always what I want -- instead I want 'hg update'
to take me to 'max(.:: and branch(.))', which should be the tip of the
current *topological* branch.

Letting 'hg update' update me to some random head of my named branch
does indeed sound bad, so the --check option makes some kind of sense.
Not much sense, though: adding --check will let me update to some other
revision, but I probably don't know which revision without looking at
some log viewer first, and then I would use 'hg update REV' *anyway*.

To put it differently: if 'hg update' aborts because I should use 'hg
update --check' instead, then 'hg update <CUR-BRANCH>' would give the
same result. That's how I use update 98% of the time: to update to some
named branch. The other 2% I use an explicit revision that I've looked
up somewhere.


So when do you guys really use 'hg update' (without a branch name or
revision number argument)? When do you then use 'hg update --check'?

-- 
Martin Geisler
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130313/6f340a2e/attachment.pgp>


More information about the Mercurial-devel mailing list