merge - Why is mercurial dumb when merging? How can I make pulling/merging changes simpler? -


i started use mercurial , think i'm trying simple, should quite typical, i'm stumped on why it's complicated, , why doesn't work way should (imo).

i share repository friend, makes changes , checks in several files , pushes them. in svn i'm used updating working copy , getting changes, no hassle. mercurial apparently have merge. don't is: shouldn't mercurial smart enough figure out if friend made recent changes, , haven't touched files, should use version of file?? apparently can't figure out, , instead tries merge files utterly fails (actually have installed beyond compare automatically opened, can't blame mercurial entirely bad merge).

at rate, don't know why has "merge" files when it's obvious (to me) should have taken remote (i.e. recent) changes. doing wrong in how i'm using tool, or there can make work in simpler way (the way i'm used working in subversion)... there configuration settings, tips on command line flags can use have work better?

you need merge if you've committed in repository well. if share repository friend, commits 1 or more times while you're not doing anything, when he's done have pull , update, no merging.

if you've done local commits, here's how scenario unfolds:

local:    1---2---3---4 central:  1---2---3---4 friend:   1---2---3---4 

he commits:

local:    1---2---3---4 central:  1---2---3---4 friend:   1---2---3---4---5---6 

you commit:

local:    1---2---3---4---x---y central:  1---2---3---4 friend:   1---2---3---4---5---6 

he pushes:

local:    1---2---3---4---x---y central:  1---2---3---4---5---6 friend:   1---2---3---4---5---6 

you pull:

local:    1---2---3---4---x---y                        \                         +-5---6  central:  1---2---3---4---5---6 friend:   1---2---3---4---5---6 

you merge:

local:    1---2---3---4---x---y---7                        \         /                         +-5---6-+  central:  1---2---3---4---5---6 friend:   1---2---3---4---5---6 

then push , pulls, , repositories identical.

however, if haven't done while has worked on project, here's how scenario unfolds:

local:    1---2---3---4 central:  1---2---3---4 friend:   1---2---3---4 

he commits:

local:    1---2---3---4 central:  1---2---3---4 friend:   1---2---3---4---5---6 

he pushes:

local:    1---2---3---4 central:  1---2---3---4---5---6 friend:   1---2---3---4---5---6 

you pull , update:

local:    1---2---3---4---5---6 central:  1---2---3---4---5---6 friend:   1---2---3---4---5---6 

the reason different how subversion did subversion had centralized repository had talk to.

as such, when got around committing local changes, subversion client "sorry, need update before can commit", , had execute update.

if, @ point, have changed files changed in central repository, subversion merge local changes server changes , update revision point tip. if there no conflicts, silent merge, otherwise merge conflicts.

mercurial exact same thing, except merge not silent. can both commit individually, in own local repositories, without ever talking each other, when try integrate changes 1 common repository, need merge. mercurial never changes existing changesets (unless use extensions history editing) cannot automatically figure out how parallell changesets work together.

if 2 haven't worked on same files, or changes you've done same files not in conflict each other, merge few clicks away , you're done.

in case, mercurial got many options, distributed part changes how need think history.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -