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
1=== modified file 'bzrlib/tests/per_repository/test_repository.py'
2--- bzrlib/tests/per_repository/test_repository.py 2009-05-11 07:18:30 +0000
3+++ bzrlib/tests/per_repository/test_repository.py 2009-06-03 19:35:29 +0000
4@@ -150,22 +150,27 @@
5 """Test the basic behaviour of the text store."""
6 tree = self.make_branch_and_tree('tree')
7 repo = tree.branch.repository
8- file_id = ("Foo:Bar",)
9+ file_id = "Foo:Bar"
10+ file_key = (file_id,)
11 tree.lock_write()
12 try:
13 self.assertEqual(set(), set(repo.texts.keys()))
14- tree.add(['foo'], file_id, ['file'])
15- tree.put_file_bytes_non_atomic(file_id[0], 'content\n')
16- revid = (tree.commit("foo"),)
17+ tree.add(['foo'], [file_id], ['file'])
18+ tree.put_file_bytes_non_atomic(file_id, 'content\n')
19+ try:
20+ rev_key = (tree.commit("foo"),)
21+ except errors.IllegalPath:
22+ raise TestNotApplicable('file_id %r cannot be stored on this'
23+ ' platform for this repo format' % (file_id,))
24 if repo._format.rich_root_data:
25- root_commit = (tree.get_root_id(),) + revid
26+ root_commit = (tree.get_root_id(),) + rev_key
27 keys = set([root_commit])
28 parents = {root_commit:()}
29 else:
30 keys = set()
31 parents = {}
32- keys.add(file_id + revid)
33- parents[file_id + revid] = ()
34+ keys.add(file_key + rev_key)
35+ parents[file_key + rev_key] = ()
36 self.assertEqual(keys, set(repo.texts.keys()))
37 self.assertEqual(parents,
38 repo.texts.get_parent_map(repo.texts.keys()))
39@@ -174,22 +179,23 @@
40 tree2 = self.make_branch_and_tree('tree2')
41 tree2.pull(tree.branch)
42 tree2.put_file_bytes_non_atomic('Foo:Bar', 'right\n')
43- right_id = (tree2.commit('right'),)
44- keys.add(file_id + right_id)
45- parents[file_id + right_id] = (file_id + revid,)
46+ right_key = (tree2.commit('right'),)
47+ keys.add(file_key + right_key)
48+ parents[file_key + right_key] = (file_key + rev_key,)
49 tree.put_file_bytes_non_atomic('Foo:Bar', 'left\n')
50- left_id = (tree.commit('left'),)
51- keys.add(file_id + left_id)
52- parents[file_id + left_id] = (file_id + revid,)
53+ left_key = (tree.commit('left'),)
54+ keys.add(file_key + left_key)
55+ parents[file_key + left_key] = (file_key + rev_key,)
56 tree.merge_from_branch(tree2.branch)
57 tree.put_file_bytes_non_atomic('Foo:Bar', 'merged\n')
58 try:
59 tree.auto_resolve()
60 except errors.UnsupportedOperation:
61 pass
62- merge_id = (tree.commit('merged'),)
63- keys.add(file_id + merge_id)
64- parents[file_id + merge_id] = (file_id + left_id, file_id + right_id)
65+ merge_key = (tree.commit('merged'),)
66+ keys.add(file_key + merge_key)
67+ parents[file_key + merge_key] = (file_key + left_key,
68+ file_key + right_key)
69 repo.lock_read()
70 self.addCleanup(repo.unlock)
71 self.assertEqual(keys, set(repo.texts.keys()))