hg convert with filemap giving empty repository

805 views Asked by At

I have got a new repository converted from SVN. I want to minimize this repository further by removing unintended files. For that I am again converting the mercurial repository to a new one by using hg convert and the filemap parameter. So my filemap looks like this:

include a
rename a .

The command I am using is:

hg convert --filemap fm.txt . ../new_repo

This ends after full conversion as I can see in the console output.

But if I now check the content of the directory new repo, I can see only .hg files in there.

I ran hg update -C within the directory whic gives me one more file .hgtags

Can anyone please suggest what has gone wrong?

2

There are 2 answers

3
Lazy Badger On

In common, you done all correct (if directory a exist in source repo)

In my test for repository with directory lang, which I want to move into the root of new repo, I used filemap

include lang
rename lang .

identical to your filemap and got bare repository after converting (no files in Working Dir, only repository on .hg). Testing repository

hg log
changeset:   19:41e96453fa67
tag:         tip
...
changeset:   0:ba52ea5c5c1f

showed me all related hisory

hg up
1 files updated, 0 files merged, 0 files removed, 0 files unresolved

(without -C) brings all files into the Working Directory

SR>dir /B
.hg
UTF-8
0
Zoltán On

This answer was spot on: you don't actually create an empty directory, but a directory with a hidden .hg directory. If you run

hg update

in your target directory, you will have your target directory with all its contents as expected.