"hg convert --filemap" and include directive

Mads Kiilerich mads at kiilerich.com
Wed Jan 21 04:43:12 UTC 2015


On 01/20/2015 11:29 PM, Ernie Rael wrote:
> On 1/19/2015 3:16 PM, Ernie Rael wrote:
>>
>>    For example, to import all files except doc subdirectory, but
>>    include doc/foo bar.txt and include doc/FAQ renaming it to faq, use:
>>
>>        # Documentation is to be converted to separate repository.
>>        exclude "doc"
>>        include "doc/foo bar.txt"
>>        rename "doc/FAQ" "faq"
>>
>> There is one, and only one, include statement and it is a file. 
>> According to docs, only this file should be converted.
>
> Sure enough, with the above example filemap from the wiki the 
> destination only gets a single file. The example can be made to work 
> since "include ." works. The example can be written as
>>        # Documentation is to be converted to separate repository.
>>        include "."
>>        exclude "doc"
>>        include "doc/foo bar.txt"
>>        include "doc/FAQ"
>>        rename "doc/FAQ" "faq"
> I'll update the wiki in a few days, unless I hear otherwise. The only 
> issue I can see is that "include ." working is an accident and 
> shouldn't be used in the example (in which case implementing the 
> example is tedious and can't be done without enumerating all the top 
> level files/directories).

The relevant code is at 
http://selenic.com/repo/hg/file/a43fdf33a6be/hgext/convert/filemap.py#l103 
. It confirms that rename info only is considered if the includes and 
excludes let the file be converted. I guess you are right that the wiki 
is wrong.

Please consider contributing an improvement to the help if you have 
ideas to how it can be described in a simpler and clearer way.

/Mads



More information about the Mercurial mailing list