Search code examples
mercurialarchive

mercurial: excluding .hg files with archive


I am running:

hg archive --exclude .hg ../rdiff-backup-fs-1.0.0b3

trying to export files for a package without adding .hg files. I get:

abort: path contains illegal component: .hg

What am I doing wrong? I am trying to exclude files .hgtags and .hg_archival.txt.

EDIT OK, I'm an idiot. You need to specify the whole pattern, not just the prefix.


Solution

  • Option -X requires full name, rather than only a prefix. Therefore I had to use -X .hgtags.