# Bazaar revision bundle v0.8 # # message: # Detect wrong eol markers. # # committer: Hermann Kraus # date: Mon 2006-08-07 01:06:44.392999887 +0200 === modified file bzrlib/bundle/serializer/__init__.py --- bzrlib/bundle/serializer/__init__.py +++ bzrlib/bundle/serializer/__init__.py @@ -27,8 +27,10 @@ # New bundles should try to use this header format BUNDLE_HEADER = '# Bazaar revision bundle v' -BUNDLE_HEADER_RE = re.compile(r'^# Bazaar revision bundle v(?P\d+[\w.]*)\n$') -CHANGESET_OLD_HEADER_RE = re.compile(r'^# Bazaar-NG changeset v(?P\d+[\w.]*)\n$') +BUNDLE_HEADER_RE = re.compile( + r'^# Bazaar revision bundle v(?P\d+[\w.]*)(?P\r?)\n$') +CHANGESET_OLD_HEADER_RE = re.compile( + r'^# Bazaar-NG changeset v(?P\d+[\w.]*)(?P\r?)\n$') _serializers = {} @@ -50,6 +52,8 @@ for line in f: m = BUNDLE_HEADER_RE.match(line) if m: + if m.group('lineending') != '': + raise errors.UnsupportedEOLMarker() version = m.group('version') break elif line.startswith(BUNDLE_HEADER): === modified file bzrlib/errors.py --- bzrlib/errors.py +++ bzrlib/errors.py @@ -1078,4 +1078,10 @@ def __init__(self, text): BzrNewError.__init__(self) - self.text = text \ No newline at end of file + self.text = text + +class UnsupportedEOLMarker(BadBundle): + """End of line marker was not \\n in bzr revision-bundle""" + + def __init__(self): + BzrNewError.__init__(self) # revision id: hermann@physiklaborant.de-20060806230644-2ed4719df86b8bd1 # sha1: 0c11ae17ccb1103e7e6bbf67037696cc4433409f # inventory sha1: 240f863498d4176a4ad8d1b16b4ea35b4c715d11 # parent ids: # hermann@physiklaborant.de-20060806155007-9d2d684d8f04c084 # base id: hermann@physiklaborant.de-20060806155007-9d2d684d8f04c084 # properties: # branch-nick: bzr.dev