Вы держите пари!Вот краткий ответ: https://www.mercurial -scm.org / wiki / MergingUnrelatedRepositories
Допустим, у вас есть два хранилища
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 3/24/2011 7:33 AM r1
d---- 3/24/2011 7:35 AM r2
Вот r1:
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 3/24/2011 7:33 AM .hg
-a--- 3/24/2011 7:33 AM 85 file1.txt
Вот r2:
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 3/24/2011 7:35 AM .hg
-a--- 3/24/2011 7:33 AM 89 file2.txt
Мы создадим еще один репозиторий под названием «объединенный», клонируя «r1».
$>hg clone r1 merged
updating to branch default
resolving manifests
getting file1.txt
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$>cd merged
Теперь нам нужно вытащить «r2»."in:
$>hg pull -f ..\r2
pulling from ..\r2
searching for changes
warning: repository is unrelated
2 changesets found
adding changesets
adding manifests
adding file changes
added 2 changesets with 2 changes to 1 files (+1 heads)
(run 'hg heads' to see heads, 'hg merge' to merge)
Наконец, нам нужно объединить их и зафиксировать изменения:
$>hg merge
resolving manifests
getting file2.txt
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
$>hg commit -m "Merged two both repos"
file2.txt
committed changeset 4:40028ef336d9
Все готово!Вот наше объединенное репо:
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 3/24/2011 7:36 AM .hg
-a--- 3/24/2011 7:36 AM 85 file1.txt
-a--- 3/24/2011 7:36 AM 89 file2.txt
Давайте посмотрим, что у нас есть в истории ...
$>hg log
changeset: 4:40028ef336d9
tag: tip
parent: 1:464b7426220c
parent: 3:3b5eba6d03ef
user: Joe Schmoe <schomej@inter.net>
date: Thu Mar 24 07:36:58 2011 -0700
description:
Merged two both repos
changeset: 3:3b5eba6d03ef
user: Joe Schmoe <schomej@inter.net>
date: Thu Mar 24 07:35:02 2011 -0700
files: file2.txt
description:
Added second line to second file
changeset: 2:c26449adfb4d
parent: -1:000000000000
user: Joe Schmoe <schomej@inter.net>
date: Thu Mar 24 07:32:52 2011 -0700
files: file2.txt
description:
Added first line of second file
changeset: 1:464b7426220c
user: Joe Schmoe <schomej@inter.net>
date: Thu Mar 24 07:33:47 2011 -0700
files: file1.txt
description:
Added second line to first file
changeset: 0:51cb60e8a68a
user: Joe Schmoe <schomej@inter.net>
date: Thu Mar 24 07:31:59 2011 -0700
files: file1.txt
description:
Added first line to first file
Успех!