开发者

Mercurial filemap exclude include... does it not do what docs say?

开发者 https://www.devze.com 2022-12-15 08:48 出处:网络
Converting from subversion, I take the opportunity to clean up the repo, and split it in three mostly开发者_运维百科 independent projects.But... I have a filemap that says

Converting from subversion, I take the opportunity to clean up the repo, and split it in three mostly开发者_运维百科 independent projects. But... I have a filemap that says

exclude bot
include bot/aobiosbot.py

Which should include everything, except the "bot" subdirectory, but still include the "aobiosbot.py" file in that directory. The trouble is, the converted repo is empty (I test with an "hg clone"). If I add an "include ." as line 1, I get everything but the "bot" dir... including "bot/aobiosbot.py". But I told it to include that file.

(Really, the docs for filemap are bad. Exclude/include options have to be specified exactly. I find I tend to agree with Joel on specs... at least here. Who'd'a thunk...)


Hrm, I'll admit to not being able to figure out why what you have isn't working, but I can confirm it's not.

However, with my test src repo like this:

src
|-- bot
|   |-- aobiosbot.py
|   `-- excludeme
`-- dir1
    `-- includeme

and a filemap like this:

include dir1
include bot/aobiosbot.py

I end up with this:

dest
|-- bot
|   `-- aobiosbot.py
`-- dir1
    `-- includeme

You could bulld that filemap quickly by doing this in the repo root:

for thefile in * .* ; do
     echo include $thefile >> ../filemap
done

I'm sure there's a better way using exclude, but without reading the code for convert I can't find it.


I've solved it by taking some code from the dev repo (file hgext/convert/filemap.py). Works lots better. :D

0

精彩评论

暂无评论...
验证码 换一张
取 消