I'm about to convert my git repo into a hg repo. The problem is that a few months ago there was a file added named 'favicons/Icon\r' to the git repo, which is fine for git. The file has been deleted, but since it is in the history I get this output when running the hg convert extension:
abort: '\n' and '\r' disallowed in filenames: 'favicons/Icon\r'!
Since that path-name is invalid in Mercurial, you must do one or more of the following:
The first two may be easy to achieve directly using
hg convert. For instance, the documentation mentions the ability to exclude or rename files by file-name. I have not actually tried this myself, though.
The last is relatively easy since you can use
git filter-branch to achieve it. The "relative" in "relatively easy" is very relative:
filter-branch is not particularly easy to use correctly (it's just easier than writing a new Git-to-Mercurial converter).
See How to remove/delete a large file from commit history in Git repository? and Completely remove file from all Git repository commit history for examples. Note that Greg Bacon's answer correctly uses
--tag-name-filter to adjust tags (this is necessary if you have tags that point into history at or beyond the point at which commits are altered during the copying).