hg convert - trying to move a directory from one repo to another

2.4k Views Asked by At

So I have a directory called flash. I'd like to move it totally from an existing Mercurial repo located at ~/wdm to another existing Mercurial repo, located at ~/wdm-js.

I've been told this is possible with hg convert, but I don't really know how this works. I have tried the following, but think I may have got something wrong.

Having read up on the hg convert for Mercurial docs, I've created a filemap, which reads as follows:

include flash

Then I've gone to ~/wdm and run the following command:

$ hg convert . ~/wdm-js --filemap ~/filemap.txt

I've seen a load of output as follows:

scanning source...
sorting...
converting...
413 [doc/design][m]: first stab at a design doc for model (sent to list).
[412 more history items]

So this looks fairly promising. But when I look at wdm-js there is no flash directory there. And none of the flash directory files have moved from the wdm directory. And the hg status of both repos looks no different.

Do I still have to copy the flash directory across manually, and hg add/hg remove all the files manually to both repos?

Or... should this have been done for me, meaning that I have messed up in some way?

2

There are 2 best solutions below

0
On

To copy into existing repository you need first copy flash folder into new repository as you did it with convert command and then push the changes from new repository into existing target repository.

3
On

hg convert doesn't update the working directory in the destination repository (it leaves it at the original null revision), so do a hg update there to see the files. Also, the way you ran it, it copies the files; you can either delete them from the original repository via hg forget or hg remove, or use hg convert again using a filemap with the line:

exclude flash