Merge lp:~thumper/launchpad/new-bzr into lp:launchpad
- new-bzr
- Merge into devel
Proposed by
Tim Penhey
Status: | Merged |
---|---|
Approved by: | Michael Hudson-Doyle |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11369 |
Proposed branch: | lp:~thumper/launchpad/new-bzr |
Merge into: | lp:launchpad |
Diff against target: |
1246 lines (+380/-183) 28 files modified
configs/development/apidoc-configure-normal.zcml (+0/-1) lib/lp/code/mail/codehandler.py (+6/-2) lib/lp/code/mail/tests/test_codehandler.py (+34/-20) lib/lp/code/model/diff.py (+1/-1) lib/lp/code/model/directbranchcommit.py (+10/-2) lib/lp/code/model/tests/test_branch.py (+5/-1) lib/lp/code/model/tests/test_branchjob.py (+100/-57) lib/lp/code/model/tests/test_branchmergeproposaljobs.py (+11/-2) lib/lp/code/model/tests/test_diff.py (+16/-4) lib/lp/code/scripts/tests/test_scan_branches.py (+9/-3) lib/lp/code/scripts/tests/test_sendbranchmail.py (+11/-2) lib/lp/codehosting/codeimport/tests/test_worker.py (+1/-1) lib/lp/codehosting/codeimport/uifactory.py (+18/-0) lib/lp/codehosting/puller/worker.py (+1/-1) lib/lp/codehosting/scanner/tests/test_buglinks.py (+34/-24) lib/lp/codehosting/scanner/tests/test_bzrsync.py (+28/-19) lib/lp/codehosting/scanner/tests/test_mergedetection.py (+11/-2) lib/lp/codehosting/tests/test_acceptance.py (+1/-4) lib/lp/codehosting/tests/test_branchdistro.py (+16/-4) lib/lp/codehosting/tests/test_bzrutils.py (+2/-2) lib/lp/codehosting/tests/test_jobs.py (+6/-1) lib/lp/codehosting/vfs/tests/test_transport.py (+3/-0) lib/lp/services/osutils.py (+32/-0) lib/lp/testing/__init__.py (+4/-10) lib/lp/translations/scripts/translations_to_branch.py (+10/-16) lib/lp/translations/tests/test_rosetta_branches_script.py (+7/-1) utilities/sourcedeps.conf (+2/-2) versions.cfg (+1/-1) |
To merge this branch: | bzr merge lp:~thumper/launchpad/new-bzr |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Hudson-Doyle | Approve | ||
Tim Penhey (community) | Approve | ||
Review via email: mp+32845@code.launchpad.net |
Commit message
Upgrade bzr to 2.2 final.
Description of the change
Upgrade bzr to 2.2.
Due to changes in bzrlib, specific user logins are needed, but there is a bug (which has been fixed on trunk) where the committer passed in as an argument was ignored.
To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote : | # |
I approve the other bits.
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'configs/development/apidoc-configure-normal.zcml' | |||
2 | --- configs/development/apidoc-configure-normal.zcml 2010-07-24 02:27:19 +0000 | |||
3 | +++ configs/development/apidoc-configure-normal.zcml 2010-08-17 04:46:45 +0000 | |||
4 | @@ -90,7 +90,6 @@ | |||
5 | 90 | <apidoc:rootModule module="martian" /> | 90 | <apidoc:rootModule module="martian" /> |
6 | 91 | <apidoc:rootModule module="manuel" /> | 91 | <apidoc:rootModule module="manuel" /> |
7 | 92 | <apidoc:rootModule module="chameleon" /> | 92 | <apidoc:rootModule module="chameleon" /> |
8 | 93 | <apidoc:rootModule module="bzrlib" /> | ||
9 | 94 | <apidoc:rootModule module="storm" /> | 93 | <apidoc:rootModule module="storm" /> |
10 | 95 | 94 | ||
11 | 96 | <apidoc:bookchapter | 95 | <apidoc:bookchapter |
12 | 97 | 96 | ||
13 | === modified file 'lib/lp/code/mail/codehandler.py' | |||
14 | --- lib/lp/code/mail/codehandler.py 2010-08-02 02:51:42 +0000 | |||
15 | +++ lib/lp/code/mail/codehandler.py 2010-08-17 04:46:45 +0000 | |||
16 | @@ -545,8 +545,12 @@ | |||
17 | 545 | # access to any needed but not supplied revisions. | 545 | # access to any needed but not supplied revisions. |
18 | 546 | md.target_branch = target_url | 546 | md.target_branch = target_url |
19 | 547 | md.install_revisions(bzr_branch.repository) | 547 | md.install_revisions(bzr_branch.repository) |
22 | 548 | bzr_branch.pull(bzr_branch, stop_revision=md.revision_id, | 548 | bzr_branch.lock_write() |
23 | 549 | overwrite=True) | 549 | try: |
24 | 550 | bzr_branch.pull(bzr_branch, stop_revision=md.revision_id, | ||
25 | 551 | overwrite=True) | ||
26 | 552 | finally: | ||
27 | 553 | bzr_branch.unlock() | ||
28 | 550 | 554 | ||
29 | 551 | def findMergeDirectiveAndComment(self, message): | 555 | def findMergeDirectiveAndComment(self, message): |
30 | 552 | """Extract the comment and Merge Directive from a SignedMessage.""" | 556 | """Extract the comment and Merge Directive from a SignedMessage.""" |
31 | 553 | 557 | ||
32 | === modified file 'lib/lp/code/mail/tests/test_codehandler.py' | |||
33 | --- lib/lp/code/mail/tests/test_codehandler.py 2010-07-27 05:30:04 +0000 | |||
34 | +++ lib/lp/code/mail/tests/test_codehandler.py 2010-08-17 04:46:45 +0000 | |||
35 | @@ -3,6 +3,8 @@ | |||
36 | 3 | 3 | ||
37 | 4 | """Testing the CodeHandler.""" | 4 | """Testing the CodeHandler.""" |
38 | 5 | 5 | ||
39 | 6 | from __future__ import with_statement | ||
40 | 7 | |||
41 | 6 | __metaclass__ = type | 8 | __metaclass__ = type |
42 | 7 | 9 | ||
43 | 8 | from difflib import unified_diff | 10 | from difflib import unified_diff |
44 | @@ -48,6 +50,7 @@ | |||
45 | 48 | from lp.codehosting.vfs import get_lp_server | 50 | from lp.codehosting.vfs import get_lp_server |
46 | 49 | from lp.registry.interfaces.person import IPersonSet | 51 | from lp.registry.interfaces.person import IPersonSet |
47 | 50 | from lp.services.job.runner import JobRunner | 52 | from lp.services.job.runner import JobRunner |
48 | 53 | from lp.services.osutils import override_environ | ||
49 | 51 | from lp.testing import login, login_person, TestCase, TestCaseWithFactory | 54 | from lp.testing import login, login_person, TestCase, TestCaseWithFactory |
50 | 52 | from lp.testing.mail_helpers import pop_notifications | 55 | from lp.testing.mail_helpers import pop_notifications |
51 | 53 | 56 | ||
52 | @@ -888,12 +891,16 @@ | |||
53 | 888 | db_target_branch, target_tree = self.create_branch_and_tree( | 891 | db_target_branch, target_tree = self.create_branch_and_tree( |
54 | 889 | tree_location='.', format=format) | 892 | tree_location='.', format=format) |
55 | 890 | target_tree.branch.set_public_branch(db_target_branch.bzr_identity) | 893 | target_tree.branch.set_public_branch(db_target_branch.bzr_identity) |
62 | 891 | target_tree.commit('rev1') | 894 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
63 | 892 | # Make sure that the created branch has been mirrored. | 895 | # required to generate the revision-id. |
64 | 893 | removeSecurityProxy(db_target_branch).branchChanged( | 896 | with override_environ(BZR_EMAIL='me@example.com'): |
65 | 894 | '', 'rev1', None, None, None) | 897 | target_tree.commit('rev1') |
66 | 895 | source_tree = target_tree.bzrdir.sprout('source').open_workingtree() | 898 | # Make sure that the created branch has been mirrored. |
67 | 896 | source_tree.commit('rev2') | 899 | removeSecurityProxy(db_target_branch).branchChanged( |
68 | 900 | '', 'rev1', None, None, None) | ||
69 | 901 | sprout_bzrdir = target_tree.bzrdir.sprout('source') | ||
70 | 902 | source_tree = sprout_bzrdir.open_workingtree() | ||
71 | 903 | source_tree.commit('rev2') | ||
72 | 897 | message = self.factory.makeBundleMergeDirectiveEmail( | 904 | message = self.factory.makeBundleMergeDirectiveEmail( |
73 | 898 | source_tree.branch, db_target_branch) | 905 | source_tree.branch, db_target_branch) |
74 | 899 | return db_target_branch, source_tree.branch, message | 906 | return db_target_branch, source_tree.branch, message |
75 | @@ -994,7 +1001,10 @@ | |||
76 | 994 | branch, source, message = self._createTargetSourceAndBundle( | 1001 | branch, source, message = self._createTargetSourceAndBundle( |
77 | 995 | format="1.9") | 1002 | format="1.9") |
78 | 996 | target_tree = WorkingTree.open('.') | 1003 | target_tree = WorkingTree.open('.') |
80 | 997 | target_tree.commit('rev2b') | 1004 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
81 | 1005 | # required to generate the revision-id. | ||
82 | 1006 | with override_environ(BZR_EMAIL='me@example.com'): | ||
83 | 1007 | target_tree.commit('rev2b') | ||
84 | 998 | bmp = self._processMergeDirective(message) | 1008 | bmp = self._processMergeDirective(message) |
85 | 999 | lp_branch = self._openBazaarBranchAsClient(bmp.source_branch) | 1009 | lp_branch = self._openBazaarBranchAsClient(bmp.source_branch) |
86 | 1000 | self.assertEqual(source.last_revision(), lp_branch.last_revision()) | 1010 | self.assertEqual(source.last_revision(), lp_branch.last_revision()) |
87 | @@ -1005,20 +1015,24 @@ | |||
88 | 1005 | db_target_branch, target_tree = self.create_branch_and_tree( | 1015 | db_target_branch, target_tree = self.create_branch_and_tree( |
89 | 1006 | 'target', format=target_format) | 1016 | 'target', format=target_format) |
90 | 1007 | target_tree.branch.set_public_branch(db_target_branch.bzr_identity) | 1017 | target_tree.branch.set_public_branch(db_target_branch.bzr_identity) |
94 | 1008 | revid = target_tree.commit('rev1') | 1018 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
95 | 1009 | removeSecurityProxy(db_target_branch).branchChanged( | 1019 | # required to generate the revision-id. |
96 | 1010 | '', revid, None, None, None) | 1020 | with override_environ(BZR_EMAIL='me@example.com'): |
97 | 1021 | revid = target_tree.commit('rev1') | ||
98 | 1022 | removeSecurityProxy(db_target_branch).branchChanged( | ||
99 | 1023 | '', revid, None, None, None) | ||
100 | 1011 | 1024 | ||
111 | 1012 | db_source_branch, source_tree = self.create_branch_and_tree( | 1025 | db_source_branch, source_tree = self.create_branch_and_tree( |
112 | 1013 | 'lpsource', db_target_branch.product, format=source_format) | 1026 | 'lpsource', db_target_branch.product, format=source_format) |
113 | 1014 | # The branch is not scheduled to be mirrorred. | 1027 | # The branch is not scheduled to be mirrorred. |
114 | 1015 | self.assertIs(db_source_branch.next_mirror_time, None) | 1028 | self.assertIs(db_source_branch.next_mirror_time, None) |
115 | 1016 | source_tree.pull(target_tree.branch) | 1029 | source_tree.pull(target_tree.branch) |
116 | 1017 | source_tree.commit('rev2', rev_id='rev2') | 1030 | source_tree.commit('rev2', rev_id='rev2') |
117 | 1018 | # bundle_tree is effectively behaving like a local copy of | 1031 | # bundle_tree is effectively behaving like a local copy of |
118 | 1019 | # db_source_branch, and is used to create the merge directive. | 1032 | # db_source_branch, and is used to create the merge directive. |
119 | 1020 | bundle_tree = source_tree.bzrdir.sprout('source').open_workingtree() | 1033 | sprout_bzrdir = source_tree.bzrdir.sprout('source') |
120 | 1021 | bundle_tree.commit('rev3', rev_id='rev3') | 1034 | bundle_tree = sprout_bzrdir.open_workingtree() |
121 | 1035 | bundle_tree.commit('rev3', rev_id='rev3') | ||
122 | 1022 | bundle_tree.branch.set_public_branch(db_source_branch.bzr_identity) | 1036 | bundle_tree.branch.set_public_branch(db_source_branch.bzr_identity) |
123 | 1023 | message = self.factory.makeBundleMergeDirectiveEmail( | 1037 | message = self.factory.makeBundleMergeDirectiveEmail( |
124 | 1024 | bundle_tree.branch, db_target_branch, | 1038 | bundle_tree.branch, db_target_branch, |
125 | 1025 | 1039 | ||
126 | === modified file 'lib/lp/code/model/diff.py' | |||
127 | --- lib/lp/code/model/diff.py 2010-08-02 02:13:52 +0000 | |||
128 | +++ lib/lp/code/model/diff.py 2010-08-17 04:46:45 +0000 | |||
129 | @@ -140,7 +140,7 @@ | |||
130 | 140 | source_revision) | 140 | source_revision) |
131 | 141 | merger = Merge3Merger( | 141 | merger = Merge3Merger( |
132 | 142 | merge_target, merge_target, merge_base, merge_source, | 142 | merge_target, merge_target, merge_base, merge_source, |
134 | 143 | do_merge=False) | 143 | this_branch=target_branch, do_merge=False) |
135 | 144 | def dummy_warning(self, *args, **kwargs): | 144 | def dummy_warning(self, *args, **kwargs): |
136 | 145 | pass | 145 | pass |
137 | 146 | real_warning = trace.warning | 146 | real_warning = trace.warning |
138 | 147 | 147 | ||
139 | === modified file 'lib/lp/code/model/directbranchcommit.py' | |||
140 | --- lib/lp/code/model/directbranchcommit.py 2010-05-15 17:43:59 +0000 | |||
141 | +++ lib/lp/code/model/directbranchcommit.py 2010-08-17 04:46:45 +0000 | |||
142 | @@ -3,6 +3,8 @@ | |||
143 | 3 | 3 | ||
144 | 4 | """Commit files straight to bzr branch.""" | 4 | """Commit files straight to bzr branch.""" |
145 | 5 | 5 | ||
146 | 6 | from __future__ import with_statement | ||
147 | 7 | |||
148 | 6 | __metaclass__ = type | 8 | __metaclass__ = type |
149 | 7 | __all__ = [ | 9 | __all__ = [ |
150 | 8 | 'ConcurrentUpdateError', | 10 | 'ConcurrentUpdateError', |
151 | @@ -19,6 +21,8 @@ | |||
152 | 19 | from canonical.launchpad.interfaces import IMasterObject | 21 | from canonical.launchpad.interfaces import IMasterObject |
153 | 20 | 22 | ||
154 | 21 | from lp.codehosting.bzrutils import get_stacked_on_url | 23 | from lp.codehosting.bzrutils import get_stacked_on_url |
155 | 24 | from lp.services.osutils import override_environ | ||
156 | 25 | from lp.services.mail.sendmail import format_address_for_person | ||
157 | 22 | 26 | ||
158 | 23 | class ConcurrentUpdateError(Exception): | 27 | class ConcurrentUpdateError(Exception): |
159 | 24 | """Bailout exception for concurrent updates. | 28 | """Bailout exception for concurrent updates. |
160 | @@ -188,8 +192,12 @@ | |||
161 | 188 | if rev_id == NULL_REVISION: | 192 | if rev_id == NULL_REVISION: |
162 | 189 | if list(self.transform_preview.iter_changes()) == []: | 193 | if list(self.transform_preview.iter_changes()) == []: |
163 | 190 | return | 194 | return |
166 | 191 | new_rev_id = self.transform_preview.commit( | 195 | committer_id = format_address_for_person(self.committer) |
167 | 192 | self.bzrbranch, commit_message) | 196 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
168 | 197 | # required to generate the revision-id. | ||
169 | 198 | with override_environ(BZR_EMAIL=committer_id): | ||
170 | 199 | new_rev_id = self.transform_preview.commit( | ||
171 | 200 | self.bzrbranch, commit_message, committer=committer_id) | ||
172 | 193 | IMasterObject(self.db_branch).branchChanged( | 201 | IMasterObject(self.db_branch).branchChanged( |
173 | 194 | get_stacked_on_url(self.bzrbranch), new_rev_id, | 202 | get_stacked_on_url(self.bzrbranch), new_rev_id, |
174 | 195 | self.db_branch.control_format, self.db_branch.branch_format, | 203 | self.db_branch.control_format, self.db_branch.branch_format, |
175 | 196 | 204 | ||
176 | === modified file 'lib/lp/code/model/tests/test_branch.py' | |||
177 | --- lib/lp/code/model/tests/test_branch.py 2010-08-12 01:53:07 +0000 | |||
178 | +++ lib/lp/code/model/tests/test_branch.py 2010-08-17 04:46:45 +0000 | |||
179 | @@ -84,6 +84,7 @@ | |||
180 | 84 | from lp.testing.factory import LaunchpadObjectFactory | 84 | from lp.testing.factory import LaunchpadObjectFactory |
181 | 85 | from lp.translations.model.translationtemplatesbuildjob import ( | 85 | from lp.translations.model.translationtemplatesbuildjob import ( |
182 | 86 | ITranslationTemplatesBuildJobSource) | 86 | ITranslationTemplatesBuildJobSource) |
183 | 87 | from lp.services.osutils import override_environ | ||
184 | 87 | 88 | ||
185 | 88 | 89 | ||
186 | 89 | class TestCodeImport(TestCase): | 90 | class TestCodeImport(TestCase): |
187 | @@ -2573,7 +2574,10 @@ | |||
188 | 2573 | # safe_open returns the underlying bzr branch of a database branch in | 2574 | # safe_open returns the underlying bzr branch of a database branch in |
189 | 2574 | # the simple, unstacked, case. | 2575 | # the simple, unstacked, case. |
190 | 2575 | db_branch, tree = self.create_branch_and_tree() | 2576 | db_branch, tree = self.create_branch_and_tree() |
192 | 2576 | revid = tree.commit('') | 2577 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
193 | 2578 | # required to generate the revision-id. | ||
194 | 2579 | with override_environ(BZR_EMAIL='me@example.com'): | ||
195 | 2580 | revid = tree.commit('') | ||
196 | 2577 | bzr_branch = db_branch.getBzrBranch() | 2581 | bzr_branch = db_branch.getBzrBranch() |
197 | 2578 | self.assertEqual(revid, bzr_branch.last_revision()) | 2582 | self.assertEqual(revid, bzr_branch.last_revision()) |
198 | 2579 | 2583 | ||
199 | 2580 | 2584 | ||
200 | === modified file 'lib/lp/code/model/tests/test_branchjob.py' | |||
201 | --- lib/lp/code/model/tests/test_branchjob.py 2010-07-29 08:06:07 +0000 | |||
202 | +++ lib/lp/code/model/tests/test_branchjob.py 2010-08-17 04:46:45 +0000 | |||
203 | @@ -3,6 +3,8 @@ | |||
204 | 3 | 3 | ||
205 | 4 | """Tests for BranchJobs.""" | 4 | """Tests for BranchJobs.""" |
206 | 5 | 5 | ||
207 | 6 | from __future__ import with_statement | ||
208 | 7 | |||
209 | 6 | __metaclass__ = type | 8 | __metaclass__ = type |
210 | 7 | 9 | ||
211 | 8 | import datetime | 10 | import datetime |
212 | @@ -41,6 +43,7 @@ | |||
213 | 41 | from lp.testing.mail_helpers import pop_notifications | 43 | from lp.testing.mail_helpers import pop_notifications |
214 | 42 | from lp.services.job.interfaces.job import JobStatus | 44 | from lp.services.job.interfaces.job import JobStatus |
215 | 43 | from lp.services.job.model.job import Job | 45 | from lp.services.job.model.job import Job |
216 | 46 | from lp.services.osutils import override_environ | ||
217 | 44 | from lp.code.bzr import BranchFormat, RepositoryFormat | 47 | from lp.code.bzr import BranchFormat, RepositoryFormat |
218 | 45 | from lp.code.enums import ( | 48 | from lp.code.enums import ( |
219 | 46 | BranchMergeProposalStatus, BranchSubscriptionDiffSize, | 49 | BranchMergeProposalStatus, BranchSubscriptionDiffSize, |
220 | @@ -104,7 +107,10 @@ | |||
221 | 104 | """Ensure that run calculates revision ids.""" | 107 | """Ensure that run calculates revision ids.""" |
222 | 105 | self.useBzrBranches(direct_database=True) | 108 | self.useBzrBranches(direct_database=True) |
223 | 106 | branch, tree = self.create_branch_and_tree() | 109 | branch, tree = self.create_branch_and_tree() |
225 | 107 | tree.commit('First commit', rev_id='rev1') | 110 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
226 | 111 | # required to generate the revision-id. | ||
227 | 112 | with override_environ(BZR_EMAIL='me@example.com'): | ||
228 | 113 | tree.commit('First commit', rev_id='rev1') | ||
229 | 108 | job = BranchDiffJob.create(branch, '0', '1') | 114 | job = BranchDiffJob.create(branch, '0', '1') |
230 | 109 | static_diff = job.run() | 115 | static_diff = job.run() |
231 | 110 | self.assertEqual('null:', static_diff.from_revision_id) | 116 | self.assertEqual('null:', static_diff.from_revision_id) |
232 | @@ -122,9 +128,12 @@ | |||
233 | 122 | tree_file = os.path.join(tree_location, 'file') | 128 | tree_file = os.path.join(tree_location, 'file') |
234 | 123 | open(tree_file, 'wb').write('foo\n') | 129 | open(tree_file, 'wb').write('foo\n') |
235 | 124 | tree.add('file') | 130 | tree.add('file') |
239 | 125 | tree.commit('First commit') | 131 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
240 | 126 | open(tree_file, 'wb').write('bar\n') | 132 | # required to generate the revision-id. |
241 | 127 | tree.commit('Next commit') | 133 | with override_environ(BZR_EMAIL='me@example.com'): |
242 | 134 | tree.commit('First commit') | ||
243 | 135 | open(tree_file, 'wb').write('bar\n') | ||
244 | 136 | tree.commit('Next commit') | ||
245 | 128 | job = BranchDiffJob.create(branch, '1', '2') | 137 | job = BranchDiffJob.create(branch, '1', '2') |
246 | 129 | static_diff = job.run() | 138 | static_diff = job.run() |
247 | 130 | transaction.commit() | 139 | transaction.commit() |
248 | @@ -138,7 +147,10 @@ | |||
249 | 138 | """Ensure running an equivalent job emits the same diff.""" | 147 | """Ensure running an equivalent job emits the same diff.""" |
250 | 139 | self.useBzrBranches(direct_database=True) | 148 | self.useBzrBranches(direct_database=True) |
251 | 140 | branch, tree = self.create_branch_and_tree() | 149 | branch, tree = self.create_branch_and_tree() |
253 | 141 | tree.commit('First commit') | 150 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
254 | 151 | # required to generate the revision-id. | ||
255 | 152 | with override_environ(BZR_EMAIL='me@example.com'): | ||
256 | 153 | tree.commit('First commit') | ||
257 | 142 | job1 = BranchDiffJob.create(branch, '0', '1') | 154 | job1 = BranchDiffJob.create(branch, '0', '1') |
258 | 143 | static_diff1 = job1.run() | 155 | static_diff1 = job1.run() |
259 | 144 | job2 = BranchDiffJob.create(branch, '0', '1') | 156 | job2 = BranchDiffJob.create(branch, '0', '1') |
260 | @@ -157,7 +169,10 @@ | |||
261 | 157 | tree_transport = tree.bzrdir.root_transport | 169 | tree_transport = tree.bzrdir.root_transport |
262 | 158 | tree_transport.put_bytes("hello.txt", "Hello World\n") | 170 | tree_transport.put_bytes("hello.txt", "Hello World\n") |
263 | 159 | tree.add('hello.txt') | 171 | tree.add('hello.txt') |
265 | 160 | tree.commit('rev1', timestamp=1e9, timezone=0) | 172 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
266 | 173 | # required to generate the revision-id. | ||
267 | 174 | with override_environ(BZR_EMAIL='me@example.com'): | ||
268 | 175 | tree.commit('rev1', timestamp=1e9, timezone=0) | ||
269 | 161 | job = BranchDiffJob.create(branch, '0', '1') | 176 | job = BranchDiffJob.create(branch, '0', '1') |
270 | 162 | diff = job.run() | 177 | diff = job.run() |
271 | 163 | transaction.commit() | 178 | transaction.commit() |
272 | @@ -202,20 +217,23 @@ | |||
273 | 202 | self.useBzrBranches(direct_database=True) | 217 | self.useBzrBranches(direct_database=True) |
274 | 203 | 218 | ||
275 | 204 | db_branch, bzr_tree = self.create_branch_and_tree() | 219 | db_branch, bzr_tree = self.create_branch_and_tree() |
290 | 205 | bzr_tree.commit('First commit', rev_id='rev1') | 220 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
291 | 206 | bzr_tree.commit('Second commit', rev_id='rev2') | 221 | # required to generate the revision-id. |
292 | 207 | bzr_tree.commit('Third commit', rev_id='rev3') | 222 | with override_environ(BZR_EMAIL='me@example.com'): |
293 | 208 | LaunchpadZopelessLayer.commit() | 223 | bzr_tree.commit('First commit', rev_id='rev1') |
294 | 209 | 224 | bzr_tree.commit('Second commit', rev_id='rev2') | |
295 | 210 | job = BranchScanJob.create(db_branch) | 225 | bzr_tree.commit('Third commit', rev_id='rev3') |
296 | 211 | LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser) | 226 | LaunchpadZopelessLayer.commit() |
297 | 212 | job.run() | 227 | |
298 | 213 | LaunchpadZopelessLayer.switchDbUser(config.launchpad.dbuser) | 228 | job = BranchScanJob.create(db_branch) |
299 | 214 | 229 | LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser) | |
300 | 215 | self.assertEqual(db_branch.revision_count, 3) | 230 | job.run() |
301 | 216 | 231 | LaunchpadZopelessLayer.switchDbUser(config.launchpad.dbuser) | |
302 | 217 | bzr_tree.commit('Fourth commit', rev_id='rev4') | 232 | |
303 | 218 | bzr_tree.commit('Fifth commit', rev_id='rev5') | 233 | self.assertEqual(db_branch.revision_count, 3) |
304 | 234 | |||
305 | 235 | bzr_tree.commit('Fourth commit', rev_id='rev4') | ||
306 | 236 | bzr_tree.commit('Fifth commit', rev_id='rev5') | ||
307 | 219 | 237 | ||
308 | 220 | job = BranchScanJob.create(db_branch) | 238 | job = BranchScanJob.create(db_branch) |
309 | 221 | LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser) | 239 | LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser) |
310 | @@ -381,7 +399,10 @@ | |||
311 | 381 | branch, tree = self.create_branch_and_tree() | 399 | branch, tree = self.create_branch_and_tree() |
312 | 382 | tree.bzrdir.root_transport.put_bytes('foo', 'bar\n') | 400 | tree.bzrdir.root_transport.put_bytes('foo', 'bar\n') |
313 | 383 | tree.add('foo') | 401 | tree.add('foo') |
315 | 384 | tree.commit('First commit') | 402 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
316 | 403 | # required to generate the revision-id. | ||
317 | 404 | with override_environ(BZR_EMAIL='me@example.com'): | ||
318 | 405 | tree.commit('First commit') | ||
319 | 385 | job = RevisionMailJob.create( | 406 | job = RevisionMailJob.create( |
320 | 386 | branch, 1, 'from@example.com', 'hello', True, 'subject') | 407 | branch, 1, 'from@example.com', 'hello', True, 'subject') |
321 | 387 | mailer = job.getMailer() | 408 | mailer = job.getMailer() |
322 | @@ -477,9 +498,12 @@ | |||
323 | 477 | branch, tree = self.create_branch_and_tree() | 498 | branch, tree = self.create_branch_and_tree() |
324 | 478 | tree.lock_write() | 499 | tree.lock_write() |
325 | 479 | try: | 500 | try: |
329 | 480 | tree.commit('rev1', rev_id='rev1') | 501 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
330 | 481 | tree.commit('rev2', rev_id='rev2') | 502 | # required to generate the revision-id. |
331 | 482 | tree.commit('rev3', rev_id='rev3') | 503 | with override_environ(BZR_EMAIL='me@example.com'): |
332 | 504 | tree.commit('rev1', rev_id='rev1') | ||
333 | 505 | tree.commit('rev2', rev_id='rev2') | ||
334 | 506 | tree.commit('rev3', rev_id='rev3') | ||
335 | 483 | transaction.commit() | 507 | transaction.commit() |
336 | 484 | self.layer.switchDbUser('branchscanner') | 508 | self.layer.switchDbUser('branchscanner') |
337 | 485 | self.updateDBRevisions( | 509 | self.updateDBRevisions( |
338 | @@ -504,7 +528,10 @@ | |||
339 | 504 | branch, tree = self.create3CommitsBranch() | 528 | branch, tree = self.create3CommitsBranch() |
340 | 505 | tree.pull(tree.branch, overwrite=True, stop_revision='rev2') | 529 | tree.pull(tree.branch, overwrite=True, stop_revision='rev2') |
341 | 506 | tree.add_parent_tree_id('rev3') | 530 | tree.add_parent_tree_id('rev3') |
343 | 507 | tree.commit('rev3a', rev_id='rev3a') | 531 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
344 | 532 | # required to generate the revision-id. | ||
345 | 533 | with override_environ(BZR_EMAIL='me@example.com'): | ||
346 | 534 | tree.commit('rev3a', rev_id='rev3a') | ||
347 | 508 | self.updateDBRevisions(branch, tree.branch, ['rev3', 'rev3a']) | 535 | self.updateDBRevisions(branch, tree.branch, ['rev3', 'rev3a']) |
348 | 509 | job = RevisionsAddedJob.create(branch, 'rev1', 'rev3', '') | 536 | job = RevisionsAddedJob.create(branch, 'rev1', 'rev3', '') |
349 | 510 | job.bzr_branch.lock_read() | 537 | job.bzr_branch.lock_read() |
350 | @@ -542,9 +569,12 @@ | |||
351 | 542 | tree.branch.nick = 'nicholas' | 569 | tree.branch.nick = 'nicholas' |
352 | 543 | tree.lock_write() | 570 | tree.lock_write() |
353 | 544 | self.addCleanup(tree.unlock) | 571 | self.addCleanup(tree.unlock) |
357 | 545 | tree.commit( | 572 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
358 | 546 | 'rev1', rev_id='rev1', timestamp=1000, timezone=0, | 573 | # required to generate the revision-id. |
359 | 547 | committer='J. Random Hacker <jrandom@example.org>') | 574 | with override_environ(BZR_EMAIL='me@example.com'): |
360 | 575 | tree.commit( | ||
361 | 576 | 'rev1', rev_id='rev1', timestamp=1000, timezone=0, | ||
362 | 577 | committer='J. Random Hacker <jrandom@example.org>') | ||
363 | 548 | return branch, tree | 578 | return branch, tree |
364 | 549 | 579 | ||
365 | 550 | def makeRevisionsAddedWithMergeCommit(self, authors=None, | 580 | def makeRevisionsAddedWithMergeCommit(self, authors=None, |
366 | @@ -558,20 +588,23 @@ | |||
367 | 558 | self.useBzrBranches(direct_database=True) | 588 | self.useBzrBranches(direct_database=True) |
368 | 559 | branch, tree = self.create_branch_and_tree() | 589 | branch, tree = self.create_branch_and_tree() |
369 | 560 | tree.branch.nick = 'nicholas' | 590 | tree.branch.nick = 'nicholas' |
384 | 561 | tree.commit('rev1') | 591 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
385 | 562 | tree2 = tree.bzrdir.sprout('tree2').open_workingtree() | 592 | # required to generate the revision-id. |
386 | 563 | tree2.commit('rev2a', rev_id='rev2a-id', committer='foo@') | 593 | with override_environ(BZR_EMAIL='me@example.com'): |
387 | 564 | tree2.commit('rev3', rev_id='rev3-id', | 594 | tree.commit('rev1') |
388 | 565 | authors=['bar@', 'baz@blaine.com']) | 595 | tree2 = tree.bzrdir.sprout('tree2').open_workingtree() |
389 | 566 | tree.merge_from_branch(tree2.branch) | 596 | tree2.commit('rev2a', rev_id='rev2a-id', committer='foo@') |
390 | 567 | tree3 = tree.bzrdir.sprout('tree3').open_workingtree() | 597 | tree2.commit('rev3', rev_id='rev3-id', |
391 | 568 | tree3.commit('rev2b', rev_id='rev2b-id', committer='qux@') | 598 | authors=['bar@', 'baz@blaine.com']) |
392 | 569 | tree.merge_from_branch(tree3.branch, force=True) | 599 | tree.merge_from_branch(tree2.branch) |
393 | 570 | if include_ghost: | 600 | tree3 = tree.bzrdir.sprout('tree3').open_workingtree() |
394 | 571 | tree.add_parent_tree_id('rev2c-id') | 601 | tree3.commit('rev2b', rev_id='rev2b-id', committer='qux@') |
395 | 572 | tree.commit('rev2d', rev_id='rev2d-id', timestamp=1000, timezone=0, | 602 | tree.merge_from_branch(tree3.branch, force=True) |
396 | 573 | committer='J. Random Hacker <jrandom@example.org>', | 603 | if include_ghost: |
397 | 574 | authors=authors) | 604 | tree.add_parent_tree_id('rev2c-id') |
398 | 605 | tree.commit('rev2d', rev_id='rev2d-id', timestamp=1000, timezone=0, | ||
399 | 606 | committer='J. Random Hacker <jrandom@example.org>', | ||
400 | 607 | authors=authors) | ||
401 | 575 | return RevisionsAddedJob.create(branch, 'rev2d-id', 'rev2d-id', '') | 608 | return RevisionsAddedJob.create(branch, 'rev2d-id', 'rev2d-id', '') |
402 | 576 | 609 | ||
403 | 577 | def test_getMergedRevisionIDs(self): | 610 | def test_getMergedRevisionIDs(self): |
404 | @@ -817,17 +850,20 @@ | |||
405 | 817 | first_revision = 'rev-1' | 850 | first_revision = 'rev-1' |
406 | 818 | tree.bzrdir.root_transport.put_bytes('hello.txt', 'Hello World\n') | 851 | tree.bzrdir.root_transport.put_bytes('hello.txt', 'Hello World\n') |
407 | 819 | tree.add('hello.txt') | 852 | tree.add('hello.txt') |
419 | 820 | tree.commit( | 853 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
420 | 821 | rev_id=first_revision, message="Log message", | 854 | # required to generate the revision-id. |
421 | 822 | committer="Joe Bloggs <joe@example.com>", timestamp=1000000000.0, | 855 | with override_environ(BZR_EMAIL='me@example.com'): |
422 | 823 | timezone=0) | 856 | tree.commit( |
423 | 824 | tree.bzrdir.root_transport.put_bytes( | 857 | rev_id=first_revision, message="Log message", |
424 | 825 | 'hello.txt', 'Hello World\n\nFoo Bar\n') | 858 | committer="Joe Bloggs <joe@example.com>", |
425 | 826 | second_revision = 'rev-2' | 859 | timestamp=1000000000.0, timezone=0) |
426 | 827 | tree.commit( | 860 | tree.bzrdir.root_transport.put_bytes( |
427 | 828 | rev_id=second_revision, message="Extended contents", | 861 | 'hello.txt', 'Hello World\n\nFoo Bar\n') |
428 | 829 | committer="Joe Bloggs <joe@example.com>", timestamp=1000100000.0, | 862 | second_revision = 'rev-2' |
429 | 830 | timezone=0) | 863 | tree.commit( |
430 | 864 | rev_id=second_revision, message="Extended contents", | ||
431 | 865 | committer="Joe Bloggs <joe@example.com>", | ||
432 | 866 | timestamp=1000100000.0, timezone=0) | ||
433 | 831 | transaction.commit() | 867 | transaction.commit() |
434 | 832 | self.layer.switchDbUser('branchscanner') | 868 | self.layer.switchDbUser('branchscanner') |
435 | 833 | self.updateDBRevisions(db_branch, tree.branch) | 869 | self.updateDBRevisions(db_branch, tree.branch) |
436 | @@ -874,9 +910,13 @@ | |||
437 | 874 | self.useBzrBranches(direct_database=True) | 910 | self.useBzrBranches(direct_database=True) |
438 | 875 | db_branch, tree = self.create_branch_and_tree() | 911 | db_branch, tree = self.create_branch_and_tree() |
439 | 876 | rev_id = 'rev-1' | 912 | rev_id = 'rev-1' |
443 | 877 | tree.commit( | 913 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
444 | 878 | rev_id=rev_id, message=u"Non ASCII: \xe9", | 914 | # required to generate the revision-id. |
445 | 879 | committer=u"Non ASCII: \xed", timestamp=1000000000.0, timezone=0) | 915 | with override_environ(BZR_EMAIL='me@example.com'): |
446 | 916 | tree.commit( | ||
447 | 917 | rev_id=rev_id, message=u"Non ASCII: \xe9", | ||
448 | 918 | committer=u"Non ASCII: \xed", timestamp=1000000000.0, | ||
449 | 919 | timezone=0) | ||
450 | 880 | transaction.commit() | 920 | transaction.commit() |
451 | 881 | self.layer.switchDbUser('branchscanner') | 921 | self.layer.switchDbUser('branchscanner') |
452 | 882 | self.updateDBRevisions(db_branch, tree.branch) | 922 | self.updateDBRevisions(db_branch, tree.branch) |
453 | @@ -986,7 +1026,10 @@ | |||
454 | 986 | [self.tree.abspath(file_pair[0]) for file_pair in files]) | 1026 | [self.tree.abspath(file_pair[0]) for file_pair in files]) |
455 | 987 | if commit_message is None: | 1027 | if commit_message is None: |
456 | 988 | commit_message = self.factory.getUniqueString('commit') | 1028 | commit_message = self.factory.getUniqueString('commit') |
458 | 989 | revision_id = self.tree.commit(commit_message) | 1029 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
459 | 1030 | # required to generate the revision-id. | ||
460 | 1031 | with override_environ(BZR_EMAIL='me@example.com'): | ||
461 | 1032 | revision_id = self.tree.commit(commit_message) | ||
462 | 990 | self.branch.last_scanned_id = revision_id | 1033 | self.branch.last_scanned_id = revision_id |
463 | 991 | self.branch.last_mirrored_id = revision_id | 1034 | self.branch.last_mirrored_id = revision_id |
464 | 992 | return revision_id | 1035 | return revision_id |
465 | 993 | 1036 | ||
466 | === modified file 'lib/lp/code/model/tests/test_branchmergeproposaljobs.py' | |||
467 | --- lib/lp/code/model/tests/test_branchmergeproposaljobs.py 2010-06-11 01:51:15 +0000 | |||
468 | +++ lib/lp/code/model/tests/test_branchmergeproposaljobs.py 2010-08-17 04:46:45 +0000 | |||
469 | @@ -3,6 +3,8 @@ | |||
470 | 3 | 3 | ||
471 | 4 | """Tests for branch merge proposal jobs.""" | 4 | """Tests for branch merge proposal jobs.""" |
472 | 5 | 5 | ||
473 | 6 | from __future__ import with_statement | ||
474 | 7 | |||
475 | 6 | __metaclass__ = type | 8 | __metaclass__ = type |
476 | 7 | 9 | ||
477 | 8 | from datetime import datetime, timedelta | 10 | from datetime import datetime, timedelta |
478 | @@ -39,6 +41,7 @@ | |||
479 | 39 | from lp.code.subscribers.branchmergeproposal import merge_proposal_modified | 41 | from lp.code.subscribers.branchmergeproposal import merge_proposal_modified |
480 | 40 | from lp.services.job.runner import JobRunner | 42 | from lp.services.job.runner import JobRunner |
481 | 41 | from lp.services.job.model.job import Job | 43 | from lp.services.job.model.job import Job |
482 | 44 | from lp.services.osutils import override_environ | ||
483 | 42 | from lp.testing import TestCaseWithFactory | 45 | from lp.testing import TestCaseWithFactory |
484 | 43 | from lp.testing.mail_helpers import pop_notifications | 46 | from lp.testing.mail_helpers import pop_notifications |
485 | 44 | 47 | ||
486 | @@ -104,7 +107,10 @@ | |||
487 | 104 | 107 | ||
488 | 105 | def createProposalWithEmptyBranches(self): | 108 | def createProposalWithEmptyBranches(self): |
489 | 106 | target_branch, tree = self.create_branch_and_tree() | 109 | target_branch, tree = self.create_branch_and_tree() |
491 | 107 | tree.commit('test') | 110 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
492 | 111 | # required to generate the revision-id. | ||
493 | 112 | with override_environ(BZR_EMAIL='me@example.com'): | ||
494 | 113 | tree.commit('test') | ||
495 | 108 | source_branch = self.factory.makeProductBranch( | 114 | source_branch = self.factory.makeProductBranch( |
496 | 109 | product=target_branch.product) | 115 | product=target_branch.product) |
497 | 110 | self.createBzrBranch(source_branch, tree.branch) | 116 | self.createBzrBranch(source_branch, tree.branch) |
498 | @@ -137,7 +143,10 @@ | |||
499 | 137 | bmp = self.factory.makeBranchMergeProposal( | 143 | bmp = self.factory.makeBranchMergeProposal( |
500 | 138 | target_branch=self.factory.makePackageBranch()) | 144 | target_branch=self.factory.makePackageBranch()) |
501 | 139 | tree = self.create_branch_and_tree(db_branch=bmp.target_branch)[1] | 145 | tree = self.create_branch_and_tree(db_branch=bmp.target_branch)[1] |
503 | 140 | tree.commit('Initial commit') | 146 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
504 | 147 | # required to generate the revision-id. | ||
505 | 148 | with override_environ(BZR_EMAIL='me@example.com'): | ||
506 | 149 | tree.commit('Initial commit') | ||
507 | 141 | self.createBzrBranch(bmp.source_branch, tree.branch) | 150 | self.createBzrBranch(bmp.source_branch, tree.branch) |
508 | 142 | self.factory.makeRevisionsForBranch(bmp.source_branch, count=1) | 151 | self.factory.makeRevisionsForBranch(bmp.source_branch, count=1) |
509 | 143 | job = MergeProposalCreatedJob.create(bmp) | 152 | job = MergeProposalCreatedJob.create(bmp) |
510 | 144 | 153 | ||
511 | === modified file 'lib/lp/code/model/tests/test_diff.py' | |||
512 | --- lib/lp/code/model/tests/test_diff.py 2010-08-02 02:13:52 +0000 | |||
513 | +++ lib/lp/code/model/tests/test_diff.py 2010-08-17 04:46:45 +0000 | |||
514 | @@ -3,6 +3,8 @@ | |||
515 | 3 | 3 | ||
516 | 4 | """Tests for Diff, etc.""" | 4 | """Tests for Diff, etc.""" |
517 | 5 | 5 | ||
518 | 6 | from __future__ import with_statement | ||
519 | 7 | |||
520 | 6 | __metaclass__ = type | 8 | __metaclass__ = type |
521 | 7 | 9 | ||
522 | 8 | 10 | ||
523 | @@ -26,6 +28,7 @@ | |||
524 | 26 | from lp.code.interfaces.diff import ( | 28 | from lp.code.interfaces.diff import ( |
525 | 27 | IDiff, IPreviewDiff, IStaticDiff, IStaticDiffSource) | 29 | IDiff, IPreviewDiff, IStaticDiff, IStaticDiffSource) |
526 | 28 | from lp.testing import login, login_person, TestCaseWithFactory | 30 | from lp.testing import login, login_person, TestCaseWithFactory |
527 | 31 | from lp.services.osutils import override_environ | ||
528 | 29 | 32 | ||
529 | 30 | 33 | ||
530 | 31 | class RecordLister(logging.Handler): | 34 | class RecordLister(logging.Handler): |
531 | @@ -285,7 +288,10 @@ | |||
532 | 285 | """Ensure that acquire returns the existing StaticDiff.""" | 288 | """Ensure that acquire returns the existing StaticDiff.""" |
533 | 286 | self.useBzrBranches(direct_database=True) | 289 | self.useBzrBranches(direct_database=True) |
534 | 287 | branch, tree = self.create_branch_and_tree() | 290 | branch, tree = self.create_branch_and_tree() |
536 | 288 | tree.commit('First commit', rev_id='rev1') | 291 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
537 | 292 | # required to generate the revision-id. | ||
538 | 293 | with override_environ(BZR_EMAIL='me@example.com'): | ||
539 | 294 | tree.commit('First commit', rev_id='rev1') | ||
540 | 289 | diff1 = StaticDiff.acquire('null:', 'rev1', tree.branch.repository) | 295 | diff1 = StaticDiff.acquire('null:', 'rev1', tree.branch.repository) |
541 | 290 | diff2 = StaticDiff.acquire('null:', 'rev1', tree.branch.repository) | 296 | diff2 = StaticDiff.acquire('null:', 'rev1', tree.branch.repository) |
542 | 291 | self.assertIs(diff1, diff2) | 297 | self.assertIs(diff1, diff2) |
543 | @@ -294,7 +300,10 @@ | |||
544 | 294 | """The existing object is used even if the repository is different.""" | 300 | """The existing object is used even if the repository is different.""" |
545 | 295 | self.useBzrBranches(direct_database=True) | 301 | self.useBzrBranches(direct_database=True) |
546 | 296 | branch1, tree1 = self.create_branch_and_tree('tree1') | 302 | branch1, tree1 = self.create_branch_and_tree('tree1') |
548 | 297 | tree1.commit('First commit', rev_id='rev1') | 303 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
549 | 304 | # required to generate the revision-id. | ||
550 | 305 | with override_environ(BZR_EMAIL='me@example.com'): | ||
551 | 306 | tree1.commit('First commit', rev_id='rev1') | ||
552 | 298 | branch2, tree2 = self.create_branch_and_tree('tree2') | 307 | branch2, tree2 = self.create_branch_and_tree('tree2') |
553 | 299 | tree2.pull(tree1.branch) | 308 | tree2.pull(tree1.branch) |
554 | 300 | diff1 = StaticDiff.acquire('null:', 'rev1', tree1.branch.repository) | 309 | diff1 = StaticDiff.acquire('null:', 'rev1', tree1.branch.repository) |
555 | @@ -305,8 +314,11 @@ | |||
556 | 305 | """A new object is created if there is no existant matching object.""" | 314 | """A new object is created if there is no existant matching object.""" |
557 | 306 | self.useBzrBranches(direct_database=True) | 315 | self.useBzrBranches(direct_database=True) |
558 | 307 | branch, tree = self.create_branch_and_tree() | 316 | branch, tree = self.create_branch_and_tree() |
561 | 308 | tree.commit('First commit', rev_id='rev1') | 317 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
562 | 309 | tree.commit('Next commit', rev_id='rev2') | 318 | # required to generate the revision-id. |
563 | 319 | with override_environ(BZR_EMAIL='me@example.com'): | ||
564 | 320 | tree.commit('First commit', rev_id='rev1') | ||
565 | 321 | tree.commit('Next commit', rev_id='rev2') | ||
566 | 310 | diff1 = StaticDiff.acquire('null:', 'rev1', tree.branch.repository) | 322 | diff1 = StaticDiff.acquire('null:', 'rev1', tree.branch.repository) |
567 | 311 | diff2 = StaticDiff.acquire('rev1', 'rev2', tree.branch.repository) | 323 | diff2 = StaticDiff.acquire('rev1', 'rev2', tree.branch.repository) |
568 | 312 | self.assertIsNot(diff1, diff2) | 324 | self.assertIsNot(diff1, diff2) |
569 | 313 | 325 | ||
570 | === modified file 'lib/lp/code/scripts/tests/test_scan_branches.py' | |||
571 | --- lib/lp/code/scripts/tests/test_scan_branches.py 2010-06-07 09:11:06 +0000 | |||
572 | +++ lib/lp/code/scripts/tests/test_scan_branches.py 2010-08-17 04:46:45 +0000 | |||
573 | @@ -6,6 +6,8 @@ | |||
574 | 6 | """Test the scan_branches script.""" | 6 | """Test the scan_branches script.""" |
575 | 7 | 7 | ||
576 | 8 | 8 | ||
577 | 9 | from __future__ import with_statement | ||
578 | 10 | |||
579 | 9 | from storm.locals import Store | 11 | from storm.locals import Store |
580 | 10 | import transaction | 12 | import transaction |
581 | 11 | 13 | ||
582 | @@ -17,6 +19,7 @@ | |||
583 | 17 | CodeReviewNotificationLevel) | 19 | CodeReviewNotificationLevel) |
584 | 18 | from lp.code.model.branchjob import BranchJob, BranchJobType, BranchScanJob | 20 | from lp.code.model.branchjob import BranchJob, BranchJobType, BranchScanJob |
585 | 19 | from lp.services.job.model.job import Job, JobStatus | 21 | from lp.services.job.model.job import Job, JobStatus |
586 | 22 | from lp.services.osutils import override_environ | ||
587 | 20 | 23 | ||
588 | 21 | 24 | ||
589 | 22 | class TestScanBranches(TestCaseWithFactory): | 25 | class TestScanBranches(TestCaseWithFactory): |
590 | @@ -27,9 +30,12 @@ | |||
591 | 27 | def make_branch_with_commits_and_scan_job(self, db_branch): | 30 | def make_branch_with_commits_and_scan_job(self, db_branch): |
592 | 28 | """Create a branch from a db_branch, make commits and a scan job.""" | 31 | """Create a branch from a db_branch, make commits and a scan job.""" |
593 | 29 | target, target_tree = self.create_branch_and_tree(db_branch=db_branch) | 32 | target, target_tree = self.create_branch_and_tree(db_branch=db_branch) |
597 | 30 | target_tree.commit('First commit', rev_id='rev1') | 33 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
598 | 31 | target_tree.commit('Second commit', rev_id='rev2') | 34 | # required to generate the revision-id. |
599 | 32 | target_tree.commit('Third commit', rev_id='rev3') | 35 | with override_environ(BZR_EMAIL='me@example.com'): |
600 | 36 | target_tree.commit('First commit', rev_id='rev1') | ||
601 | 37 | target_tree.commit('Second commit', rev_id='rev2') | ||
602 | 38 | target_tree.commit('Third commit', rev_id='rev3') | ||
603 | 33 | BranchScanJob.create(db_branch) | 39 | BranchScanJob.create(db_branch) |
604 | 34 | transaction.commit() | 40 | transaction.commit() |
605 | 35 | 41 | ||
606 | 36 | 42 | ||
607 | === modified file 'lib/lp/code/scripts/tests/test_sendbranchmail.py' | |||
608 | --- lib/lp/code/scripts/tests/test_sendbranchmail.py 2010-06-07 09:11:06 +0000 | |||
609 | +++ lib/lp/code/scripts/tests/test_sendbranchmail.py 2010-08-17 04:46:45 +0000 | |||
610 | @@ -5,6 +5,8 @@ | |||
611 | 5 | 5 | ||
612 | 6 | """Test the sendbranchmail script""" | 6 | """Test the sendbranchmail script""" |
613 | 7 | 7 | ||
614 | 8 | from __future__ import with_statement | ||
615 | 9 | |||
616 | 8 | import unittest | 10 | import unittest |
617 | 9 | import transaction | 11 | import transaction |
618 | 10 | 12 | ||
619 | @@ -16,6 +18,7 @@ | |||
620 | 16 | from lp.code.model.branchjob import ( | 18 | from lp.code.model.branchjob import ( |
621 | 17 | RevisionMailJob, RevisionsAddedJob) | 19 | RevisionMailJob, RevisionsAddedJob) |
622 | 18 | from lp.testing import TestCaseWithFactory | 20 | from lp.testing import TestCaseWithFactory |
623 | 21 | from lp.services.osutils import override_environ | ||
624 | 19 | 22 | ||
625 | 20 | 23 | ||
626 | 21 | class TestSendbranchmail(TestCaseWithFactory): | 24 | class TestSendbranchmail(TestCaseWithFactory): |
627 | @@ -33,7 +36,10 @@ | |||
628 | 33 | transport = tree.bzrdir.root_transport | 36 | transport = tree.bzrdir.root_transport |
629 | 34 | transport.put_bytes('foo', 'bar') | 37 | transport.put_bytes('foo', 'bar') |
630 | 35 | tree.add('foo') | 38 | tree.add('foo') |
632 | 36 | tree.commit('Added foo.', rev_id='rev1') | 39 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
633 | 40 | # required to generate the revision-id. | ||
634 | 41 | with override_environ(BZR_EMAIL='me@example.com'): | ||
635 | 42 | tree.commit('Added foo.', rev_id='rev1') | ||
636 | 37 | return branch, tree | 43 | return branch, tree |
637 | 38 | 44 | ||
638 | 39 | def test_sendbranchmail(self): | 45 | def test_sendbranchmail(self): |
639 | @@ -73,7 +79,10 @@ | |||
640 | 73 | self.useBzrBranches() | 79 | self.useBzrBranches() |
641 | 74 | branch, tree = self.createBranch() | 80 | branch, tree = self.createBranch() |
642 | 75 | tree.bzrdir.root_transport.put_bytes('foo', 'baz') | 81 | tree.bzrdir.root_transport.put_bytes('foo', 'baz') |
644 | 76 | tree.commit('Added foo.', rev_id='rev2') | 82 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
645 | 83 | # required to generate the revision-id. | ||
646 | 84 | with override_environ(BZR_EMAIL='me@example.com'): | ||
647 | 85 | tree.commit('Added foo.', rev_id='rev2') | ||
648 | 77 | RevisionsAddedJob.create( | 86 | RevisionsAddedJob.create( |
649 | 78 | branch, 'rev1', 'rev2', 'from@example.org') | 87 | branch, 'rev1', 'rev2', 'from@example.org') |
650 | 79 | transaction.commit() | 88 | transaction.commit() |
651 | 80 | 89 | ||
652 | === modified file 'lib/lp/codehosting/codeimport/tests/test_worker.py' | |||
653 | --- lib/lp/codehosting/codeimport/tests/test_worker.py 2010-08-02 23:01:15 +0000 | |||
654 | +++ lib/lp/codehosting/codeimport/tests/test_worker.py 2010-08-17 04:46:45 +0000 | |||
655 | @@ -952,7 +952,7 @@ | |||
656 | 952 | t = get_transport(self.get_url('.')) | 952 | t = get_transport(self.get_url('.')) |
657 | 953 | t.mkdir('reference') | 953 | t.mkdir('reference') |
658 | 954 | a_bzrdir = BzrDir.create(self.get_url('reference')) | 954 | a_bzrdir = BzrDir.create(self.get_url('reference')) |
660 | 955 | BranchReferenceFormat().initialize(a_bzrdir, branch) | 955 | BranchReferenceFormat().initialize(a_bzrdir, target_branch=branch) |
661 | 956 | return a_bzrdir.root_transport.base | 956 | return a_bzrdir.root_transport.base |
662 | 957 | 957 | ||
663 | 958 | def test_reject_branch_reference(self): | 958 | def test_reject_branch_reference(self): |
664 | 959 | 959 | ||
665 | === modified file 'lib/lp/codehosting/codeimport/uifactory.py' | |||
666 | --- lib/lp/codehosting/codeimport/uifactory.py 2009-08-24 16:27:33 +0000 | |||
667 | +++ lib/lp/codehosting/codeimport/uifactory.py 2010-08-17 04:46:45 +0000 | |||
668 | @@ -75,6 +75,24 @@ | |||
669 | 75 | # There's no point showing a progress bar in a flat log. | 75 | # There's no point showing a progress bar in a flat log. |
670 | 76 | return '' | 76 | return '' |
671 | 77 | 77 | ||
672 | 78 | def _render_line(self): | ||
673 | 79 | bar_string = self._render_bar() | ||
674 | 80 | if self._last_task: | ||
675 | 81 | task_part, counter_part = self._format_task(self._last_task) | ||
676 | 82 | else: | ||
677 | 83 | task_part = counter_part = '' | ||
678 | 84 | if self._last_task and not self._last_task.show_transport_activity: | ||
679 | 85 | trans = '' | ||
680 | 86 | else: | ||
681 | 87 | trans = self._last_transport_msg | ||
682 | 88 | # the bar separates the transport activity from the message, so even | ||
683 | 89 | # if there's no bar or spinner, we must show something if both those | ||
684 | 90 | # fields are present | ||
685 | 91 | if (task_part and trans) and not bar_string: | ||
686 | 92 | bar_string = ' | ' | ||
687 | 93 | s = trans + bar_string + task_part + counter_part | ||
688 | 94 | return s | ||
689 | 95 | |||
690 | 78 | def _format_transport_msg(self, scheme, dir_char, rate): | 96 | def _format_transport_msg(self, scheme, dir_char, rate): |
691 | 79 | # We just report the amount of data transferred. | 97 | # We just report the amount of data transferred. |
692 | 80 | return '%s bytes transferred' % self._bytes_since_update | 98 | return '%s bytes transferred' % self._bytes_since_update |
693 | 81 | 99 | ||
694 | === modified file 'lib/lp/codehosting/puller/worker.py' | |||
695 | --- lib/lp/codehosting/puller/worker.py 2010-04-21 01:56:51 +0000 | |||
696 | +++ lib/lp/codehosting/puller/worker.py 2010-08-17 04:46:45 +0000 | |||
697 | @@ -503,7 +503,7 @@ | |||
698 | 503 | def get_boolean(self, prompt): | 503 | def get_boolean(self, prompt): |
699 | 504 | """If we're asked to break a lock like a stale lock of ours, say yes. | 504 | """If we're asked to break a lock like a stale lock of ours, say yes. |
700 | 505 | """ | 505 | """ |
702 | 506 | assert prompt.startswith('Break lock'), ( | 506 | assert prompt.startswith('Break '), ( |
703 | 507 | "Didn't expect prompt %r" % (prompt,)) | 507 | "Didn't expect prompt %r" % (prompt,)) |
704 | 508 | branch_id = self.puller_worker_protocol.branch_id | 508 | branch_id = self.puller_worker_protocol.branch_id |
705 | 509 | if get_lock_id_for_branch_id(branch_id) in prompt: | 509 | if get_lock_id_for_branch_id(branch_id) in prompt: |
706 | 510 | 510 | ||
707 | === modified file 'lib/lp/codehosting/scanner/tests/test_buglinks.py' | |||
708 | --- lib/lp/codehosting/scanner/tests/test_buglinks.py 2010-08-02 02:13:52 +0000 | |||
709 | +++ lib/lp/codehosting/scanner/tests/test_buglinks.py 2010-08-17 04:46:45 +0000 | |||
710 | @@ -3,6 +3,8 @@ | |||
711 | 3 | 3 | ||
712 | 4 | """Tests for creating BugBranch items based on Bazaar revisions.""" | 4 | """Tests for creating BugBranch items based on Bazaar revisions.""" |
713 | 5 | 5 | ||
714 | 6 | from __future__ import with_statement | ||
715 | 7 | |||
716 | 6 | __metaclass__ = type | 8 | __metaclass__ = type |
717 | 7 | 9 | ||
718 | 8 | import unittest | 10 | import unittest |
719 | @@ -22,6 +24,7 @@ | |||
720 | 22 | from lp.codehosting.scanner.tests.test_bzrsync import BzrSyncTestCase | 24 | from lp.codehosting.scanner.tests.test_bzrsync import BzrSyncTestCase |
721 | 23 | from lp.registry.interfaces.pocket import PackagePublishingPocket | 25 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
722 | 24 | from lp.testing import TestCase, TestCaseWithFactory | 26 | from lp.testing import TestCase, TestCaseWithFactory |
723 | 27 | from lp.services.osutils import override_environ | ||
724 | 25 | 28 | ||
725 | 26 | 29 | ||
726 | 27 | class RevisionPropertyParsing(TestCase): | 30 | class RevisionPropertyParsing(TestCase): |
727 | @@ -189,28 +192,31 @@ | |||
728 | 189 | """Don't add BugBranches based on non-mainline revisions.""" | 192 | """Don't add BugBranches based on non-mainline revisions.""" |
729 | 190 | # Make the base revision. | 193 | # Make the base revision. |
730 | 191 | author = self.factory.getUniqueString() | 194 | author = self.factory.getUniqueString() |
753 | 192 | self.bzr_tree.commit( | 195 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
754 | 193 | u'common parent', committer=author, rev_id='r1', | 196 | # required to generate the revision-id. |
755 | 194 | allow_pointless=True) | 197 | with override_environ(BZR_EMAIL='me@example.com'): |
756 | 195 | 198 | self.bzr_tree.commit( | |
757 | 196 | # Branch from the base revision. | 199 | u'common parent', committer=author, rev_id='r1', |
758 | 197 | new_tree = self.make_branch_and_tree('bzr_branch_merged') | 200 | allow_pointless=True) |
759 | 198 | new_tree.pull(self.bzr_branch) | 201 | |
760 | 199 | 202 | # Branch from the base revision. | |
761 | 200 | # Commit to both branches | 203 | new_tree = self.make_branch_and_tree('bzr_branch_merged') |
762 | 201 | self.bzr_tree.commit( | 204 | new_tree.pull(self.bzr_branch) |
763 | 202 | u'commit one', committer=author, rev_id='r2', | 205 | |
764 | 203 | allow_pointless=True) | 206 | # Commit to both branches |
765 | 204 | new_tree.commit( | 207 | self.bzr_tree.commit( |
766 | 205 | u'commit two', committer=author, rev_id='r1.1.1', | 208 | u'commit one', committer=author, rev_id='r2', |
767 | 206 | allow_pointless=True, | 209 | allow_pointless=True) |
768 | 207 | revprops={'bugs': '%s fixed' % self.getBugURL(self.bug1)}) | 210 | new_tree.commit( |
769 | 208 | 211 | u'commit two', committer=author, rev_id='r1.1.1', | |
770 | 209 | # Merge and commit. | 212 | allow_pointless=True, |
771 | 210 | self.bzr_tree.merge_from_branch(new_tree.branch) | 213 | revprops={'bugs': '%s fixed' % self.getBugURL(self.bug1)}) |
772 | 211 | self.bzr_tree.commit( | 214 | |
773 | 212 | u'merge', committer=author, rev_id='r3', | 215 | # Merge and commit. |
774 | 213 | allow_pointless=True) | 216 | self.bzr_tree.merge_from_branch(new_tree.branch) |
775 | 217 | self.bzr_tree.commit( | ||
776 | 218 | u'merge', committer=author, rev_id='r3', | ||
777 | 219 | allow_pointless=True) | ||
778 | 214 | 220 | ||
779 | 215 | self.syncBazaarBranchToDatabase(self.bzr_branch, self.db_branch) | 221 | self.syncBazaarBranchToDatabase(self.bzr_branch, self.db_branch) |
780 | 216 | self.assertEqual( | 222 | self.assertEqual( |
781 | @@ -251,8 +257,12 @@ | |||
782 | 251 | bug = self.factory.makeBug() | 257 | bug = self.factory.makeBug() |
783 | 252 | self.layer.txn.commit() | 258 | self.layer.txn.commit() |
784 | 253 | LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser) | 259 | LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser) |
787 | 254 | revision_id = tree.commit('fix revision', | 260 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
788 | 255 | revprops={'bugs': 'https://launchpad.net/bugs/%d fixed' % bug.id}) | 261 | # required to generate the revision-id. |
789 | 262 | with override_environ(BZR_EMAIL='me@example.com'): | ||
790 | 263 | revision_id = tree.commit('fix revision', | ||
791 | 264 | revprops={ | ||
792 | 265 | 'bugs': 'https://launchpad.net/bugs/%d fixed' % bug.id}) | ||
793 | 256 | bzr_revision = tree.branch.repository.get_revision(revision_id) | 266 | bzr_revision = tree.branch.repository.get_revision(revision_id) |
794 | 257 | revno = 1 | 267 | revno = 1 |
795 | 258 | revision_set = getUtility(IRevisionSet) | 268 | revision_set = getUtility(IRevisionSet) |
796 | 259 | 269 | ||
797 | === modified file 'lib/lp/codehosting/scanner/tests/test_bzrsync.py' | |||
798 | --- lib/lp/codehosting/scanner/tests/test_bzrsync.py 2010-07-14 14:48:46 +0000 | |||
799 | +++ lib/lp/codehosting/scanner/tests/test_bzrsync.py 2010-08-17 04:46:45 +0000 | |||
800 | @@ -5,6 +5,8 @@ | |||
801 | 5 | 5 | ||
802 | 6 | # pylint: disable-msg=W0141 | 6 | # pylint: disable-msg=W0141 |
803 | 7 | 7 | ||
804 | 8 | from __future__ import with_statement | ||
805 | 9 | |||
806 | 8 | import datetime | 10 | import datetime |
807 | 9 | import os | 11 | import os |
808 | 10 | import random | 12 | import random |
809 | @@ -32,6 +34,7 @@ | |||
810 | 32 | from lp.codehosting.scanner.bzrsync import BzrSync | 34 | from lp.codehosting.scanner.bzrsync import BzrSync |
811 | 33 | from lp.testing import TestCaseWithFactory | 35 | from lp.testing import TestCaseWithFactory |
812 | 34 | from canonical.testing import LaunchpadZopelessLayer | 36 | from canonical.testing import LaunchpadZopelessLayer |
813 | 37 | from lp.services.osutils import override_environ | ||
814 | 35 | 38 | ||
815 | 36 | 39 | ||
816 | 37 | def run_as_db_user(username): | 40 | def run_as_db_user(username): |
817 | @@ -160,10 +163,13 @@ | |||
818 | 160 | committer = self.factory.getUniqueString() | 163 | committer = self.factory.getUniqueString() |
819 | 161 | if extra_parents is not None: | 164 | if extra_parents is not None: |
820 | 162 | self.bzr_tree.add_pending_merge(*extra_parents) | 165 | self.bzr_tree.add_pending_merge(*extra_parents) |
825 | 163 | return self.bzr_tree.commit( | 166 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
826 | 164 | message, committer=committer, rev_id=rev_id, | 167 | # required to generate the revision-id. |
827 | 165 | timestamp=timestamp, timezone=timezone, allow_pointless=True, | 168 | with override_environ(BZR_EMAIL='me@example.com'): |
828 | 166 | revprops=revprops) | 169 | return self.bzr_tree.commit( |
829 | 170 | message, committer=committer, rev_id=rev_id, | ||
830 | 171 | timestamp=timestamp, timezone=timezone, allow_pointless=True, | ||
831 | 172 | revprops=revprops) | ||
832 | 167 | 173 | ||
833 | 168 | def uncommitRevision(self): | 174 | def uncommitRevision(self): |
834 | 169 | branch = self.bzr_tree.branch | 175 | branch = self.bzr_tree.branch |
835 | @@ -207,21 +213,24 @@ | |||
836 | 207 | db_branch = self.makeDatabaseBranch() | 213 | db_branch = self.makeDatabaseBranch() |
837 | 208 | db_branch, trunk_tree = self.create_branch_and_tree( | 214 | db_branch, trunk_tree = self.create_branch_and_tree( |
838 | 209 | db_branch=db_branch) | 215 | db_branch=db_branch) |
854 | 210 | trunk_tree.commit(u'base revision', rev_id=base_rev_id) | 216 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
855 | 211 | 217 | # required to generate the revision-id. | |
856 | 212 | # Branch from the base revision. | 218 | with override_environ(BZR_EMAIL='me@example.com'): |
857 | 213 | new_db_branch = self.makeDatabaseBranch(product=db_branch.product) | 219 | trunk_tree.commit(u'base revision', rev_id=base_rev_id) |
858 | 214 | new_db_branch, branch_tree = self.create_branch_and_tree( | 220 | |
859 | 215 | db_branch=new_db_branch) | 221 | # Branch from the base revision. |
860 | 216 | branch_tree.pull(trunk_tree.branch) | 222 | new_db_branch = self.makeDatabaseBranch(product=db_branch.product) |
861 | 217 | 223 | new_db_branch, branch_tree = self.create_branch_and_tree( | |
862 | 218 | # Commit to both branches. | 224 | db_branch=new_db_branch) |
863 | 219 | trunk_tree.commit(u'trunk revision', rev_id=trunk_rev_id) | 225 | branch_tree.pull(trunk_tree.branch) |
864 | 220 | branch_tree.commit(u'branch revision', rev_id=branch_rev_id) | 226 | |
865 | 221 | 227 | # Commit to both branches. | |
866 | 222 | # Merge branch into trunk. | 228 | trunk_tree.commit(u'trunk revision', rev_id=trunk_rev_id) |
867 | 223 | trunk_tree.merge_from_branch(branch_tree.branch) | 229 | branch_tree.commit(u'branch revision', rev_id=branch_rev_id) |
868 | 224 | trunk_tree.commit(u'merge revision', rev_id=merge_rev_id) | 230 | |
869 | 231 | # Merge branch into trunk. | ||
870 | 232 | trunk_tree.merge_from_branch(branch_tree.branch) | ||
871 | 233 | trunk_tree.commit(u'merge revision', rev_id=merge_rev_id) | ||
872 | 225 | 234 | ||
873 | 226 | LaunchpadZopelessLayer.txn.commit() | 235 | LaunchpadZopelessLayer.txn.commit() |
874 | 227 | LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser) | 236 | LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser) |
875 | 228 | 237 | ||
876 | === modified file 'lib/lp/codehosting/scanner/tests/test_mergedetection.py' | |||
877 | --- lib/lp/codehosting/scanner/tests/test_mergedetection.py 2010-04-12 17:02:16 +0000 | |||
878 | +++ lib/lp/codehosting/scanner/tests/test_mergedetection.py 2010-08-17 04:46:45 +0000 | |||
879 | @@ -3,6 +3,8 @@ | |||
880 | 3 | 3 | ||
881 | 4 | """Tests for the scanner's merge detection.""" | 4 | """Tests for the scanner's merge detection.""" |
882 | 5 | 5 | ||
883 | 6 | from __future__ import with_statement | ||
884 | 7 | |||
885 | 6 | __metaclass__ = type | 8 | __metaclass__ = type |
886 | 7 | 9 | ||
887 | 8 | import logging | 10 | import logging |
888 | @@ -27,6 +29,7 @@ | |||
889 | 27 | BranchMergeProposalJob, BranchMergeProposalJobFactory, | 29 | BranchMergeProposalJob, BranchMergeProposalJobFactory, |
890 | 28 | BranchMergeProposalJobType) | 30 | BranchMergeProposalJobType) |
891 | 29 | from lp.code.interfaces.branchlookup import IBranchLookup | 31 | from lp.code.interfaces.branchlookup import IBranchLookup |
892 | 32 | from lp.services.osutils import override_environ | ||
893 | 30 | from lp.testing import TestCase, TestCaseWithFactory | 33 | from lp.testing import TestCase, TestCaseWithFactory |
894 | 31 | from lp.testing.mail_helpers import pop_notifications | 34 | from lp.testing.mail_helpers import pop_notifications |
895 | 32 | 35 | ||
896 | @@ -129,7 +132,10 @@ | |||
897 | 129 | proposal, db_trunk, db_branch, branch_tree = ( | 132 | proposal, db_trunk, db_branch, branch_tree = ( |
898 | 130 | self._createBranchesAndProposal()) | 133 | self._createBranchesAndProposal()) |
899 | 131 | 134 | ||
901 | 132 | branch_tree.commit(u'another revision', rev_id='another-rev') | 135 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
902 | 136 | # required to generate the revision-id. | ||
903 | 137 | with override_environ(BZR_EMAIL='me@example.com'): | ||
904 | 138 | branch_tree.commit(u'another revision', rev_id='another-rev') | ||
905 | 133 | current_proposal_status = proposal.queue_status | 139 | current_proposal_status = proposal.queue_status |
906 | 134 | self.assertNotEqual( | 140 | self.assertNotEqual( |
907 | 135 | current_proposal_status, | 141 | current_proposal_status, |
908 | @@ -147,7 +153,10 @@ | |||
909 | 147 | proposal, db_trunk, db_branch, branch_tree = ( | 153 | proposal, db_trunk, db_branch, branch_tree = ( |
910 | 148 | self._createBranchesAndProposal()) | 154 | self._createBranchesAndProposal()) |
911 | 149 | 155 | ||
913 | 150 | branch_tree.commit(u'another revision', rev_id='another-rev') | 156 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
914 | 157 | # required to generate the revision-id. | ||
915 | 158 | with override_environ(BZR_EMAIL='me@example.com'): | ||
916 | 159 | branch_tree.commit(u'another revision', rev_id='another-rev') | ||
917 | 151 | current_proposal_status = proposal.queue_status | 160 | current_proposal_status = proposal.queue_status |
918 | 152 | self.assertNotEqual( | 161 | self.assertNotEqual( |
919 | 153 | current_proposal_status, | 162 | current_proposal_status, |
920 | 154 | 163 | ||
921 | === modified file 'lib/lp/codehosting/tests/test_acceptance.py' | |||
922 | --- lib/lp/codehosting/tests/test_acceptance.py 2010-08-05 11:56:34 +0000 | |||
923 | +++ lib/lp/codehosting/tests/test_acceptance.py 2010-08-17 04:46:45 +0000 | |||
924 | @@ -242,10 +242,7 @@ | |||
925 | 242 | creator_id, '/~%s/%s/%s' % (user, product, branch)) | 242 | creator_id, '/~%s/%s/%s' % (user, product, branch)) |
926 | 243 | branch_url = 'file://' + os.path.abspath( | 243 | branch_url = 'file://' + os.path.abspath( |
927 | 244 | os.path.join(branch_root, branch_id_to_path(branch_id))) | 244 | os.path.join(branch_root, branch_id_to_path(branch_id))) |
932 | 245 | self.runInChdir( | 245 | self.push(self.local_branch_path, branch_url, ['--create-prefix']) |
929 | 246 | self.local_branch_path, | ||
930 | 247 | self.run_bzr, ['push', '--create-prefix', branch_url], | ||
931 | 248 | retcode=None) | ||
933 | 249 | return branch_url | 246 | return branch_url |
934 | 250 | 247 | ||
935 | 251 | 248 | ||
936 | 252 | 249 | ||
937 | === modified file 'lib/lp/codehosting/tests/test_branchdistro.py' | |||
938 | --- lib/lp/codehosting/tests/test_branchdistro.py 2010-04-23 05:49:08 +0000 | |||
939 | +++ lib/lp/codehosting/tests/test_branchdistro.py 2010-08-17 04:46:45 +0000 | |||
940 | @@ -4,6 +4,8 @@ | |||
941 | 4 | """Tests for making new source package branches just after a distro release. | 4 | """Tests for making new source package branches just after a distro release. |
942 | 5 | """ | 5 | """ |
943 | 6 | 6 | ||
944 | 7 | from __future__ import with_statement | ||
945 | 8 | |||
946 | 7 | __metaclass__ = type | 9 | __metaclass__ = type |
947 | 8 | 10 | ||
948 | 9 | import os | 11 | import os |
949 | @@ -32,6 +34,7 @@ | |||
950 | 32 | from lp.codehosting.vfs import branch_id_to_path | 34 | from lp.codehosting.vfs import branch_id_to_path |
951 | 33 | from lp.registry.interfaces.pocket import PackagePublishingPocket | 35 | from lp.registry.interfaces.pocket import PackagePublishingPocket |
952 | 34 | from lp.testing import TestCaseWithFactory | 36 | from lp.testing import TestCaseWithFactory |
953 | 37 | from lp.services.osutils import override_environ | ||
954 | 35 | 38 | ||
955 | 36 | 39 | ||
956 | 37 | # We say "RELEASE" often enough to not want to say "PackagePublishingPocket." | 40 | # We say "RELEASE" often enough to not want to say "PackagePublishingPocket." |
957 | @@ -66,7 +69,10 @@ | |||
958 | 66 | old_branch = FakeBranch(1) | 69 | old_branch = FakeBranch(1) |
959 | 67 | self.get_transport(old_branch.unique_name).create_prefix() | 70 | self.get_transport(old_branch.unique_name).create_prefix() |
960 | 68 | tree = self.make_branch_and_tree(old_branch.unique_name) | 71 | tree = self.make_branch_and_tree(old_branch.unique_name) |
962 | 69 | tree.commit(message='.') | 72 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
963 | 73 | # required to generate the revision-id. | ||
964 | 74 | with override_environ(BZR_EMAIL='me@example.com'): | ||
965 | 75 | tree.commit(message='.') | ||
966 | 70 | 76 | ||
967 | 71 | new_branch = FakeBranch(2) | 77 | new_branch = FakeBranch(2) |
968 | 72 | 78 | ||
969 | @@ -119,7 +125,10 @@ | |||
970 | 119 | 125 | ||
971 | 120 | _, tree = self.create_branch_and_tree( | 126 | _, tree = self.create_branch_and_tree( |
972 | 121 | tree_location=self.factory.getUniqueString(), db_branch=db_branch) | 127 | tree_location=self.factory.getUniqueString(), db_branch=db_branch) |
974 | 122 | tree.commit('') | 128 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
975 | 129 | # required to generate the revision-id. | ||
976 | 130 | with override_environ(BZR_EMAIL='me@example.com'): | ||
977 | 131 | tree.commit('') | ||
978 | 123 | 132 | ||
979 | 124 | return db_branch | 133 | return db_branch |
980 | 125 | 134 | ||
981 | @@ -484,8 +493,11 @@ | |||
982 | 484 | brancher.makeOneNewBranch(db_branch) | 493 | brancher.makeOneNewBranch(db_branch) |
983 | 485 | url = 'lp-internal:///' + db_branch.unique_name | 494 | url = 'lp-internal:///' + db_branch.unique_name |
984 | 486 | old_bzr_branch = Branch.open(url) | 495 | old_bzr_branch = Branch.open(url) |
987 | 487 | old_bzr_branch.create_checkout( | 496 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
988 | 488 | self.factory.getUniqueString()).commit('') | 497 | # required to generate the revision-id. |
989 | 498 | with override_environ(BZR_EMAIL='me@example.com'): | ||
990 | 499 | old_bzr_branch.create_checkout( | ||
991 | 500 | self.factory.getUniqueString()).commit('') | ||
992 | 489 | ok = brancher.checkOneBranch(db_branch) | 501 | ok = brancher.checkOneBranch(db_branch) |
993 | 490 | self.assertLogMessages([ | 502 | self.assertLogMessages([ |
994 | 491 | '^WARNING Repository at lp-internal:///.*/.*/.*/.* has 1 ' | 503 | '^WARNING Repository at lp-internal:///.*/.*/.*/.* has 1 ' |
995 | 492 | 504 | ||
996 | === modified file 'lib/lp/codehosting/tests/test_bzrutils.py' | |||
997 | --- lib/lp/codehosting/tests/test_bzrutils.py 2010-04-23 01:47:30 +0000 | |||
998 | +++ lib/lp/codehosting/tests/test_bzrutils.py 2010-08-17 04:46:45 +0000 | |||
999 | @@ -14,7 +14,7 @@ | |||
1000 | 14 | from bzrlib.branch import Branch, BranchReferenceFormat | 14 | from bzrlib.branch import Branch, BranchReferenceFormat |
1001 | 15 | from bzrlib.bzrdir import BzrDir, format_registry | 15 | from bzrlib.bzrdir import BzrDir, format_registry |
1002 | 16 | from bzrlib.remote import RemoteBranch | 16 | from bzrlib.remote import RemoteBranch |
1004 | 17 | from bzrlib.smart import server | 17 | from bzrlib.tests import test_server |
1005 | 18 | from bzrlib.tests import ( | 18 | from bzrlib.tests import ( |
1006 | 19 | multiply_tests, TestCase, TestCaseWithTransport, TestLoader, | 19 | multiply_tests, TestCase, TestCaseWithTransport, TestLoader, |
1007 | 20 | TestNotApplicable) | 20 | TestNotApplicable) |
1008 | @@ -191,7 +191,7 @@ | |||
1009 | 191 | # of the branch, repo and bzrdir, even if the branch is a | 191 | # of the branch, repo and bzrdir, even if the branch is a |
1010 | 192 | # RemoteBranch. | 192 | # RemoteBranch. |
1011 | 193 | vfs_branch = self.make_branch('.') | 193 | vfs_branch = self.make_branch('.') |
1013 | 194 | smart_server = server.SmartTCPServer_for_testing() | 194 | smart_server = test_server.SmartTCPServer_for_testing() |
1014 | 195 | smart_server.start_server(self.get_vfs_only_server()) | 195 | smart_server.start_server(self.get_vfs_only_server()) |
1015 | 196 | self.addCleanup(smart_server.stop_server) | 196 | self.addCleanup(smart_server.stop_server) |
1016 | 197 | remote_branch = Branch.open(smart_server.get_url()) | 197 | remote_branch = Branch.open(smart_server.get_url()) |
1017 | 198 | 198 | ||
1018 | === modified file 'lib/lp/codehosting/tests/test_jobs.py' | |||
1019 | --- lib/lp/codehosting/tests/test_jobs.py 2010-05-27 02:04:21 +0000 | |||
1020 | +++ lib/lp/codehosting/tests/test_jobs.py 2010-08-17 04:46:45 +0000 | |||
1021 | @@ -3,6 +3,7 @@ | |||
1022 | 3 | 3 | ||
1023 | 4 | """Tests for Job-running facilities.""" | 4 | """Tests for Job-running facilities.""" |
1024 | 5 | 5 | ||
1025 | 6 | from __future__ import with_statement | ||
1026 | 6 | 7 | ||
1027 | 7 | from unittest import TestLoader | 8 | from unittest import TestLoader |
1028 | 8 | 9 | ||
1029 | @@ -15,6 +16,7 @@ | |||
1030 | 15 | from lp.code.model.branchjob import RevisionMailJob | 16 | from lp.code.model.branchjob import RevisionMailJob |
1031 | 16 | from lp.code.model.diff import StaticDiff | 17 | from lp.code.model.diff import StaticDiff |
1032 | 17 | from lp.services.job.runner import JobRunner | 18 | from lp.services.job.runner import JobRunner |
1033 | 19 | from lp.services.osutils import override_environ | ||
1034 | 18 | from lp.testing import TestCaseWithFactory | 20 | from lp.testing import TestCaseWithFactory |
1035 | 19 | 21 | ||
1036 | 20 | 22 | ||
1037 | @@ -34,7 +36,10 @@ | |||
1038 | 34 | tree_transport = tree.bzrdir.root_transport | 36 | tree_transport = tree.bzrdir.root_transport |
1039 | 35 | tree_transport.put_bytes("hello.txt", "Hello World\n") | 37 | tree_transport.put_bytes("hello.txt", "Hello World\n") |
1040 | 36 | tree.add('hello.txt') | 38 | tree.add('hello.txt') |
1042 | 37 | to_revision_id = tree.commit('rev1', timestamp=1e9, timezone=0) | 39 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
1043 | 40 | # required to generate the revision-id. | ||
1044 | 41 | with override_environ(BZR_EMAIL='me@example.com'): | ||
1045 | 42 | to_revision_id = tree.commit('rev1', timestamp=1e9, timezone=0) | ||
1046 | 38 | job = RevisionMailJob.create( | 43 | job = RevisionMailJob.create( |
1047 | 39 | branch, 1, 'from@example.org', 'body', True, 'subject') | 44 | branch, 1, 'from@example.org', 'body', True, 'subject') |
1048 | 40 | LaunchpadZopelessLayer.txn.commit() | 45 | LaunchpadZopelessLayer.txn.commit() |
1049 | 41 | 46 | ||
1050 | === modified file 'lib/lp/codehosting/vfs/tests/test_transport.py' | |||
1051 | --- lib/lp/codehosting/vfs/tests/test_transport.py 2010-04-19 07:05:57 +0000 | |||
1052 | +++ lib/lp/codehosting/vfs/tests/test_transport.py 2010-08-17 04:46:45 +0000 | |||
1053 | @@ -43,6 +43,9 @@ | |||
1054 | 43 | BlockingProxy(branchfs), LocalTransport(local_path_to_url('.'))) | 43 | BlockingProxy(branchfs), LocalTransport(local_path_to_url('.'))) |
1055 | 44 | self._chroot_servers = [] | 44 | self._chroot_servers = [] |
1056 | 45 | 45 | ||
1057 | 46 | def get_bogus_url(self): | ||
1058 | 47 | return self._scheme + 'bogus' | ||
1059 | 48 | |||
1060 | 46 | def _transportFactory(self, url): | 49 | def _transportFactory(self, url): |
1061 | 47 | """See `LaunchpadInternalServer._transportFactory`. | 50 | """See `LaunchpadInternalServer._transportFactory`. |
1062 | 48 | 51 | ||
1063 | 49 | 52 | ||
1064 | === modified file 'lib/lp/services/osutils.py' | |||
1065 | --- lib/lp/services/osutils.py 2010-03-18 19:18:34 +0000 | |||
1066 | +++ lib/lp/services/osutils.py 2010-08-17 04:46:45 +0000 | |||
1067 | @@ -5,12 +5,14 @@ | |||
1068 | 5 | 5 | ||
1069 | 6 | __metaclass__ = type | 6 | __metaclass__ = type |
1070 | 7 | __all__ = [ | 7 | __all__ = [ |
1071 | 8 | 'override_environ', | ||
1072 | 8 | 'remove_tree', | 9 | 'remove_tree', |
1073 | 9 | 'kill_by_pidfile', | 10 | 'kill_by_pidfile', |
1074 | 10 | 'remove_if_exists', | 11 | 'remove_if_exists', |
1075 | 11 | 'two_stage_kill', | 12 | 'two_stage_kill', |
1076 | 12 | ] | 13 | ] |
1077 | 13 | 14 | ||
1078 | 15 | from contextlib import contextmanager | ||
1079 | 14 | import os.path | 16 | import os.path |
1080 | 15 | import shutil | 17 | import shutil |
1081 | 16 | 18 | ||
1082 | @@ -26,3 +28,33 @@ | |||
1083 | 26 | """Remove the tree at 'path' from disk.""" | 28 | """Remove the tree at 'path' from disk.""" |
1084 | 27 | if os.path.exists(path): | 29 | if os.path.exists(path): |
1085 | 28 | shutil.rmtree(path) | 30 | shutil.rmtree(path) |
1086 | 31 | |||
1087 | 32 | |||
1088 | 33 | def set_environ(new_values): | ||
1089 | 34 | """Set the environment variables as specified by new_values. | ||
1090 | 35 | |||
1091 | 36 | :return: a dict of the old values | ||
1092 | 37 | """ | ||
1093 | 38 | old_values = {} | ||
1094 | 39 | for name, value in new_values.iteritems(): | ||
1095 | 40 | old_values[name] = os.environ.get(name) | ||
1096 | 41 | if value is None: | ||
1097 | 42 | if old_values[name] is not None: | ||
1098 | 43 | del os.environ[name] | ||
1099 | 44 | else: | ||
1100 | 45 | os.environ[name] = value | ||
1101 | 46 | return old_values | ||
1102 | 47 | |||
1103 | 48 | |||
1104 | 49 | @contextmanager | ||
1105 | 50 | def override_environ(**kwargs): | ||
1106 | 51 | """Override environment variables with the kwarg values. | ||
1107 | 52 | |||
1108 | 53 | If a value is None, the environment variable is deleted. Variables are | ||
1109 | 54 | restored to their previous state when exiting the context. | ||
1110 | 55 | """ | ||
1111 | 56 | old_values = set_environ(kwargs) | ||
1112 | 57 | try: | ||
1113 | 58 | yield | ||
1114 | 59 | finally: | ||
1115 | 60 | set_environ(old_values) | ||
1116 | 29 | 61 | ||
1117 | === modified file 'lib/lp/testing/__init__.py' | |||
1118 | --- lib/lp/testing/__init__.py 2010-08-02 19:52:59 +0000 | |||
1119 | +++ lib/lp/testing/__init__.py 2010-08-17 04:46:45 +0000 | |||
1120 | @@ -117,6 +117,7 @@ | |||
1121 | 117 | launchpadlib_credentials_for, launchpadlib_for, oauth_access_token_for) | 117 | launchpadlib_credentials_for, launchpadlib_for, oauth_access_token_for) |
1122 | 118 | from lp.testing.matchers import Provides | 118 | from lp.testing.matchers import Provides |
1123 | 119 | from lp.testing.fixture import ZopeEventHandlerFixture | 119 | from lp.testing.fixture import ZopeEventHandlerFixture |
1124 | 120 | from lp.services.osutils import override_environ | ||
1125 | 120 | 121 | ||
1126 | 121 | # zope.exception demands more of frame objects than twisted.python.failure | 122 | # zope.exception demands more of frame objects than twisted.python.failure |
1127 | 122 | # provides in its fake frames. This is enough to make it work with them | 123 | # provides in its fake frames. This is enough to make it work with them |
1128 | @@ -577,18 +578,11 @@ | |||
1129 | 577 | return os.path.join(base, branch_id_to_path(branch.id)) | 578 | return os.path.join(base, branch_id_to_path(branch.id)) |
1130 | 578 | 579 | ||
1131 | 579 | def useTempBzrHome(self): | 580 | def useTempBzrHome(self): |
1132 | 580 | # XXX: Extract the temporary environment blatting into a generic | ||
1133 | 581 | # helper function. | ||
1134 | 582 | self.useTempDir() | 581 | self.useTempDir() |
1135 | 583 | # Avoid leaking local user configuration into tests. | 582 | # Avoid leaking local user configuration into tests. |
1144 | 584 | old_bzr_home = os.environ.get('BZR_HOME') | 583 | self.useContext(override_environ( |
1145 | 585 | def restore_bzr_home(): | 584 | BZR_HOME=os.getcwd(), BZR_EMAIL=None, EMAIL=None, |
1146 | 586 | if old_bzr_home is None: | 585 | )) |
1139 | 587 | del os.environ['BZR_HOME'] | ||
1140 | 588 | else: | ||
1141 | 589 | os.environ['BZR_HOME'] = old_bzr_home | ||
1142 | 590 | os.environ['BZR_HOME'] = os.getcwd() | ||
1143 | 591 | self.addCleanup(restore_bzr_home) | ||
1147 | 592 | 586 | ||
1148 | 593 | def useBzrBranches(self, direct_database=False): | 587 | def useBzrBranches(self, direct_database=False): |
1149 | 594 | """Prepare for using bzr branches. | 588 | """Prepare for using bzr branches. |
1150 | 595 | 589 | ||
1151 | === modified file 'lib/lp/translations/scripts/translations_to_branch.py' | |||
1152 | --- lib/lp/translations/scripts/translations_to_branch.py 2010-06-16 07:22:57 +0000 | |||
1153 | +++ lib/lp/translations/scripts/translations_to_branch.py 2010-08-17 04:46:45 +0000 | |||
1154 | @@ -103,22 +103,16 @@ | |||
1155 | 103 | # possible again to commit to these branches at some point. | 103 | # possible again to commit to these branches at some point. |
1156 | 104 | # When that happens, remove this workaround and just call | 104 | # When that happens, remove this workaround and just call |
1157 | 105 | # _makeDirectBranchCommit directly. | 105 | # _makeDirectBranchCommit directly. |
1174 | 106 | committer = self._makeDirectBranchCommit(db_branch) | 106 | if db_branch.stacked_on: |
1175 | 107 | if not db_branch.stacked_on: | 107 | bzrbranch = db_branch.getBzrBranch() |
1176 | 108 | # The normal case. | 108 | self.logger.info("Unstacking branch to work around bug 375013.") |
1177 | 109 | return committer | 109 | bzrbranch.set_stacked_on_url(None) |
1178 | 110 | 110 | self.logger.info("Done unstacking branch.") | |
1179 | 111 | self.logger.info("Unstacking branch to work around bug 375013.") | 111 | |
1180 | 112 | try: | 112 | # This may have taken a while, so commit for good |
1181 | 113 | committer.bzrbranch.set_stacked_on_url(None) | 113 | # manners. |
1182 | 114 | finally: | 114 | if self.txn: |
1183 | 115 | committer.unlock() | 115 | self.txn.commit() |
1168 | 116 | self.logger.info("Done unstacking branch.") | ||
1169 | 117 | |||
1170 | 118 | # This may have taken a while, so commit for good | ||
1171 | 119 | # manners. | ||
1172 | 120 | if self.txn: | ||
1173 | 121 | self.txn.commit() | ||
1184 | 122 | 116 | ||
1185 | 123 | return self._makeDirectBranchCommit(db_branch) | 117 | return self._makeDirectBranchCommit(db_branch) |
1186 | 124 | 118 | ||
1187 | 125 | 119 | ||
1188 | === modified file 'lib/lp/translations/tests/test_rosetta_branches_script.py' | |||
1189 | --- lib/lp/translations/tests/test_rosetta_branches_script.py 2010-04-23 09:36:47 +0000 | |||
1190 | +++ lib/lp/translations/tests/test_rosetta_branches_script.py 2010-08-17 04:46:45 +0000 | |||
1191 | @@ -7,6 +7,8 @@ | |||
1192 | 7 | provisions to handle Bazaar branches. | 7 | provisions to handle Bazaar branches. |
1193 | 8 | """ | 8 | """ |
1194 | 9 | 9 | ||
1195 | 10 | from __future__ import with_statement | ||
1196 | 11 | |||
1197 | 10 | __metaclass__ = type | 12 | __metaclass__ = type |
1198 | 11 | 13 | ||
1199 | 12 | from unittest import TestLoader | 14 | from unittest import TestLoader |
1200 | @@ -23,6 +25,7 @@ | |||
1201 | 23 | ITranslationImportQueue, RosettaImportStatus) | 25 | ITranslationImportQueue, RosettaImportStatus) |
1202 | 24 | from canonical.launchpad.scripts.tests import run_script | 26 | from canonical.launchpad.scripts.tests import run_script |
1203 | 25 | from lp.testing import TestCaseWithFactory | 27 | from lp.testing import TestCaseWithFactory |
1204 | 28 | from lp.services.osutils import override_environ | ||
1205 | 26 | from canonical.launchpad.webapp.errorlog import globalErrorUtility | 29 | from canonical.launchpad.webapp.errorlog import globalErrorUtility |
1206 | 27 | 30 | ||
1207 | 28 | class TestRosettaBranchesScript(TestCaseWithFactory): | 31 | class TestRosettaBranchesScript(TestCaseWithFactory): |
1208 | @@ -43,7 +46,10 @@ | |||
1209 | 43 | branch, tree = self.create_branch_and_tree() | 46 | branch, tree = self.create_branch_and_tree() |
1210 | 44 | tree.bzrdir.root_transport.put_bytes(pot_path, pot_content) | 47 | tree.bzrdir.root_transport.put_bytes(pot_path, pot_content) |
1211 | 45 | tree.add(pot_path) | 48 | tree.add(pot_path) |
1213 | 46 | revision_id = tree.commit("first commit") | 49 | # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is |
1214 | 50 | # required to generate the revision-id. | ||
1215 | 51 | with override_environ(BZR_EMAIL='me@example.com'): | ||
1216 | 52 | revision_id = tree.commit("first commit") | ||
1217 | 47 | branch.last_scanned_id = revision_id | 53 | branch.last_scanned_id = revision_id |
1218 | 48 | branch.last_mirrored_id = revision_id | 54 | branch.last_mirrored_id = revision_id |
1219 | 49 | series = self.factory.makeProductSeries() | 55 | series = self.factory.makeProductSeries() |
1220 | 50 | 56 | ||
1221 | === modified file 'utilities/sourcedeps.conf' | |||
1222 | --- utilities/sourcedeps.conf 2010-08-16 15:00:28 +0000 | |||
1223 | +++ utilities/sourcedeps.conf 2010-08-17 04:46:45 +0000 | |||
1224 | @@ -1,7 +1,7 @@ | |||
1225 | 1 | bzr-builder lp:~launchpad-pqm/bzr-builder/trunk;revno=65 | 1 | bzr-builder lp:~launchpad-pqm/bzr-builder/trunk;revno=65 |
1226 | 2 | bzr-git lp:~launchpad-pqm/bzr-git/devel;revno=257 | 2 | bzr-git lp:~launchpad-pqm/bzr-git/devel;revno=257 |
1229 | 3 | bzr-hg lp:~launchpad-pqm/bzr-hg/devel;revno=281 | 3 | bzr-hg lp:~launchpad-pqm/bzr-hg/devel;revno=282 |
1230 | 4 | bzr-loom lp:~launchpad-pqm/bzr-loom/trunk;revno=47 | 4 | bzr-loom lp:~launchpad-pqm/bzr-loom/trunk;revno=48 |
1231 | 5 | bzr-svn lp:~launchpad-pqm/bzr-svn/devel;revno=2709 | 5 | bzr-svn lp:~launchpad-pqm/bzr-svn/devel;revno=2709 |
1232 | 6 | cscvs lp:~launchpad-pqm/launchpad-cscvs/devel;revno=432 | 6 | cscvs lp:~launchpad-pqm/launchpad-cscvs/devel;revno=432 |
1233 | 7 | dulwich lp:~launchpad-pqm/dulwich/devel;revno=423 | 7 | dulwich lp:~launchpad-pqm/dulwich/devel;revno=423 |
1234 | 8 | 8 | ||
1235 | === modified file 'versions.cfg' | |||
1236 | --- versions.cfg 2010-08-06 16:52:08 +0000 | |||
1237 | +++ versions.cfg 2010-08-17 04:46:45 +0000 | |||
1238 | @@ -5,7 +5,7 @@ | |||
1239 | 5 | # Alphabetical, case-insensitive, please! :-) | 5 | # Alphabetical, case-insensitive, please! :-) |
1240 | 6 | 6 | ||
1241 | 7 | ampoule = 0.2.0 | 7 | ampoule = 0.2.0 |
1243 | 8 | bzr = 2.1.0 | 8 | bzr = 2.2.0 |
1244 | 9 | chameleon.core = 1.0b35 | 9 | chameleon.core = 1.0b35 |
1245 | 10 | chameleon.zpt = 1.0b17 | 10 | chameleon.zpt = 1.0b17 |
1246 | 11 | ClientForm = 0.2.10 | 11 | ClientForm = 0.2.10 |
I've reviewed the bits by abentley already.