minirst: use unicode string as intermediate form for replacement
Some character encodings use ASCII characters other than
control/alphabet/digit as a part of multi-bytes characters, so direct
replacing with such characters on strings in local encoding causes
invalid byte sequences.
subrepo: fix recording of + in .hgsubstate (
issue2217)
mq: qimport cleanup on fail (
issue2214)
save state of successfully added patches and ensure
cleanup on the way out.