Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial usage to merge multiple heads

Tags:

mercurial

I'm mercurial newbie and want to learn how to use my repository. Can you tell me how to merge my friend's work with mine? Thanks

$ hg update tip
abort: crosses branches (merge branches or use --clean to discard changes)

$ hg heads
changeset:   265:ac5d3c3a03ac
tag:         tip
user:        roberto.cr
date:        Thu Oct 06 07:32:15 2011 +0000
summary:     fixing "redirects" links

changeset:   261:6acd1aaef950
user:        niklasro
date:        Thu Oct 06 07:53:19 2011 +0000
summary:     auth backend + js

$ hg update
abort: crosses branches (merge branches or use --clean to discard changes)

Could I use hg resolve?

$ hg resolve
abort: no files or directories specified; use --all to remerge all file

$ hg glog | more
@  changeset:   266:2bf5b62720fc
|  tag:         tip
|  parent:      261:6acd1aaef950
|  user:        niklasro
|  date:        Thu Oct 06 12:48:20 2011 +0000
|  summary:     added
|
| o  changeset:   265:ac5d3c3a03ac
| |  user:        roberto.cr
| |  date:        Thu Oct 06 07:32:15 2011 +0000
| |  summary:     fixing "redirects" links
| |
| o  changeset:   264:2fd0bf24e90f
| |  user:        roberto.cr
| |  date:        Thu Oct 06 07:29:58 2011 +0000
| |  summary:     fixing "redirects" links
| |
| o  changeset:   263:29a373aae81e
| |  user:        roberto.cr
| |  date:        Thu Oct 06 07:25:05 2011 +0000
| |  summary:     fixing "redirects" links
| |
| o  changeset:   262:d75cd4d3e77a
| |  parent:      260:dfb54b99f84d
| |  user:        roberto.cr
| |  date:        Thu Oct 06 07:24:55 2011 +0000
| |  summary:     fixing "redirects" links
| |
o |  changeset:   261:6acd1aaef950
|/   user:        niklasro
|    date:        Thu Oct 06 07:53:19 2011 +0000
|    summary:     auth backend + js
|
o  changeset:   260:dfb54b99f84d
|  user:        niklasro
|  date:        Wed Oct 05 05:34:37 2011 +0000
|  summary:     FB buggfix example.html
|
o  changeset:   259:92fb6b1bc492
|  user:        niklasro
|  date:        Thu Sep 29 16:42:33 2011 +0000
|  summary:     changes

The solution was hg revert -a and it looks like a success now

$ hg glog | more
@    changeset:   267:3b2bb6de33eb
|\   tag:         tip
| |  parent:      266:2bf5b62720fc
| |  parent:      265:ac5d3c3a03ac
| |  user:        niklasro
| |  date:        Thu Oct 06 16:06:21 2011 +0000
| |  summary:     merge
| |
| o  changeset:   266:2bf5b62720fc
| |  parent:      261:6acd1aaef950
| |  user:        niklasro
| |  date:        Thu Oct 06 12:48:20 2011 +0000
| |  summary:     added
| |
o |  changeset:   265:ac5d3c3a03ac
| |  user:        roberto.cr
| |  date:        Thu Oct 06 07:32:15 2011 +0000
| |  summary:     fixing "redirects" links
| |
o |  changeset:   264:2fd0bf24e90f
| |  user:        roberto.cr
| |  date:        Thu Oct 06 07:29:58 2011 +0000
| |  summary:     fixing "redirects" links
| |
o |  changeset:   263:29a373aae81e
| |  user:        roberto.cr
| |  date:        Thu Oct 06 07:25:05 2011 +0000
| |  summary:     fixing "redirects" links
| |
o |  changeset:   262:d75cd4d3e77a
| |  parent:      260:dfb54b99f84d
| |  user:        roberto.cr
| |  date:        Thu Oct 06 07:24:55 2011 +0000
| |  summary:     fixing "redirects" links
| |
| o  changeset:   261:6acd1aaef950
|/   user:        niklasro
|    date:        Thu Oct 06 07:53:19 2011 +0000
|    summary:     auth backend + js
|
o  changeset:   260:dfb54b99f84d
|  user:        niklasro
|  date:        Wed Oct 05 05:34:37 2011 +0000
|  summary:     FB buggfix example.html
|
o  changeset:   259:92fb6b1bc492
|  user:        niklasro
|  date:        Thu Sep 29 16:42:33 2011 +0000
|  summary:     changes
like image 583
Niklas Rosencrantz Avatar asked Oct 06 '11 08:10

Niklas Rosencrantz


1 Answers

What about merging these two heads?

hg merge
like image 114
Andreas Avatar answered Oct 21 '22 14:10

Andreas