diff --git a/hgext/convert/common.py b/hgext/convert/common.py --- a/hgext/convert/common.py +++ b/hgext/convert/common.py @@ -365,7 +365,7 @@ class mapfile(dict): return for i, line in enumerate(fp): try: - key, value = line[:-1].rsplit(' ', 1) + key, value = line.splitlines()[0].rsplit(' ', 1) except ValueError: raise util.Abort(_('syntax error in %s(%d): key/value pair expected') % (self.path, i+1)) diff --git a/tests/test-convert-hg-source b/tests/test-convert-hg-source --- a/tests/test-convert-hg-source +++ b/tests/test-convert-hg-source @@ -38,6 +38,25 @@ cd new hg out ../orig cd .. +echo '% check shamap LF and CRLF handling' +cat > rewrite.py <> foo +hg ci -qm 'change foo again' +hg up -qC 2 +echo foo >> foo +hg ci -qm 'change foo again again' +cd .. +hg convert --datesort orig new 2>&1 | grep -v 'subversion python bindings could not be loaded' + echo % init broken repository hg init broken cd broken diff --git a/tests/test-convert-hg-source.out b/tests/test-convert-hg-source.out --- a/tests/test-convert-hg-source.out +++ b/tests/test-convert-hg-source.out @@ -20,6 +20,12 @@ 0 mark baz executable comparing with ../orig searching for changes no changes found +% check shamap LF and CRLF handling +scanning source... +sorting... +converting... +1 change foo again again +0 change foo again % init broken repository created new head % break it