Unnecessary merges?

Kevin Bullock kbullock+mercurial at ringworld.org
Fri Nov 22 10:27:38 CST 2013


On Nov 21, 2013, at 8:10 AM, David Smith <dsmith at travelrepublic.co.uk> wrote:

> Hi,
>  
> I have two repositories A and B.
>  
> I have pulled B into A.
>  
> For a given file on A hg log returns
>  
> changeset:   40967:d7f84148b444
> parent:      40966:afbd3f7ddeea
> parent:      40730:8658f8a70bd5
> user:        anon <anon at outlook.com>
> date:        Tue Nov 05 11:52:13 2013 +0000
> summary:     merge from B
>  
> changeset:   40894:7f667abe8948
> user:        anon
> date:        Wed Oct 16 11:53:13 2013 +0100
> summary:     Refactored some code
>  
> and on B hg log returns
>  
> changeset:   40570:d7f84148b444
> parent:      40402:afbd3f7ddeea
> parent:      40569:8658f8a70bd5
> user:        anon <anon at outlook.com>
> date:        Tue Nov 05 11:52:13 2013 +0000
> summary:     merge from B
>  
> changeset:   39676:7f667abe8948
> user:        anon
> date:        Wed Oct 16 11:53:13 2013 +0100
> summary:     Refactored some code
>  
> The two graphs appear identical and there are no commits in A for the file that aren't in B and vice versa.
>  
> However merging the two heads in A requires a conflict to be resolved for this file.
>  
> I guess (I hope) I'm missing something. What cases could cause Mercurial to think it needs to merge these two graphs?

Because you have two heads. You now have precisely the same 2 heads in A as in B—you have fully synchronized their history—but that history has more than one head in it. Pulling doesn't change that (unlike in Git, a pull does not also imply a merge). `hg log --graph` will help you visualize this.

pacem in terris / мир / शान्ति / ‎‫سَلاَم‬ / 平和
Kevin R. Bullock

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial/attachments/20131122/b2fc4f18/attachment.html>


More information about the Mercurial mailing list