Completely baffled

Tom Anderson tom.anderson at e2x.co.uk
Tue Dec 6 19:18:02 UTC 2011


On 6 December 2011 18:03, Haszlakiewicz, Eric <EHASZLA at transunion.com> wrote:
>
>> > his changed file was simply replaced with the "current" version
>> > as part of the pull + update, and as a result of course disappeared from the
>> > list of files to be committed (as we have seen before).
>>
>> This is exactly to be expected activity IF the local changes had not
>> been committed. I've managed to do much the same myself ...
>
> It is *expected* that an update will overwrite your local changes?!  What are you smoking?
>
> What you're claiming directly contradicts what the help page for the "hg update" command states:
>  "...the uncommitted changes are merged into the requested changeset
>       and the merged result is left uncommitted."

Yeah, i was surprised to see that opinion. Here's a simple
illustration of that happening:

$ hg init mergeintoworking
$ cd mergeintoworking/
$ echo red >colour
$ echo apples >fruit
$ hg add .
adding colour
adding fruit
$ hg commit -m $SECONDS
$ echo blue >colour
$ hg commit -m $SECONDS
$ hg up 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo bananas >fruit
$ hg st
M fruit
$ hg up 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg st
M fruit
$ cat colour
blue
$ cat fruit
bananas

For those of you who are into point-scoring, this is something Git can't do.

tom

-- 
Tom Anderson         |                e2x Ltd, 1 Norton Folgate, London E1 6DB
(e) tom at e2x.co.uk    |    (m) +44 (7960) 989794    |    (f) +44 (20) 7100 3749



More information about the Mercurial mailing list