Rev 2314: Change bundle_data to use the sanitizing form of safe_*_id in http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/unicode_id_warnings

John Arbash Meinel john at arbash-meinel.com
Fri Mar 2 16:40:43 GMT 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.15-dev/unicode_id_warnings

------------------------------------------------------------
revno: 2314
revision-id: john at arbash-meinel.com-20070302164035-sicgpxj3u88arycc
parent: john at arbash-meinel.com-20070302163503-8z3knxzmkzsqmogw
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: unicode_id_warnings
timestamp: Fri 2007-03-02 10:40:35 -0600
message:
  Change bundle_data to use the sanitizing form of safe_*_id
modified:
  bzrlib/bundle/bundle_data.py   read_changeset.py-20050619171944-c0d95aa685537640
-------------- next part --------------
=== modified file 'bzrlib/bundle/bundle_data.py'
--- a/bzrlib/bundle/bundle_data.py	2007-02-18 00:22:24 +0000
+++ b/bzrlib/bundle/bundle_data.py	2007-03-02 16:40:35 +0000
@@ -171,6 +171,7 @@
         raise KeyError(revision_id)
 
     def revision_tree(self, repository, revision_id, base=None):
+        revision_id = osutils.safe_revision_id(revision_id)
         revision = self.get_revision(revision_id)
         base = self.get_base(revision)
         assert base != revision_id
@@ -302,7 +303,10 @@
 
         def get_rev_id(last_changed, path, kind):
             if last_changed is not None:
-                changed_revision_id = osutils.safe_revision_id(last_changed)
+                # last_changed will be a Unicode string because of how it was
+                # read. Convert it back to utf8.
+                changed_revision_id = osutils.safe_revision_id(last_changed,
+                                                               warn=False)
             else:
                 changed_revision_id = revision_id
             bundle_tree.note_last_changed(path, changed_revision_id)
@@ -377,7 +381,7 @@
                         ': %r' % extra)
             # This will be Unicode because of how the stream is read. Turn it
             # back into a utf8 file_id
-            file_id = osutils.safe_file_id(info[1][8:])
+            file_id = osutils.safe_file_id(info[1][8:], warn=False)
 
             bundle_tree.note_id(file_id, path, kind)
             # this will be overridden in extra_info if executable is specified.



More information about the bazaar-commits mailing list