John Arbash Meinel | 7 Oct 23:22
Favicon

[MERGE/RFC] Use True/False objects for iter_changes


It seems that bzr-gtk copied the same if/else block that Robert fixed
when he changed the pyrex iter_changes to return 1/0 instead of True/False.

Which means that bzr-gtk breaks if you use the compiled extensions. We
can certainly update bzr-gtk, but we can also play nicely with existing
versions.

For pyrex 0.9.8.5 this should be reasonably fast, as it accesses the
Py_True object directly (rather than looking it up by name). I don't
know if that is true for older versions.

Thoughts?

John
=:->
=== modified file 'bzrlib/_dirstate_helpers_c.pyx'
--- bzrlib/_dirstate_helpers_c.pyx	2008-09-26 05:47:03 +0000
+++ bzrlib/_dirstate_helpers_c.pyx	2008-10-07 21:02:24 +0000
@@ -1239,9 +1239,13 @@
                     else:
                         path_u = self.utf8_decode(path)[0]
                 source_kind = _minikind_to_kind(source_minikind)
+                if content_change:
+                    cchange = True
+                else:
+                    cchange = False
                 return (entry[0][2],
                        (old_path_u, path_u),
-                       content_change,
+                       cchange,
                        (True, True),
                        (source_parent_id, target_parent_id),
                        (self.utf8_decode(old_basename)[0], self.utf8_decode(entry[0][1])[0]),


Gmane