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

Proposed by John A Meinel on 2009-07-14
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 2009-07-14 Approve on 2009-07-14
Review via email: mp+8760@code.launchpad.net
To post a comment you must log in.
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.

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
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
1=== modified file 'NEWS'
2--- NEWS 2009-07-20 06:58:15 +0000
3+++ NEWS 2009-07-20 08:36:49 +0000
4@@ -6,6 +6,7 @@
5 .. contents:: List of Releases
6 :depth: 1
7
8+<<<<<<< TREE
9
10 In Development
11 ##############
12@@ -76,6 +77,19 @@
13 *********
14
15
16+=======
17+bzr 1.17
18+########
19+
20+Bug Fixes
21+*********
22+
23+* Change an extension to call the python ``frozenset()`` rather than the C
24+ api ``PyFrozenSet_New``. It turns out that python2.4 did not expose the
25+ C api. (John Arbash Meinel, #399366)
26+
27+
28+>>>>>>> MERGE-SOURCE
29 bzr 1.17rc1 "So late it's brunch" 2009-07-13
30 ############################################
31
32
33=== modified file 'bzrlib/_known_graph_pyx.pyx'
34--- bzrlib/_known_graph_pyx.pyx 2009-06-19 20:35:35 +0000
35+++ bzrlib/_known_graph_pyx.pyx 2009-07-20 08:36:49 +0000
36@@ -25,8 +25,6 @@
37 ctypedef struct PyObject:
38 pass
39
40- object PyFrozenSet_New(object)
41-
42 object PyTuple_New(Py_ssize_t n)
43 Py_ssize_t PyTuple_GET_SIZE(object t)
44 PyObject * PyTuple_GET_ITEM(object t, Py_ssize_t o)
45@@ -267,7 +265,7 @@
46 cdef Py_ssize_t pos, last_item
47 cdef long min_gdfo
48
49- heads_key = PyFrozenSet_New(keys)
50+ heads_key = frozenset(keys)
51 maybe_heads = PyDict_GetItem(self._known_heads, heads_key)
52 if maybe_heads != NULL:
53 return <object>maybe_heads
54@@ -285,7 +283,7 @@
55 if not candidate_nodes:
56 return frozenset([NULL_REVISION])
57 # The keys changed, so recalculate heads_key
58- heads_key = PyFrozenSet_New(candidate_nodes)
59+ heads_key = frozenset(candidate_nodes)
60 if PyDict_Size(candidate_nodes) < 2:
61 return heads_key
62
63@@ -330,7 +328,7 @@
64 node = <_KnownGraphNode>temp_node
65 if not node.seen:
66 PyList_Append(heads, node.key)
67- heads = PyFrozenSet_New(heads)
68+ heads = frozenset(heads)
69 for pos from 0 <= pos < PyList_GET_SIZE(cleanup):
70 node = _get_list_node(cleanup, pos)
71 node.seen = 0