--- a/hgext/convert/darcs.py Sat Sep 11 00:39:34 2010 +0200
+++ b/hgext/convert/darcs.py Fri Sep 10 09:30:50 2010 -0500
@@ -83,6 +83,8 @@
shutil.rmtree(self.tmppath, ignore_errors=True)
def xml(self, cmd, **kwargs):
+ # NOTE: darcs is currently encoding agnostic and will print
+ # patch metadata byte-for-byte, even in the XML changelog.
etree = ElementTree()
fp = self._run(cmd, **kwargs)
etree.parse(fp)
@@ -107,8 +109,12 @@
elt = self.changes[rev]
date = util.strdate(elt.get('local_date'), '%a %b %d %H:%M:%S %Z %Y')
desc = elt.findtext('name') + '\n' + elt.findtext('comment', '')
- return commit(author=elt.get('author'), date=util.datestr(date),
- desc=desc.strip(), parents=self.parents[rev])
+ # etree can return unicode objects for name, comment, and author,
+ # so recode() is used to ensure str objects are emitted.
+ return commit(author=self.recode(elt.get('author')),
+ date=util.datestr(date),
+ desc=self.recode(desc).strip(),
+ parents=self.parents[rev])
def pull(self, rev):
output, status = self.run('pull', self.path, all=True,