Rev 2313: Use unicode objects internally for sqlite. in http://people.samba.org/bzr/jelmer/bzr-svn/0.5

Jelmer Vernooij jelmer at samba.org
Thu Jan 15 22:30:51 GMT 2009


At http://people.samba.org/bzr/jelmer/bzr-svn/0.5

------------------------------------------------------------
revno: 2313
revision-id: jelmer at samba.org-20090115223048-01utlj5n7q3h6asy
parent: jelmer at samba.org-20090115204911-j3t3o2n41do77m02
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.5
timestamp: Thu 2009-01-15 23:30:48 +0100
message:
  Use unicode objects internally for sqlite.
modified:
  NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
  logwalker.py                   logwalker.py-20060621215743-c13fhfnyzh1xzwh2-1
=== modified file 'NEWS'
--- a/NEWS	2009-01-15 04:21:45 +0000
+++ b/NEWS	2009-01-15 22:30:48 +0000
@@ -46,6 +46,8 @@
    * Properly determine file ids of children of directories that are replaced 
      by an older copy of themselves. (#316384)
 
+   * Use unicode objects internally for sqlite. (#296868)
+
 bzr-svn 0.5.0~rc1			2008-12-08
 
   CHANGES

=== modified file 'logwalker.py'
--- a/logwalker.py	2009-01-15 01:28:44 +0000
+++ b/logwalker.py	2009-01-15 22:30:48 +0000
@@ -29,6 +29,7 @@
 MAX_OVERHEAD_FETCH = 1000
 
 class lazy_dict(object):
+
     def __init__(self, initial, create_fn, *args):
         self.initial = initial
         self.create_fn = create_fn
@@ -236,6 +237,8 @@
         """
         assert action in ("A", "R", "D", "M")
         assert not path.startswith("/")
+        assert isinstance(path, unicode)
+        assert copyfrom_path is None or isinstance(copyfrom_path, unicode)
         self.cachedb.execute("replace into changed_path (rev, path, action, copyfrom_path, copyfrom_rev) values (?, ?, ?, ?, ?)", (rev, path, action, copyfrom_path, copyfrom_rev))
 
     def drop_revprops(self, revnum):
@@ -398,9 +401,9 @@
             for p in orig_paths:
                 copyfrom_path = orig_paths[p][1]
                 if copyfrom_path is not None:
-                    copyfrom_path = copyfrom_path.strip("/")
+                    copyfrom_path = copyfrom_path.strip("/").decode("utf-8")
 
-                self.cache.insert_path(revision, p.strip("/"), orig_paths[p][0], copyfrom_path, orig_paths[p][2])
+                self.cache.insert_path(revision, p.strip("/").decode("utf-8"), orig_paths[p][0], copyfrom_path, orig_paths[p][2])
             self.cache.insert_revprops(revision, revprops)
             self.cache.insert_revinfo(revision, todo_revprops is None)
             self.saved_revnum = revision
@@ -444,6 +447,7 @@
 
 class LogWalker(object):
     """Easy way to access the history of a Subversion repository."""
+
     def __init__(self, transport, limit=None):
         """Create a new instance.
 




More information about the bazaar-commits mailing list