"hg convert --filemap" and include directive

Matt Mackall mpm at selenic.com
Tue Jan 20 22:30:41 UTC 2015


On Mon, 2015-01-19 at 15:16 -0800, Ernie Rael wrote:
> Greetings,
> 
> Before I start digging and trying stuff, I'm hoping for some 
> clarification...
> 
> Online wiki says
> 
>     The include directive causes a file, or all files under a directory,
>     to be included in the destination repository, and the exclusion of
>     any other element that's not under an inclusion rule.
> 
> and in "hg help convert" it says
> 
>       If there are any "include" statements, nothing else is included.
> 
> These two statements agree. But in the wiki there is an example:
> 
>     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. But the example's 
> statement of intent, and indicated by the exclude statement, is to 
> import all files except doc.
> 
> Also in the example there is the rename statement, the help  says
> 
>     The "rename" directive renames a file or directory if it is converted.
> 
> Since "doc/FAQ" is excluded and not included, I would not expect it to 
> be converted and thus there would be nothing to rename. Does the rename 
> have an implicit include for the path/to/source?

No one is likely to know off the top of their heads. I recommend you
test the example and fix the wiki if it's wrong.

This is a great example of why I push back forcefully on suggestions
that we have an "include" syntax in .hgignore: combined include/exclude
rules always create confusion.

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list