Convert from mercurial to Mercurial two times
Ithier de Lestrange
ithier.de.lestrange at gesco.fr
Thu Dec 31 10:44:26 CST 2009
Hi,
I have a project that depends on a library. Both are Mercurial
repositories. Recently I had to transfert files from the project to the
library while keeping the history of the files.
The solution that I found was to use the convert extension with a
filemap parameter to specify the files to transfert. This work great the
first time, but then I had to transfert another file and it doesn't work
anymore.
Here is a complete example to reproduce the problem:
Create first repository and add two files
C:\Travail\hgtmp>hg init first
C:\Travail\hgtmp>cd first
C:\Travail\hgtmp\first>echo some text 1>file1.txt
C:\Travail\hgtmp\first>echo some other text 1>file2.txt
C:\Travail\hgtmp\first>hg commit -A -m "two files in first repo"
adding de file1.txt
adding de file2.txt
C:\Travail\hgtmp\first>cd..
Create second repository, activate convert extension and add a file
C:\Travail\hgtmp>hg init second
C:\Travail\hgtmp>cd second
C:\Travail\hgtmp\second>echo [extensions] 1>.hg\hgrc
C:\Travail\hgtmp\second>echo convert = 1>>.hg\hgrc
C:\Travail\hgtmp\second>echo some more text 1>file3.txt
C:\Travail\hgtmp\second>hg commit -A -m "one file in second repo"
adding de file3.txt
Transfert file1.txt
C:\Travail\hgtmp\second>echo include file1.txt 1>import1
C:\Travail\hgtmp\second>hg convert --filemap import1 ../first .
scanning source...
sorting...
converting...
0 two files in first repo
C:\Travail\hgtmp\second>hg merge
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
C:\Travail\hgtmp\second>hg commit -m "transfert first file from first repo"
Transfert file2.txt
C:\Travail\hgtmp\second>echo include file2.txt 1>import2
C:\Travail\hgtmp\second>hg convert --filemap import2 ../first .
scanning source...
sorting...
converting...
C:\Travail\hgtmp\second>hg merge
abandoné: there is nothing to merge
As you can see, the second transfert does nothing and so the merge has
nothing to do.
What am I doing wrong ?
Thanks
Ithier
More information about the Mercurial
mailing list