unclear test-merge5 and update -c

Adrian Buehlmann adrian at cadifra.com
Thu Sep 17 03:37:17 CDT 2009


On 17.09.2009 09:59, Gilles Moris wrote:
> This is related to a series of patch from Stuart Marks one month ago,
> about being able
> to update without option flag from a clean work tree:
> http://www.selenic.com/pipermail/mercurial-devel/2009-August/014835.html
>

Thanks for the pointer.

I have been biten by the -Cc combination already.

I recently tried to hop heads using hg up and forgot about some
local changes I made.

Reading 'hg help update', stupid as I am I erroneously concluded that
specifying -c would give me some sort of safety net. But it didn't.
Mercurial happily and silently blew away my local modifications, because
it gave preference to the -C switch.

If a stupid user (like myself) asks for the sledgehammer -C
but also says -c, mercurial could and probably should easily
assume that the user is not really clear about his intentions
and at least should refuse executing -C.

And mercurial should not recommend to use the sledgehammer -C
if -c would do (my patch I was trying to create).

> From the history, I think this was possible before cdc458b12f0f, but
> Matt then
> changed the logic, but did not update the comment in the output, so that
> the test
> is correct with the current logic (no update crossing heads of the same
> branch),
> but the comment is wrong.
>

If the logic is correct then at least the comment should be updated, yes.

But, IMHO, I have some doubts the logic is correct. The existence of the
second test case is a strong hint for that.


More information about the Mercurial-devel mailing list