Merge lp:~jameinel/bzr/bugfix399366 into lp:~bzr/bzr/trunk-old

Proposed by John A Meinel
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jameinel/bzr/bugfix399366
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 71 lines (has conflicts)
Text conflict in NEWS
To merge this branch: bzr merge lp:~jameinel/bzr/bugfix399366
Reviewer Review Type Date Requested Status
Vincent Ladeuil Approve
Review via email: mp+8760@code.launchpad.net
To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

This is also proposed for merging into the bzr.1.17 branch.

This change is required to build the 'python-installers' (not the all-in-one, since that is fixed to be used with python2.5).

It just stops calling a C api that wasn't available in python2.4 and uses 'frozenset()' directly. It is probably trivially slower than the existing code path. Not enough to really worry about.

Revision history for this message
Vincent Ladeuil (vila) wrote :

AFAICS the penalty would be once (or twice) per heads() call, so nothing dramatic.
Did you measure it ?

Otherwise, it's trivial and required, so land it !

review: Approve
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vincent Ladeuil wrote:
> Review: Approve
> AFAICS the penalty would be once (or twice) per heads() call, so nothing dramatic.
> Did you measure it ?
>
> Otherwise, it's trivial and required, so land it !

well, it is 1/heads call, and back when we were calling heads() 200k
times for NEWS, it isn't that trivial.

But the code has changed, and yeah, I don't think it is particularly
dramatic.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpczn8ACgkQJdeBCYSNAAMDgACgjrsImFm6S+oQXNWhs7MB167E
xdsAn217qlEcDR6Y+uU6IrmBfxw3mJVD
=HTIX
-----END PGP SIGNATURE-----

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2009-07-20 06:58:15 +0000
+++ NEWS 2009-07-20 08:36:49 +0000
@@ -6,6 +6,7 @@
6.. contents:: List of Releases6.. contents:: List of Releases
7 :depth: 17 :depth: 1
88
9<<<<<<< TREE
910
10In Development11In Development
11##############12##############
@@ -76,6 +77,19 @@
76*********77*********
7778
7879
80=======
81bzr 1.17
82########
83
84Bug Fixes
85*********
86
87* Change an extension to call the python ``frozenset()`` rather than the C
88 api ``PyFrozenSet_New``. It turns out that python2.4 did not expose the
89 C api. (John Arbash Meinel, #399366)
90
91
92>>>>>>> MERGE-SOURCE
79bzr 1.17rc1 "So late it's brunch" 2009-07-1393bzr 1.17rc1 "So late it's brunch" 2009-07-13
80############################################94############################################
8195
8296
=== modified file 'bzrlib/_known_graph_pyx.pyx'
--- bzrlib/_known_graph_pyx.pyx 2009-06-19 20:35:35 +0000
+++ bzrlib/_known_graph_pyx.pyx 2009-07-20 08:36:49 +0000
@@ -25,8 +25,6 @@
25 ctypedef struct PyObject:25 ctypedef struct PyObject:
26 pass26 pass
2727
28 object PyFrozenSet_New(object)
29
30 object PyTuple_New(Py_ssize_t n)28 object PyTuple_New(Py_ssize_t n)
31 Py_ssize_t PyTuple_GET_SIZE(object t)29 Py_ssize_t PyTuple_GET_SIZE(object t)
32 PyObject * PyTuple_GET_ITEM(object t, Py_ssize_t o)30 PyObject * PyTuple_GET_ITEM(object t, Py_ssize_t o)
@@ -267,7 +265,7 @@
267 cdef Py_ssize_t pos, last_item265 cdef Py_ssize_t pos, last_item
268 cdef long min_gdfo266 cdef long min_gdfo
269267
270 heads_key = PyFrozenSet_New(keys)268 heads_key = frozenset(keys)
271 maybe_heads = PyDict_GetItem(self._known_heads, heads_key)269 maybe_heads = PyDict_GetItem(self._known_heads, heads_key)
272 if maybe_heads != NULL:270 if maybe_heads != NULL:
273 return <object>maybe_heads271 return <object>maybe_heads
@@ -285,7 +283,7 @@
285 if not candidate_nodes:283 if not candidate_nodes:
286 return frozenset([NULL_REVISION])284 return frozenset([NULL_REVISION])
287 # The keys changed, so recalculate heads_key285 # The keys changed, so recalculate heads_key
288 heads_key = PyFrozenSet_New(candidate_nodes)286 heads_key = frozenset(candidate_nodes)
289 if PyDict_Size(candidate_nodes) < 2:287 if PyDict_Size(candidate_nodes) < 2:
290 return heads_key288 return heads_key
291289
@@ -330,7 +328,7 @@
330 node = <_KnownGraphNode>temp_node328 node = <_KnownGraphNode>temp_node
331 if not node.seen:329 if not node.seen:
332 PyList_Append(heads, node.key)330 PyList_Append(heads, node.key)
333 heads = PyFrozenSet_New(heads)331 heads = frozenset(heads)
334 for pos from 0 <= pos < PyList_GET_SIZE(cleanup):332 for pos from 0 <= pos < PyList_GET_SIZE(cleanup):
335 node = _get_list_node(cleanup, pos)333 node = _get_list_node(cleanup, pos)
336 node.seen = 0334 node.seen = 0