Merge from trunk.
authorJelmer Vernooij <jelmer@samba.org>
Fri, 15 Dec 2006 20:31:27 +0000 (21:31 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Fri, 15 Dec 2006 20:31:27 +0000 (21:31 +0100)
1  2 
checkout.py
commit.py
logwalker.py
repository.py

diff --cc checkout.py
Simple merge
diff --cc commit.py
Simple merge
diff --cc logwalker.py
index 24035269a14921b868ff9511ee5cbdbf7b0b0f25,50890946d85795496dcd2567640552e5ddbd50e9..f902e73108ff0052d5854362eced5f2a73aeacc6
@@@ -28,13 -28,30 +28,31 @@@ from bsddb import dbshelve as shelv
  
  shelves = {}
  
+ def _escape_commit_message(message):
+     """Replace xml-incompatible control characters."""
+     import re
+     # FIXME: RBC 20060419 this should be done by the revision
+     # serialiser not by commit. Then we can also add an unescaper
+     # in the deserializer and start roundtripping revision messages
+     # precisely. See repository_implementations/test_repository.py
+     
+     # Python strings can include characters that can't be
+     # represented in well-formed XML; escape characters that
+     # aren't listed in the XML specification
+     # (http://www.w3.org/TR/REC-xml/#NT-Char).
+     message, _ = re.subn(
+         u'[^\x09\x0A\x0D\u0020-\uD7FF\uE000-\uFFFD]+',
+         lambda match: match.group(0).encode('unicode_escape'),
+         message)
+     return message
  class NotSvnBranchPath(BzrError):
 -    _fmt = """{%(branch_path)s} is not a valid Svn branch path"""
 +    _fmt = """{%(branch_path)s}:%(revnum)s is not a valid Svn branch path"""
  
 -    def __init__(self, branch_path):
 +    def __init__(self, branch_path, revnum=None):
          BzrError.__init__(self)
          self.branch_path = branch_path
 +        self.revnum = revnum
  
  
  class LogWalker(object):
diff --cc repository.py
Simple merge