Merge lp:~jameinel/bzr/1.16-simple-win32 into lp:~bzr/bzr/trunk-old

Proposed by John A Meinel
Status: Superseded
Proposed branch: lp:~jameinel/bzr/1.16-simple-win32
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 71 lines
To merge this branch: bzr merge lp:~jameinel/bzr/1.16-simple-win32
Reviewer Review Type Date Requested Status
bzr-core Pending
Review via email: mp+6984@code.launchpad.net

This proposal has been superseded by a proposal from 2009-06-03.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

This updates a per-repository test that was failing on Windows.
Older formats can't handle file-ids with ':' in them on Windows, because it isn't a valid filename character.
I also update the test a bit, to make it clearer which objects are *keys* (tuples) and which are *ids* (strings).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bzrlib/tests/per_repository/test_repository.py'
--- bzrlib/tests/per_repository/test_repository.py 2009-05-11 07:18:30 +0000
+++ bzrlib/tests/per_repository/test_repository.py 2009-06-03 19:35:29 +0000
@@ -150,22 +150,27 @@
150 """Test the basic behaviour of the text store."""150 """Test the basic behaviour of the text store."""
151 tree = self.make_branch_and_tree('tree')151 tree = self.make_branch_and_tree('tree')
152 repo = tree.branch.repository152 repo = tree.branch.repository
153 file_id = ("Foo:Bar",)153 file_id = "Foo:Bar"
154 file_key = (file_id,)
154 tree.lock_write()155 tree.lock_write()
155 try:156 try:
156 self.assertEqual(set(), set(repo.texts.keys()))157 self.assertEqual(set(), set(repo.texts.keys()))
157 tree.add(['foo'], file_id, ['file'])158 tree.add(['foo'], [file_id], ['file'])
158 tree.put_file_bytes_non_atomic(file_id[0], 'content\n')159 tree.put_file_bytes_non_atomic(file_id, 'content\n')
159 revid = (tree.commit("foo"),)160 try:
161 rev_key = (tree.commit("foo"),)
162 except errors.IllegalPath:
163 raise TestNotApplicable('file_id %r cannot be stored on this'
164 ' platform for this repo format' % (file_id,))
160 if repo._format.rich_root_data:165 if repo._format.rich_root_data:
161 root_commit = (tree.get_root_id(),) + revid166 root_commit = (tree.get_root_id(),) + rev_key
162 keys = set([root_commit])167 keys = set([root_commit])
163 parents = {root_commit:()}168 parents = {root_commit:()}
164 else:169 else:
165 keys = set()170 keys = set()
166 parents = {}171 parents = {}
167 keys.add(file_id + revid)172 keys.add(file_key + rev_key)
168 parents[file_id + revid] = ()173 parents[file_key + rev_key] = ()
169 self.assertEqual(keys, set(repo.texts.keys()))174 self.assertEqual(keys, set(repo.texts.keys()))
170 self.assertEqual(parents,175 self.assertEqual(parents,
171 repo.texts.get_parent_map(repo.texts.keys()))176 repo.texts.get_parent_map(repo.texts.keys()))
@@ -174,22 +179,23 @@
174 tree2 = self.make_branch_and_tree('tree2')179 tree2 = self.make_branch_and_tree('tree2')
175 tree2.pull(tree.branch)180 tree2.pull(tree.branch)
176 tree2.put_file_bytes_non_atomic('Foo:Bar', 'right\n')181 tree2.put_file_bytes_non_atomic('Foo:Bar', 'right\n')
177 right_id = (tree2.commit('right'),)182 right_key = (tree2.commit('right'),)
178 keys.add(file_id + right_id)183 keys.add(file_key + right_key)
179 parents[file_id + right_id] = (file_id + revid,)184 parents[file_key + right_key] = (file_key + rev_key,)
180 tree.put_file_bytes_non_atomic('Foo:Bar', 'left\n')185 tree.put_file_bytes_non_atomic('Foo:Bar', 'left\n')
181 left_id = (tree.commit('left'),)186 left_key = (tree.commit('left'),)
182 keys.add(file_id + left_id)187 keys.add(file_key + left_key)
183 parents[file_id + left_id] = (file_id + revid,)188 parents[file_key + left_key] = (file_key + rev_key,)
184 tree.merge_from_branch(tree2.branch)189 tree.merge_from_branch(tree2.branch)
185 tree.put_file_bytes_non_atomic('Foo:Bar', 'merged\n')190 tree.put_file_bytes_non_atomic('Foo:Bar', 'merged\n')
186 try:191 try:
187 tree.auto_resolve()192 tree.auto_resolve()
188 except errors.UnsupportedOperation:193 except errors.UnsupportedOperation:
189 pass194 pass
190 merge_id = (tree.commit('merged'),)195 merge_key = (tree.commit('merged'),)
191 keys.add(file_id + merge_id)196 keys.add(file_key + merge_key)
192 parents[file_id + merge_id] = (file_id + left_id, file_id + right_id)197 parents[file_key + merge_key] = (file_key + left_key,
198 file_key + right_key)
193 repo.lock_read()199 repo.lock_read()
194 self.addCleanup(repo.unlock)200 self.addCleanup(repo.unlock)
195 self.assertEqual(keys, set(repo.texts.keys()))201 self.assertEqual(keys, set(repo.texts.keys()))