hg-fast-export: add support for --flatten option
When Git initially creates a ref, it stores a file in the file
system with the same name as the ref. If the ref contains '/'
characters, then the created file will have a path involving more
than one directory.
Unfortunately this means that Git cannot simultaneously create,
for example, a ref named 'refs/heads/master' and one named
'refs/heads/master/default'. This would require 'master' to be
both a file and a directory.
On the other hand, hg tags do not have this restriction.
Add a new --flatten option that converts '/' characters to '_'
characters in ref names so that directory/file ref name conflicts
can be avoided. For example, given a 'master' and 'master/default'
tag, they would generate 'refs/heads/master' and
'refs/heads/master_default' ref names when --flatten is used
thereby avoiding the conflict.
The --flatten option may be required in order to successfully
convert hg source repositories containing these conflicts.