convert: clear the dirstate before a conversion, invalidate it afterwards
Clearing it before the conversion protects us from whatever data were
there (file copies in particular).
Invalidating it after the conversion avoids writing a possibly
inconsistent dirstate to disk.
abort: Failed to parse .../t/.hg/hgrc
File contains no section headers.
file: .../t/.hg/hgrc, line: 1
'invalid\n'