Merge lp:~larstiq/bzr/bzr-pypy into lp:bzr

Proposed by Wouter van Heyst
Status: Merged
Merged at revision: 6441
Proposed branch: lp:~larstiq/bzr/bzr-pypy
Merge into: lp:bzr
Diff against target: 39 lines (+4/-4)
1 file modified
bzrlib/transform.py (+4/-4)
To merge this branch: bzr merge lp:~larstiq/bzr/bzr-pypy
Reviewer Review Type Date Requested Status
Martin Packman (community) Approve
Jelmer Vernooij (community) code Approve
Review via email: mp+88870@code.launchpad.net

Description of the change

Having another go at running bzr under pypy a huge amount of tests fail with 'AssertionError: unversioned parent', these changes fix that.

Originally the code used None instead of ROOT_PARENT. While using 'is None' is fine, because ROOT_PARENT is defined now as the string "root-parent" using 'is' suddenly depends on the tricky effects of string interning. The changes from revid:<email address hidden> did not touch the comparison behaviour, but as far as I understand it they should have.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I looked into these as well, but couldn't find the cause. Nice catch!

review: Approve (code)
Revision history for this message
Martin Packman (gz) wrote :

You star. This is reported as bug 881142, and we now need this targeting at lp:bzr/2.5 to land there. Clearly needs a news entry crediting yourself, otherwise looks good to land.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/transform.py'
2--- bzrlib/transform.py 2011-12-19 17:39:35 +0000
3+++ bzrlib/transform.py 2012-01-17 15:01:29 +0000
4@@ -230,7 +230,7 @@
5 irrelevant.
6
7 """
8- new_roots = [k for k, v in self._new_parent.iteritems() if v is
9+ new_roots = [k for k, v in self._new_parent.iteritems() if v ==
10 ROOT_PARENT]
11 if len(new_roots) < 1:
12 return
13@@ -626,7 +626,7 @@
14 for trans_id in self._new_parent:
15 seen = set()
16 parent_id = trans_id
17- while parent_id is not ROOT_PARENT:
18+ while parent_id != ROOT_PARENT:
19 seen.add(parent_id)
20 try:
21 parent_id = self.final_parent(parent_id)
22@@ -642,7 +642,7 @@
23 """If parent directories are versioned, children must be versioned."""
24 conflicts = []
25 for parent_id, children in by_parent.iteritems():
26- if parent_id is ROOT_PARENT:
27+ if parent_id == ROOT_PARENT:
28 continue
29 if self.final_file_id(parent_id) is not None:
30 continue
31@@ -741,7 +741,7 @@
32 """Children must have a directory parent"""
33 conflicts = []
34 for parent_id, children in by_parent.iteritems():
35- if parent_id is ROOT_PARENT:
36+ if parent_id == ROOT_PARENT:
37 continue
38 no_children = True
39 for child_id in children: