user2444298
user2444298

Reputation: 37

merging same file with mercurial

Ok so I've done a lot off reading and watching of videos but I am still struggling with merging and how its handled i am currently using sourcetree and commandline for most of my testing.

So the question is when two users edit the same file but the edits conflict how is that conflict resolved and how does the repository handle it (it seems to accept both edits and leaves it up to the admit to resolve)

Just to give an example

Numbers.txt(original)

line 1: 1,2,3,4,5

Numbers.txt(edit1)

line 1: 1.0,2.0,3.0,4.0,5.0

Numbers.txt(edit2)

line 1: 1.00,2.00,3.00,4.00,5.00

so how is this conflict resolved through mercurial or the GUI sourcetree?

Upvotes: 0

Views: 39

Answers (2)

Dimitri Dewaele
Dimitri Dewaele

Reputation: 10659

This conflict is not resolved by the Mercurial Merge engine.

  • The first user that commit's his work has the easy job.
  • The second user has the job to merge both versions, possibly contacting the first user.

When the second user has finished merging, then he can commit and the job is done.

Advise: make sure you are the first to commit!

Upvotes: 0

Lazy Badger
Lazy Badger

Reputation: 97270

how is this conflict resolved through mercurial or the GUI sourcetree?

By hand, with user choice and intervention

When both changes will be collected in some common repository, this repository will have two independent heads with common parent (and diverged history).

At merge heads stage (back to single head) conflict will be detected and merge-master must to make choice, what to have in merge-result

HTH

Upvotes: 1

Related Questions