Merge lp:~thumper/launchpad/new-bzr into lp:launchpad

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
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
Tim Penhey (thumper) wrote :

I've reviewed the bits by abentley already.

review: Approve
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
=== modified file 'configs/development/apidoc-configure-normal.zcml'
--- configs/development/apidoc-configure-normal.zcml 2010-07-24 02:27:19 +0000
+++ configs/development/apidoc-configure-normal.zcml 2010-08-17 04:46:45 +0000
@@ -90,7 +90,6 @@
90 <apidoc:rootModule module="martian" />90 <apidoc:rootModule module="martian" />
91 <apidoc:rootModule module="manuel" />91 <apidoc:rootModule module="manuel" />
92 <apidoc:rootModule module="chameleon" />92 <apidoc:rootModule module="chameleon" />
93 <apidoc:rootModule module="bzrlib" />
94 <apidoc:rootModule module="storm" />93 <apidoc:rootModule module="storm" />
9594
96 <apidoc:bookchapter95 <apidoc:bookchapter
9796
=== modified file 'lib/lp/code/mail/codehandler.py'
--- lib/lp/code/mail/codehandler.py 2010-08-02 02:51:42 +0000
+++ lib/lp/code/mail/codehandler.py 2010-08-17 04:46:45 +0000
@@ -545,8 +545,12 @@
545 # access to any needed but not supplied revisions.545 # access to any needed but not supplied revisions.
546 md.target_branch = target_url546 md.target_branch = target_url
547 md.install_revisions(bzr_branch.repository)547 md.install_revisions(bzr_branch.repository)
548 bzr_branch.pull(bzr_branch, stop_revision=md.revision_id,548 bzr_branch.lock_write()
549 overwrite=True)549 try:
550 bzr_branch.pull(bzr_branch, stop_revision=md.revision_id,
551 overwrite=True)
552 finally:
553 bzr_branch.unlock()
550554
551 def findMergeDirectiveAndComment(self, message):555 def findMergeDirectiveAndComment(self, message):
552 """Extract the comment and Merge Directive from a SignedMessage."""556 """Extract the comment and Merge Directive from a SignedMessage."""
553557
=== modified file 'lib/lp/code/mail/tests/test_codehandler.py'
--- lib/lp/code/mail/tests/test_codehandler.py 2010-07-27 05:30:04 +0000
+++ lib/lp/code/mail/tests/test_codehandler.py 2010-08-17 04:46:45 +0000
@@ -3,6 +3,8 @@
33
4"""Testing the CodeHandler."""4"""Testing the CodeHandler."""
55
6from __future__ import with_statement
7
6__metaclass__ = type8__metaclass__ = type
79
8from difflib import unified_diff10from difflib import unified_diff
@@ -48,6 +50,7 @@
48from lp.codehosting.vfs import get_lp_server50from lp.codehosting.vfs import get_lp_server
49from lp.registry.interfaces.person import IPersonSet51from lp.registry.interfaces.person import IPersonSet
50from lp.services.job.runner import JobRunner52from lp.services.job.runner import JobRunner
53from lp.services.osutils import override_environ
51from lp.testing import login, login_person, TestCase, TestCaseWithFactory54from lp.testing import login, login_person, TestCase, TestCaseWithFactory
52from lp.testing.mail_helpers import pop_notifications55from lp.testing.mail_helpers import pop_notifications
5356
@@ -888,12 +891,16 @@
888 db_target_branch, target_tree = self.create_branch_and_tree(891 db_target_branch, target_tree = self.create_branch_and_tree(
889 tree_location='.', format=format)892 tree_location='.', format=format)
890 target_tree.branch.set_public_branch(db_target_branch.bzr_identity)893 target_tree.branch.set_public_branch(db_target_branch.bzr_identity)
891 target_tree.commit('rev1')894 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
892 # Make sure that the created branch has been mirrored.895 # required to generate the revision-id.
893 removeSecurityProxy(db_target_branch).branchChanged(896 with override_environ(BZR_EMAIL='me@example.com'):
894 '', 'rev1', None, None, None)897 target_tree.commit('rev1')
895 source_tree = target_tree.bzrdir.sprout('source').open_workingtree()898 # Make sure that the created branch has been mirrored.
896 source_tree.commit('rev2')899 removeSecurityProxy(db_target_branch).branchChanged(
900 '', 'rev1', None, None, None)
901 sprout_bzrdir = target_tree.bzrdir.sprout('source')
902 source_tree = sprout_bzrdir.open_workingtree()
903 source_tree.commit('rev2')
897 message = self.factory.makeBundleMergeDirectiveEmail(904 message = self.factory.makeBundleMergeDirectiveEmail(
898 source_tree.branch, db_target_branch)905 source_tree.branch, db_target_branch)
899 return db_target_branch, source_tree.branch, message906 return db_target_branch, source_tree.branch, message
@@ -994,7 +1001,10 @@
994 branch, source, message = self._createTargetSourceAndBundle(1001 branch, source, message = self._createTargetSourceAndBundle(
995 format="1.9")1002 format="1.9")
996 target_tree = WorkingTree.open('.')1003 target_tree = WorkingTree.open('.')
997 target_tree.commit('rev2b')1004 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1005 # required to generate the revision-id.
1006 with override_environ(BZR_EMAIL='me@example.com'):
1007 target_tree.commit('rev2b')
998 bmp = self._processMergeDirective(message)1008 bmp = self._processMergeDirective(message)
999 lp_branch = self._openBazaarBranchAsClient(bmp.source_branch)1009 lp_branch = self._openBazaarBranchAsClient(bmp.source_branch)
1000 self.assertEqual(source.last_revision(), lp_branch.last_revision())1010 self.assertEqual(source.last_revision(), lp_branch.last_revision())
@@ -1005,20 +1015,24 @@
1005 db_target_branch, target_tree = self.create_branch_and_tree(1015 db_target_branch, target_tree = self.create_branch_and_tree(
1006 'target', format=target_format)1016 'target', format=target_format)
1007 target_tree.branch.set_public_branch(db_target_branch.bzr_identity)1017 target_tree.branch.set_public_branch(db_target_branch.bzr_identity)
1008 revid = target_tree.commit('rev1')1018 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1009 removeSecurityProxy(db_target_branch).branchChanged(1019 # required to generate the revision-id.
1010 '', revid, None, None, None)1020 with override_environ(BZR_EMAIL='me@example.com'):
1021 revid = target_tree.commit('rev1')
1022 removeSecurityProxy(db_target_branch).branchChanged(
1023 '', revid, None, None, None)
10111024
1012 db_source_branch, source_tree = self.create_branch_and_tree(1025 db_source_branch, source_tree = self.create_branch_and_tree(
1013 'lpsource', db_target_branch.product, format=source_format)1026 'lpsource', db_target_branch.product, format=source_format)
1014 # The branch is not scheduled to be mirrorred.1027 # The branch is not scheduled to be mirrorred.
1015 self.assertIs(db_source_branch.next_mirror_time, None)1028 self.assertIs(db_source_branch.next_mirror_time, None)
1016 source_tree.pull(target_tree.branch)1029 source_tree.pull(target_tree.branch)
1017 source_tree.commit('rev2', rev_id='rev2')1030 source_tree.commit('rev2', rev_id='rev2')
1018 # bundle_tree is effectively behaving like a local copy of1031 # bundle_tree is effectively behaving like a local copy of
1019 # db_source_branch, and is used to create the merge directive.1032 # db_source_branch, and is used to create the merge directive.
1020 bundle_tree = source_tree.bzrdir.sprout('source').open_workingtree()1033 sprout_bzrdir = source_tree.bzrdir.sprout('source')
1021 bundle_tree.commit('rev3', rev_id='rev3')1034 bundle_tree = sprout_bzrdir.open_workingtree()
1035 bundle_tree.commit('rev3', rev_id='rev3')
1022 bundle_tree.branch.set_public_branch(db_source_branch.bzr_identity)1036 bundle_tree.branch.set_public_branch(db_source_branch.bzr_identity)
1023 message = self.factory.makeBundleMergeDirectiveEmail(1037 message = self.factory.makeBundleMergeDirectiveEmail(
1024 bundle_tree.branch, db_target_branch,1038 bundle_tree.branch, db_target_branch,
10251039
=== modified file 'lib/lp/code/model/diff.py'
--- lib/lp/code/model/diff.py 2010-08-02 02:13:52 +0000
+++ lib/lp/code/model/diff.py 2010-08-17 04:46:45 +0000
@@ -140,7 +140,7 @@
140 source_revision)140 source_revision)
141 merger = Merge3Merger(141 merger = Merge3Merger(
142 merge_target, merge_target, merge_base, merge_source,142 merge_target, merge_target, merge_base, merge_source,
143 do_merge=False)143 this_branch=target_branch, do_merge=False)
144 def dummy_warning(self, *args, **kwargs):144 def dummy_warning(self, *args, **kwargs):
145 pass145 pass
146 real_warning = trace.warning146 real_warning = trace.warning
147147
=== modified file 'lib/lp/code/model/directbranchcommit.py'
--- lib/lp/code/model/directbranchcommit.py 2010-05-15 17:43:59 +0000
+++ lib/lp/code/model/directbranchcommit.py 2010-08-17 04:46:45 +0000
@@ -3,6 +3,8 @@
33
4"""Commit files straight to bzr branch."""4"""Commit files straight to bzr branch."""
55
6from __future__ import with_statement
7
6__metaclass__ = type8__metaclass__ = type
7__all__ = [9__all__ = [
8 'ConcurrentUpdateError',10 'ConcurrentUpdateError',
@@ -19,6 +21,8 @@
19from canonical.launchpad.interfaces import IMasterObject21from canonical.launchpad.interfaces import IMasterObject
2022
21from lp.codehosting.bzrutils import get_stacked_on_url23from lp.codehosting.bzrutils import get_stacked_on_url
24from lp.services.osutils import override_environ
25from lp.services.mail.sendmail import format_address_for_person
2226
23class ConcurrentUpdateError(Exception):27class ConcurrentUpdateError(Exception):
24 """Bailout exception for concurrent updates.28 """Bailout exception for concurrent updates.
@@ -188,8 +192,12 @@
188 if rev_id == NULL_REVISION:192 if rev_id == NULL_REVISION:
189 if list(self.transform_preview.iter_changes()) == []:193 if list(self.transform_preview.iter_changes()) == []:
190 return194 return
191 new_rev_id = self.transform_preview.commit(195 committer_id = format_address_for_person(self.committer)
192 self.bzrbranch, commit_message)196 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
197 # required to generate the revision-id.
198 with override_environ(BZR_EMAIL=committer_id):
199 new_rev_id = self.transform_preview.commit(
200 self.bzrbranch, commit_message, committer=committer_id)
193 IMasterObject(self.db_branch).branchChanged(201 IMasterObject(self.db_branch).branchChanged(
194 get_stacked_on_url(self.bzrbranch), new_rev_id,202 get_stacked_on_url(self.bzrbranch), new_rev_id,
195 self.db_branch.control_format, self.db_branch.branch_format,203 self.db_branch.control_format, self.db_branch.branch_format,
196204
=== modified file 'lib/lp/code/model/tests/test_branch.py'
--- lib/lp/code/model/tests/test_branch.py 2010-08-12 01:53:07 +0000
+++ lib/lp/code/model/tests/test_branch.py 2010-08-17 04:46:45 +0000
@@ -84,6 +84,7 @@
84from lp.testing.factory import LaunchpadObjectFactory84from lp.testing.factory import LaunchpadObjectFactory
85from lp.translations.model.translationtemplatesbuildjob import (85from lp.translations.model.translationtemplatesbuildjob import (
86 ITranslationTemplatesBuildJobSource)86 ITranslationTemplatesBuildJobSource)
87from lp.services.osutils import override_environ
8788
8889
89class TestCodeImport(TestCase):90class TestCodeImport(TestCase):
@@ -2573,7 +2574,10 @@
2573 # safe_open returns the underlying bzr branch of a database branch in2574 # safe_open returns the underlying bzr branch of a database branch in
2574 # the simple, unstacked, case.2575 # the simple, unstacked, case.
2575 db_branch, tree = self.create_branch_and_tree()2576 db_branch, tree = self.create_branch_and_tree()
2576 revid = tree.commit('')2577 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
2578 # required to generate the revision-id.
2579 with override_environ(BZR_EMAIL='me@example.com'):
2580 revid = tree.commit('')
2577 bzr_branch = db_branch.getBzrBranch()2581 bzr_branch = db_branch.getBzrBranch()
2578 self.assertEqual(revid, bzr_branch.last_revision())2582 self.assertEqual(revid, bzr_branch.last_revision())
25792583
25802584
=== modified file 'lib/lp/code/model/tests/test_branchjob.py'
--- lib/lp/code/model/tests/test_branchjob.py 2010-07-29 08:06:07 +0000
+++ lib/lp/code/model/tests/test_branchjob.py 2010-08-17 04:46:45 +0000
@@ -3,6 +3,8 @@
33
4"""Tests for BranchJobs."""4"""Tests for BranchJobs."""
55
6from __future__ import with_statement
7
6__metaclass__ = type8__metaclass__ = type
79
8import datetime10import datetime
@@ -41,6 +43,7 @@
41from lp.testing.mail_helpers import pop_notifications43from lp.testing.mail_helpers import pop_notifications
42from lp.services.job.interfaces.job import JobStatus44from lp.services.job.interfaces.job import JobStatus
43from lp.services.job.model.job import Job45from lp.services.job.model.job import Job
46from lp.services.osutils import override_environ
44from lp.code.bzr import BranchFormat, RepositoryFormat47from lp.code.bzr import BranchFormat, RepositoryFormat
45from lp.code.enums import (48from lp.code.enums import (
46 BranchMergeProposalStatus, BranchSubscriptionDiffSize,49 BranchMergeProposalStatus, BranchSubscriptionDiffSize,
@@ -104,7 +107,10 @@
104 """Ensure that run calculates revision ids."""107 """Ensure that run calculates revision ids."""
105 self.useBzrBranches(direct_database=True)108 self.useBzrBranches(direct_database=True)
106 branch, tree = self.create_branch_and_tree()109 branch, tree = self.create_branch_and_tree()
107 tree.commit('First commit', rev_id='rev1')110 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
111 # required to generate the revision-id.
112 with override_environ(BZR_EMAIL='me@example.com'):
113 tree.commit('First commit', rev_id='rev1')
108 job = BranchDiffJob.create(branch, '0', '1')114 job = BranchDiffJob.create(branch, '0', '1')
109 static_diff = job.run()115 static_diff = job.run()
110 self.assertEqual('null:', static_diff.from_revision_id)116 self.assertEqual('null:', static_diff.from_revision_id)
@@ -122,9 +128,12 @@
122 tree_file = os.path.join(tree_location, 'file')128 tree_file = os.path.join(tree_location, 'file')
123 open(tree_file, 'wb').write('foo\n')129 open(tree_file, 'wb').write('foo\n')
124 tree.add('file')130 tree.add('file')
125 tree.commit('First commit')131 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
126 open(tree_file, 'wb').write('bar\n')132 # required to generate the revision-id.
127 tree.commit('Next commit')133 with override_environ(BZR_EMAIL='me@example.com'):
134 tree.commit('First commit')
135 open(tree_file, 'wb').write('bar\n')
136 tree.commit('Next commit')
128 job = BranchDiffJob.create(branch, '1', '2')137 job = BranchDiffJob.create(branch, '1', '2')
129 static_diff = job.run()138 static_diff = job.run()
130 transaction.commit()139 transaction.commit()
@@ -138,7 +147,10 @@
138 """Ensure running an equivalent job emits the same diff."""147 """Ensure running an equivalent job emits the same diff."""
139 self.useBzrBranches(direct_database=True)148 self.useBzrBranches(direct_database=True)
140 branch, tree = self.create_branch_and_tree()149 branch, tree = self.create_branch_and_tree()
141 tree.commit('First commit')150 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
151 # required to generate the revision-id.
152 with override_environ(BZR_EMAIL='me@example.com'):
153 tree.commit('First commit')
142 job1 = BranchDiffJob.create(branch, '0', '1')154 job1 = BranchDiffJob.create(branch, '0', '1')
143 static_diff1 = job1.run()155 static_diff1 = job1.run()
144 job2 = BranchDiffJob.create(branch, '0', '1')156 job2 = BranchDiffJob.create(branch, '0', '1')
@@ -157,7 +169,10 @@
157 tree_transport = tree.bzrdir.root_transport169 tree_transport = tree.bzrdir.root_transport
158 tree_transport.put_bytes("hello.txt", "Hello World\n")170 tree_transport.put_bytes("hello.txt", "Hello World\n")
159 tree.add('hello.txt')171 tree.add('hello.txt')
160 tree.commit('rev1', timestamp=1e9, timezone=0)172 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
173 # required to generate the revision-id.
174 with override_environ(BZR_EMAIL='me@example.com'):
175 tree.commit('rev1', timestamp=1e9, timezone=0)
161 job = BranchDiffJob.create(branch, '0', '1')176 job = BranchDiffJob.create(branch, '0', '1')
162 diff = job.run()177 diff = job.run()
163 transaction.commit()178 transaction.commit()
@@ -202,20 +217,23 @@
202 self.useBzrBranches(direct_database=True)217 self.useBzrBranches(direct_database=True)
203218
204 db_branch, bzr_tree = self.create_branch_and_tree()219 db_branch, bzr_tree = self.create_branch_and_tree()
205 bzr_tree.commit('First commit', rev_id='rev1')220 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
206 bzr_tree.commit('Second commit', rev_id='rev2')221 # required to generate the revision-id.
207 bzr_tree.commit('Third commit', rev_id='rev3')222 with override_environ(BZR_EMAIL='me@example.com'):
208 LaunchpadZopelessLayer.commit()223 bzr_tree.commit('First commit', rev_id='rev1')
209224 bzr_tree.commit('Second commit', rev_id='rev2')
210 job = BranchScanJob.create(db_branch)225 bzr_tree.commit('Third commit', rev_id='rev3')
211 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)226 LaunchpadZopelessLayer.commit()
212 job.run()227
213 LaunchpadZopelessLayer.switchDbUser(config.launchpad.dbuser)228 job = BranchScanJob.create(db_branch)
214229 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)
215 self.assertEqual(db_branch.revision_count, 3)230 job.run()
216231 LaunchpadZopelessLayer.switchDbUser(config.launchpad.dbuser)
217 bzr_tree.commit('Fourth commit', rev_id='rev4')232
218 bzr_tree.commit('Fifth commit', rev_id='rev5')233 self.assertEqual(db_branch.revision_count, 3)
234
235 bzr_tree.commit('Fourth commit', rev_id='rev4')
236 bzr_tree.commit('Fifth commit', rev_id='rev5')
219237
220 job = BranchScanJob.create(db_branch)238 job = BranchScanJob.create(db_branch)
221 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)239 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)
@@ -381,7 +399,10 @@
381 branch, tree = self.create_branch_and_tree()399 branch, tree = self.create_branch_and_tree()
382 tree.bzrdir.root_transport.put_bytes('foo', 'bar\n')400 tree.bzrdir.root_transport.put_bytes('foo', 'bar\n')
383 tree.add('foo')401 tree.add('foo')
384 tree.commit('First commit')402 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
403 # required to generate the revision-id.
404 with override_environ(BZR_EMAIL='me@example.com'):
405 tree.commit('First commit')
385 job = RevisionMailJob.create(406 job = RevisionMailJob.create(
386 branch, 1, 'from@example.com', 'hello', True, 'subject')407 branch, 1, 'from@example.com', 'hello', True, 'subject')
387 mailer = job.getMailer()408 mailer = job.getMailer()
@@ -477,9 +498,12 @@
477 branch, tree = self.create_branch_and_tree()498 branch, tree = self.create_branch_and_tree()
478 tree.lock_write()499 tree.lock_write()
479 try:500 try:
480 tree.commit('rev1', rev_id='rev1')501 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
481 tree.commit('rev2', rev_id='rev2')502 # required to generate the revision-id.
482 tree.commit('rev3', rev_id='rev3')503 with override_environ(BZR_EMAIL='me@example.com'):
504 tree.commit('rev1', rev_id='rev1')
505 tree.commit('rev2', rev_id='rev2')
506 tree.commit('rev3', rev_id='rev3')
483 transaction.commit()507 transaction.commit()
484 self.layer.switchDbUser('branchscanner')508 self.layer.switchDbUser('branchscanner')
485 self.updateDBRevisions(509 self.updateDBRevisions(
@@ -504,7 +528,10 @@
504 branch, tree = self.create3CommitsBranch()528 branch, tree = self.create3CommitsBranch()
505 tree.pull(tree.branch, overwrite=True, stop_revision='rev2')529 tree.pull(tree.branch, overwrite=True, stop_revision='rev2')
506 tree.add_parent_tree_id('rev3')530 tree.add_parent_tree_id('rev3')
507 tree.commit('rev3a', rev_id='rev3a')531 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
532 # required to generate the revision-id.
533 with override_environ(BZR_EMAIL='me@example.com'):
534 tree.commit('rev3a', rev_id='rev3a')
508 self.updateDBRevisions(branch, tree.branch, ['rev3', 'rev3a'])535 self.updateDBRevisions(branch, tree.branch, ['rev3', 'rev3a'])
509 job = RevisionsAddedJob.create(branch, 'rev1', 'rev3', '')536 job = RevisionsAddedJob.create(branch, 'rev1', 'rev3', '')
510 job.bzr_branch.lock_read()537 job.bzr_branch.lock_read()
@@ -542,9 +569,12 @@
542 tree.branch.nick = 'nicholas'569 tree.branch.nick = 'nicholas'
543 tree.lock_write()570 tree.lock_write()
544 self.addCleanup(tree.unlock)571 self.addCleanup(tree.unlock)
545 tree.commit(572 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
546 'rev1', rev_id='rev1', timestamp=1000, timezone=0,573 # required to generate the revision-id.
547 committer='J. Random Hacker <jrandom@example.org>')574 with override_environ(BZR_EMAIL='me@example.com'):
575 tree.commit(
576 'rev1', rev_id='rev1', timestamp=1000, timezone=0,
577 committer='J. Random Hacker <jrandom@example.org>')
548 return branch, tree578 return branch, tree
549579
550 def makeRevisionsAddedWithMergeCommit(self, authors=None,580 def makeRevisionsAddedWithMergeCommit(self, authors=None,
@@ -558,20 +588,23 @@
558 self.useBzrBranches(direct_database=True)588 self.useBzrBranches(direct_database=True)
559 branch, tree = self.create_branch_and_tree()589 branch, tree = self.create_branch_and_tree()
560 tree.branch.nick = 'nicholas'590 tree.branch.nick = 'nicholas'
561 tree.commit('rev1')591 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
562 tree2 = tree.bzrdir.sprout('tree2').open_workingtree()592 # required to generate the revision-id.
563 tree2.commit('rev2a', rev_id='rev2a-id', committer='foo@')593 with override_environ(BZR_EMAIL='me@example.com'):
564 tree2.commit('rev3', rev_id='rev3-id',594 tree.commit('rev1')
565 authors=['bar@', 'baz@blaine.com'])595 tree2 = tree.bzrdir.sprout('tree2').open_workingtree()
566 tree.merge_from_branch(tree2.branch)596 tree2.commit('rev2a', rev_id='rev2a-id', committer='foo@')
567 tree3 = tree.bzrdir.sprout('tree3').open_workingtree()597 tree2.commit('rev3', rev_id='rev3-id',
568 tree3.commit('rev2b', rev_id='rev2b-id', committer='qux@')598 authors=['bar@', 'baz@blaine.com'])
569 tree.merge_from_branch(tree3.branch, force=True)599 tree.merge_from_branch(tree2.branch)
570 if include_ghost:600 tree3 = tree.bzrdir.sprout('tree3').open_workingtree()
571 tree.add_parent_tree_id('rev2c-id')601 tree3.commit('rev2b', rev_id='rev2b-id', committer='qux@')
572 tree.commit('rev2d', rev_id='rev2d-id', timestamp=1000, timezone=0,602 tree.merge_from_branch(tree3.branch, force=True)
573 committer='J. Random Hacker <jrandom@example.org>',603 if include_ghost:
574 authors=authors)604 tree.add_parent_tree_id('rev2c-id')
605 tree.commit('rev2d', rev_id='rev2d-id', timestamp=1000, timezone=0,
606 committer='J. Random Hacker <jrandom@example.org>',
607 authors=authors)
575 return RevisionsAddedJob.create(branch, 'rev2d-id', 'rev2d-id', '')608 return RevisionsAddedJob.create(branch, 'rev2d-id', 'rev2d-id', '')
576609
577 def test_getMergedRevisionIDs(self):610 def test_getMergedRevisionIDs(self):
@@ -817,17 +850,20 @@
817 first_revision = 'rev-1'850 first_revision = 'rev-1'
818 tree.bzrdir.root_transport.put_bytes('hello.txt', 'Hello World\n')851 tree.bzrdir.root_transport.put_bytes('hello.txt', 'Hello World\n')
819 tree.add('hello.txt')852 tree.add('hello.txt')
820 tree.commit(853 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
821 rev_id=first_revision, message="Log message",854 # required to generate the revision-id.
822 committer="Joe Bloggs <joe@example.com>", timestamp=1000000000.0,855 with override_environ(BZR_EMAIL='me@example.com'):
823 timezone=0)856 tree.commit(
824 tree.bzrdir.root_transport.put_bytes(857 rev_id=first_revision, message="Log message",
825 'hello.txt', 'Hello World\n\nFoo Bar\n')858 committer="Joe Bloggs <joe@example.com>",
826 second_revision = 'rev-2'859 timestamp=1000000000.0, timezone=0)
827 tree.commit(860 tree.bzrdir.root_transport.put_bytes(
828 rev_id=second_revision, message="Extended contents",861 'hello.txt', 'Hello World\n\nFoo Bar\n')
829 committer="Joe Bloggs <joe@example.com>", timestamp=1000100000.0,862 second_revision = 'rev-2'
830 timezone=0)863 tree.commit(
864 rev_id=second_revision, message="Extended contents",
865 committer="Joe Bloggs <joe@example.com>",
866 timestamp=1000100000.0, timezone=0)
831 transaction.commit()867 transaction.commit()
832 self.layer.switchDbUser('branchscanner')868 self.layer.switchDbUser('branchscanner')
833 self.updateDBRevisions(db_branch, tree.branch)869 self.updateDBRevisions(db_branch, tree.branch)
@@ -874,9 +910,13 @@
874 self.useBzrBranches(direct_database=True)910 self.useBzrBranches(direct_database=True)
875 db_branch, tree = self.create_branch_and_tree()911 db_branch, tree = self.create_branch_and_tree()
876 rev_id = 'rev-1'912 rev_id = 'rev-1'
877 tree.commit(913 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
878 rev_id=rev_id, message=u"Non ASCII: \xe9",914 # required to generate the revision-id.
879 committer=u"Non ASCII: \xed", timestamp=1000000000.0, timezone=0)915 with override_environ(BZR_EMAIL='me@example.com'):
916 tree.commit(
917 rev_id=rev_id, message=u"Non ASCII: \xe9",
918 committer=u"Non ASCII: \xed", timestamp=1000000000.0,
919 timezone=0)
880 transaction.commit()920 transaction.commit()
881 self.layer.switchDbUser('branchscanner')921 self.layer.switchDbUser('branchscanner')
882 self.updateDBRevisions(db_branch, tree.branch)922 self.updateDBRevisions(db_branch, tree.branch)
@@ -986,7 +1026,10 @@
986 [self.tree.abspath(file_pair[0]) for file_pair in files])1026 [self.tree.abspath(file_pair[0]) for file_pair in files])
987 if commit_message is None:1027 if commit_message is None:
988 commit_message = self.factory.getUniqueString('commit')1028 commit_message = self.factory.getUniqueString('commit')
989 revision_id = self.tree.commit(commit_message)1029 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
1030 # required to generate the revision-id.
1031 with override_environ(BZR_EMAIL='me@example.com'):
1032 revision_id = self.tree.commit(commit_message)
990 self.branch.last_scanned_id = revision_id1033 self.branch.last_scanned_id = revision_id
991 self.branch.last_mirrored_id = revision_id1034 self.branch.last_mirrored_id = revision_id
992 return revision_id1035 return revision_id
9931036
=== modified file 'lib/lp/code/model/tests/test_branchmergeproposaljobs.py'
--- lib/lp/code/model/tests/test_branchmergeproposaljobs.py 2010-06-11 01:51:15 +0000
+++ lib/lp/code/model/tests/test_branchmergeproposaljobs.py 2010-08-17 04:46:45 +0000
@@ -3,6 +3,8 @@
33
4"""Tests for branch merge proposal jobs."""4"""Tests for branch merge proposal jobs."""
55
6from __future__ import with_statement
7
6__metaclass__ = type8__metaclass__ = type
79
8from datetime import datetime, timedelta10from datetime import datetime, timedelta
@@ -39,6 +41,7 @@
39from lp.code.subscribers.branchmergeproposal import merge_proposal_modified41from lp.code.subscribers.branchmergeproposal import merge_proposal_modified
40from lp.services.job.runner import JobRunner42from lp.services.job.runner import JobRunner
41from lp.services.job.model.job import Job43from lp.services.job.model.job import Job
44from lp.services.osutils import override_environ
42from lp.testing import TestCaseWithFactory45from lp.testing import TestCaseWithFactory
43from lp.testing.mail_helpers import pop_notifications46from lp.testing.mail_helpers import pop_notifications
4447
@@ -104,7 +107,10 @@
104107
105 def createProposalWithEmptyBranches(self):108 def createProposalWithEmptyBranches(self):
106 target_branch, tree = self.create_branch_and_tree()109 target_branch, tree = self.create_branch_and_tree()
107 tree.commit('test')110 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
111 # required to generate the revision-id.
112 with override_environ(BZR_EMAIL='me@example.com'):
113 tree.commit('test')
108 source_branch = self.factory.makeProductBranch(114 source_branch = self.factory.makeProductBranch(
109 product=target_branch.product)115 product=target_branch.product)
110 self.createBzrBranch(source_branch, tree.branch)116 self.createBzrBranch(source_branch, tree.branch)
@@ -137,7 +143,10 @@
137 bmp = self.factory.makeBranchMergeProposal(143 bmp = self.factory.makeBranchMergeProposal(
138 target_branch=self.factory.makePackageBranch())144 target_branch=self.factory.makePackageBranch())
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]
140 tree.commit('Initial commit')146 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
147 # required to generate the revision-id.
148 with override_environ(BZR_EMAIL='me@example.com'):
149 tree.commit('Initial commit')
141 self.createBzrBranch(bmp.source_branch, tree.branch)150 self.createBzrBranch(bmp.source_branch, tree.branch)
142 self.factory.makeRevisionsForBranch(bmp.source_branch, count=1)151 self.factory.makeRevisionsForBranch(bmp.source_branch, count=1)
143 job = MergeProposalCreatedJob.create(bmp)152 job = MergeProposalCreatedJob.create(bmp)
144153
=== modified file 'lib/lp/code/model/tests/test_diff.py'
--- lib/lp/code/model/tests/test_diff.py 2010-08-02 02:13:52 +0000
+++ lib/lp/code/model/tests/test_diff.py 2010-08-17 04:46:45 +0000
@@ -3,6 +3,8 @@
33
4"""Tests for Diff, etc."""4"""Tests for Diff, etc."""
55
6from __future__ import with_statement
7
6__metaclass__ = type8__metaclass__ = type
79
810
@@ -26,6 +28,7 @@
26from lp.code.interfaces.diff import (28from lp.code.interfaces.diff import (
27 IDiff, IPreviewDiff, IStaticDiff, IStaticDiffSource)29 IDiff, IPreviewDiff, IStaticDiff, IStaticDiffSource)
28from lp.testing import login, login_person, TestCaseWithFactory30from lp.testing import login, login_person, TestCaseWithFactory
31from lp.services.osutils import override_environ
2932
3033
31class RecordLister(logging.Handler):34class RecordLister(logging.Handler):
@@ -285,7 +288,10 @@
285 """Ensure that acquire returns the existing StaticDiff."""288 """Ensure that acquire returns the existing StaticDiff."""
286 self.useBzrBranches(direct_database=True)289 self.useBzrBranches(direct_database=True)
287 branch, tree = self.create_branch_and_tree()290 branch, tree = self.create_branch_and_tree()
288 tree.commit('First commit', rev_id='rev1')291 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
292 # required to generate the revision-id.
293 with override_environ(BZR_EMAIL='me@example.com'):
294 tree.commit('First commit', rev_id='rev1')
289 diff1 = StaticDiff.acquire('null:', 'rev1', tree.branch.repository)295 diff1 = StaticDiff.acquire('null:', 'rev1', tree.branch.repository)
290 diff2 = StaticDiff.acquire('null:', 'rev1', tree.branch.repository)296 diff2 = StaticDiff.acquire('null:', 'rev1', tree.branch.repository)
291 self.assertIs(diff1, diff2)297 self.assertIs(diff1, diff2)
@@ -294,7 +300,10 @@
294 """The existing object is used even if the repository is different."""300 """The existing object is used even if the repository is different."""
295 self.useBzrBranches(direct_database=True)301 self.useBzrBranches(direct_database=True)
296 branch1, tree1 = self.create_branch_and_tree('tree1')302 branch1, tree1 = self.create_branch_and_tree('tree1')
297 tree1.commit('First commit', rev_id='rev1')303 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
304 # required to generate the revision-id.
305 with override_environ(BZR_EMAIL='me@example.com'):
306 tree1.commit('First commit', rev_id='rev1')
298 branch2, tree2 = self.create_branch_and_tree('tree2')307 branch2, tree2 = self.create_branch_and_tree('tree2')
299 tree2.pull(tree1.branch)308 tree2.pull(tree1.branch)
300 diff1 = StaticDiff.acquire('null:', 'rev1', tree1.branch.repository)309 diff1 = StaticDiff.acquire('null:', 'rev1', tree1.branch.repository)
@@ -305,8 +314,11 @@
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."""
306 self.useBzrBranches(direct_database=True)315 self.useBzrBranches(direct_database=True)
307 branch, tree = self.create_branch_and_tree()316 branch, tree = self.create_branch_and_tree()
308 tree.commit('First commit', rev_id='rev1')317 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
309 tree.commit('Next commit', rev_id='rev2')318 # required to generate the revision-id.
319 with override_environ(BZR_EMAIL='me@example.com'):
320 tree.commit('First commit', rev_id='rev1')
321 tree.commit('Next commit', rev_id='rev2')
310 diff1 = StaticDiff.acquire('null:', 'rev1', tree.branch.repository)322 diff1 = StaticDiff.acquire('null:', 'rev1', tree.branch.repository)
311 diff2 = StaticDiff.acquire('rev1', 'rev2', tree.branch.repository)323 diff2 = StaticDiff.acquire('rev1', 'rev2', tree.branch.repository)
312 self.assertIsNot(diff1, diff2)324 self.assertIsNot(diff1, diff2)
313325
=== modified file 'lib/lp/code/scripts/tests/test_scan_branches.py'
--- lib/lp/code/scripts/tests/test_scan_branches.py 2010-06-07 09:11:06 +0000
+++ lib/lp/code/scripts/tests/test_scan_branches.py 2010-08-17 04:46:45 +0000
@@ -6,6 +6,8 @@
6"""Test the scan_branches script."""6"""Test the scan_branches script."""
77
88
9from __future__ import with_statement
10
9from storm.locals import Store11from storm.locals import Store
10import transaction12import transaction
1113
@@ -17,6 +19,7 @@
17 CodeReviewNotificationLevel)19 CodeReviewNotificationLevel)
18from lp.code.model.branchjob import BranchJob, BranchJobType, BranchScanJob20from lp.code.model.branchjob import BranchJob, BranchJobType, BranchScanJob
19from lp.services.job.model.job import Job, JobStatus21from lp.services.job.model.job import Job, JobStatus
22from lp.services.osutils import override_environ
2023
2124
22class TestScanBranches(TestCaseWithFactory):25class TestScanBranches(TestCaseWithFactory):
@@ -27,9 +30,12 @@
27 def make_branch_with_commits_and_scan_job(self, db_branch):30 def make_branch_with_commits_and_scan_job(self, db_branch):
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."""
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)
30 target_tree.commit('First commit', rev_id='rev1')33 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
31 target_tree.commit('Second commit', rev_id='rev2')34 # required to generate the revision-id.
32 target_tree.commit('Third commit', rev_id='rev3')35 with override_environ(BZR_EMAIL='me@example.com'):
36 target_tree.commit('First commit', rev_id='rev1')
37 target_tree.commit('Second commit', rev_id='rev2')
38 target_tree.commit('Third commit', rev_id='rev3')
33 BranchScanJob.create(db_branch)39 BranchScanJob.create(db_branch)
34 transaction.commit()40 transaction.commit()
3541
3642
=== modified file 'lib/lp/code/scripts/tests/test_sendbranchmail.py'
--- lib/lp/code/scripts/tests/test_sendbranchmail.py 2010-06-07 09:11:06 +0000
+++ lib/lp/code/scripts/tests/test_sendbranchmail.py 2010-08-17 04:46:45 +0000
@@ -5,6 +5,8 @@
55
6"""Test the sendbranchmail script"""6"""Test the sendbranchmail script"""
77
8from __future__ import with_statement
9
8import unittest10import unittest
9import transaction11import transaction
1012
@@ -16,6 +18,7 @@
16from lp.code.model.branchjob import (18from lp.code.model.branchjob import (
17 RevisionMailJob, RevisionsAddedJob)19 RevisionMailJob, RevisionsAddedJob)
18from lp.testing import TestCaseWithFactory20from lp.testing import TestCaseWithFactory
21from lp.services.osutils import override_environ
1922
2023
21class TestSendbranchmail(TestCaseWithFactory):24class TestSendbranchmail(TestCaseWithFactory):
@@ -33,7 +36,10 @@
33 transport = tree.bzrdir.root_transport36 transport = tree.bzrdir.root_transport
34 transport.put_bytes('foo', 'bar')37 transport.put_bytes('foo', 'bar')
35 tree.add('foo')38 tree.add('foo')
36 tree.commit('Added foo.', rev_id='rev1')39 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
40 # required to generate the revision-id.
41 with override_environ(BZR_EMAIL='me@example.com'):
42 tree.commit('Added foo.', rev_id='rev1')
37 return branch, tree43 return branch, tree
3844
39 def test_sendbranchmail(self):45 def test_sendbranchmail(self):
@@ -73,7 +79,10 @@
73 self.useBzrBranches()79 self.useBzrBranches()
74 branch, tree = self.createBranch()80 branch, tree = self.createBranch()
75 tree.bzrdir.root_transport.put_bytes('foo', 'baz')81 tree.bzrdir.root_transport.put_bytes('foo', 'baz')
76 tree.commit('Added foo.', rev_id='rev2')82 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
83 # required to generate the revision-id.
84 with override_environ(BZR_EMAIL='me@example.com'):
85 tree.commit('Added foo.', rev_id='rev2')
77 RevisionsAddedJob.create(86 RevisionsAddedJob.create(
78 branch, 'rev1', 'rev2', 'from@example.org')87 branch, 'rev1', 'rev2', 'from@example.org')
79 transaction.commit()88 transaction.commit()
8089
=== modified file 'lib/lp/codehosting/codeimport/tests/test_worker.py'
--- lib/lp/codehosting/codeimport/tests/test_worker.py 2010-08-02 23:01:15 +0000
+++ lib/lp/codehosting/codeimport/tests/test_worker.py 2010-08-17 04:46:45 +0000
@@ -952,7 +952,7 @@
952 t = get_transport(self.get_url('.'))952 t = get_transport(self.get_url('.'))
953 t.mkdir('reference')953 t.mkdir('reference')
954 a_bzrdir = BzrDir.create(self.get_url('reference'))954 a_bzrdir = BzrDir.create(self.get_url('reference'))
955 BranchReferenceFormat().initialize(a_bzrdir, branch)955 BranchReferenceFormat().initialize(a_bzrdir, target_branch=branch)
956 return a_bzrdir.root_transport.base956 return a_bzrdir.root_transport.base
957957
958 def test_reject_branch_reference(self):958 def test_reject_branch_reference(self):
959959
=== modified file 'lib/lp/codehosting/codeimport/uifactory.py'
--- lib/lp/codehosting/codeimport/uifactory.py 2009-08-24 16:27:33 +0000
+++ lib/lp/codehosting/codeimport/uifactory.py 2010-08-17 04:46:45 +0000
@@ -75,6 +75,24 @@
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.
76 return ''76 return ''
7777
78 def _render_line(self):
79 bar_string = self._render_bar()
80 if self._last_task:
81 task_part, counter_part = self._format_task(self._last_task)
82 else:
83 task_part = counter_part = ''
84 if self._last_task and not self._last_task.show_transport_activity:
85 trans = ''
86 else:
87 trans = self._last_transport_msg
88 # the bar separates the transport activity from the message, so even
89 # if there's no bar or spinner, we must show something if both those
90 # fields are present
91 if (task_part and trans) and not bar_string:
92 bar_string = ' | '
93 s = trans + bar_string + task_part + counter_part
94 return s
95
78 def _format_transport_msg(self, scheme, dir_char, rate):96 def _format_transport_msg(self, scheme, dir_char, rate):
79 # We just report the amount of data transferred.97 # We just report the amount of data transferred.
80 return '%s bytes transferred' % self._bytes_since_update98 return '%s bytes transferred' % self._bytes_since_update
8199
=== modified file 'lib/lp/codehosting/puller/worker.py'
--- lib/lp/codehosting/puller/worker.py 2010-04-21 01:56:51 +0000
+++ lib/lp/codehosting/puller/worker.py 2010-08-17 04:46:45 +0000
@@ -503,7 +503,7 @@
503 def get_boolean(self, prompt):503 def get_boolean(self, prompt):
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.
505 """505 """
506 assert prompt.startswith('Break lock'), (506 assert prompt.startswith('Break '), (
507 "Didn't expect prompt %r" % (prompt,))507 "Didn't expect prompt %r" % (prompt,))
508 branch_id = self.puller_worker_protocol.branch_id508 branch_id = self.puller_worker_protocol.branch_id
509 if get_lock_id_for_branch_id(branch_id) in prompt:509 if get_lock_id_for_branch_id(branch_id) in prompt:
510510
=== modified file 'lib/lp/codehosting/scanner/tests/test_buglinks.py'
--- lib/lp/codehosting/scanner/tests/test_buglinks.py 2010-08-02 02:13:52 +0000
+++ lib/lp/codehosting/scanner/tests/test_buglinks.py 2010-08-17 04:46:45 +0000
@@ -3,6 +3,8 @@
33
4"""Tests for creating BugBranch items based on Bazaar revisions."""4"""Tests for creating BugBranch items based on Bazaar revisions."""
55
6from __future__ import with_statement
7
6__metaclass__ = type8__metaclass__ = type
79
8import unittest10import unittest
@@ -22,6 +24,7 @@
22from lp.codehosting.scanner.tests.test_bzrsync import BzrSyncTestCase24from lp.codehosting.scanner.tests.test_bzrsync import BzrSyncTestCase
23from lp.registry.interfaces.pocket import PackagePublishingPocket25from lp.registry.interfaces.pocket import PackagePublishingPocket
24from lp.testing import TestCase, TestCaseWithFactory26from lp.testing import TestCase, TestCaseWithFactory
27from lp.services.osutils import override_environ
2528
2629
27class RevisionPropertyParsing(TestCase):30class RevisionPropertyParsing(TestCase):
@@ -189,28 +192,31 @@
189 """Don't add BugBranches based on non-mainline revisions."""192 """Don't add BugBranches based on non-mainline revisions."""
190 # Make the base revision.193 # Make the base revision.
191 author = self.factory.getUniqueString()194 author = self.factory.getUniqueString()
192 self.bzr_tree.commit(195 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
193 u'common parent', committer=author, rev_id='r1',196 # required to generate the revision-id.
194 allow_pointless=True)197 with override_environ(BZR_EMAIL='me@example.com'):
195198 self.bzr_tree.commit(
196 # Branch from the base revision.199 u'common parent', committer=author, rev_id='r1',
197 new_tree = self.make_branch_and_tree('bzr_branch_merged')200 allow_pointless=True)
198 new_tree.pull(self.bzr_branch)201
199202 # Branch from the base revision.
200 # Commit to both branches203 new_tree = self.make_branch_and_tree('bzr_branch_merged')
201 self.bzr_tree.commit(204 new_tree.pull(self.bzr_branch)
202 u'commit one', committer=author, rev_id='r2',205
203 allow_pointless=True)206 # Commit to both branches
204 new_tree.commit(207 self.bzr_tree.commit(
205 u'commit two', committer=author, rev_id='r1.1.1',208 u'commit one', committer=author, rev_id='r2',
206 allow_pointless=True,209 allow_pointless=True)
207 revprops={'bugs': '%s fixed' % self.getBugURL(self.bug1)})210 new_tree.commit(
208211 u'commit two', committer=author, rev_id='r1.1.1',
209 # Merge and commit.212 allow_pointless=True,
210 self.bzr_tree.merge_from_branch(new_tree.branch)213 revprops={'bugs': '%s fixed' % self.getBugURL(self.bug1)})
211 self.bzr_tree.commit(214
212 u'merge', committer=author, rev_id='r3',215 # Merge and commit.
213 allow_pointless=True)216 self.bzr_tree.merge_from_branch(new_tree.branch)
217 self.bzr_tree.commit(
218 u'merge', committer=author, rev_id='r3',
219 allow_pointless=True)
214220
215 self.syncBazaarBranchToDatabase(self.bzr_branch, self.db_branch)221 self.syncBazaarBranchToDatabase(self.bzr_branch, self.db_branch)
216 self.assertEqual(222 self.assertEqual(
@@ -251,8 +257,12 @@
251 bug = self.factory.makeBug()257 bug = self.factory.makeBug()
252 self.layer.txn.commit()258 self.layer.txn.commit()
253 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)259 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)
254 revision_id = tree.commit('fix revision',260 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
255 revprops={'bugs': 'https://launchpad.net/bugs/%d fixed' % bug.id})261 # required to generate the revision-id.
262 with override_environ(BZR_EMAIL='me@example.com'):
263 revision_id = tree.commit('fix revision',
264 revprops={
265 'bugs': 'https://launchpad.net/bugs/%d fixed' % bug.id})
256 bzr_revision = tree.branch.repository.get_revision(revision_id)266 bzr_revision = tree.branch.repository.get_revision(revision_id)
257 revno = 1267 revno = 1
258 revision_set = getUtility(IRevisionSet)268 revision_set = getUtility(IRevisionSet)
259269
=== modified file 'lib/lp/codehosting/scanner/tests/test_bzrsync.py'
--- lib/lp/codehosting/scanner/tests/test_bzrsync.py 2010-07-14 14:48:46 +0000
+++ lib/lp/codehosting/scanner/tests/test_bzrsync.py 2010-08-17 04:46:45 +0000
@@ -5,6 +5,8 @@
55
6# pylint: disable-msg=W01416# pylint: disable-msg=W0141
77
8from __future__ import with_statement
9
8import datetime10import datetime
9import os11import os
10import random12import random
@@ -32,6 +34,7 @@
32from lp.codehosting.scanner.bzrsync import BzrSync34from lp.codehosting.scanner.bzrsync import BzrSync
33from lp.testing import TestCaseWithFactory35from lp.testing import TestCaseWithFactory
34from canonical.testing import LaunchpadZopelessLayer36from canonical.testing import LaunchpadZopelessLayer
37from lp.services.osutils import override_environ
3538
3639
37def run_as_db_user(username):40def run_as_db_user(username):
@@ -160,10 +163,13 @@
160 committer = self.factory.getUniqueString()163 committer = self.factory.getUniqueString()
161 if extra_parents is not None:164 if extra_parents is not None:
162 self.bzr_tree.add_pending_merge(*extra_parents)165 self.bzr_tree.add_pending_merge(*extra_parents)
163 return self.bzr_tree.commit(166 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
164 message, committer=committer, rev_id=rev_id,167 # required to generate the revision-id.
165 timestamp=timestamp, timezone=timezone, allow_pointless=True,168 with override_environ(BZR_EMAIL='me@example.com'):
166 revprops=revprops)169 return self.bzr_tree.commit(
170 message, committer=committer, rev_id=rev_id,
171 timestamp=timestamp, timezone=timezone, allow_pointless=True,
172 revprops=revprops)
167173
168 def uncommitRevision(self):174 def uncommitRevision(self):
169 branch = self.bzr_tree.branch175 branch = self.bzr_tree.branch
@@ -207,21 +213,24 @@
207 db_branch = self.makeDatabaseBranch()213 db_branch = self.makeDatabaseBranch()
208 db_branch, trunk_tree = self.create_branch_and_tree(214 db_branch, trunk_tree = self.create_branch_and_tree(
209 db_branch=db_branch)215 db_branch=db_branch)
210 trunk_tree.commit(u'base revision', rev_id=base_rev_id)216 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
211217 # required to generate the revision-id.
212 # Branch from the base revision.218 with override_environ(BZR_EMAIL='me@example.com'):
213 new_db_branch = self.makeDatabaseBranch(product=db_branch.product)219 trunk_tree.commit(u'base revision', rev_id=base_rev_id)
214 new_db_branch, branch_tree = self.create_branch_and_tree(220
215 db_branch=new_db_branch)221 # Branch from the base revision.
216 branch_tree.pull(trunk_tree.branch)222 new_db_branch = self.makeDatabaseBranch(product=db_branch.product)
217223 new_db_branch, branch_tree = self.create_branch_and_tree(
218 # Commit to both branches.224 db_branch=new_db_branch)
219 trunk_tree.commit(u'trunk revision', rev_id=trunk_rev_id)225 branch_tree.pull(trunk_tree.branch)
220 branch_tree.commit(u'branch revision', rev_id=branch_rev_id)226
221227 # Commit to both branches.
222 # Merge branch into trunk.228 trunk_tree.commit(u'trunk revision', rev_id=trunk_rev_id)
223 trunk_tree.merge_from_branch(branch_tree.branch)229 branch_tree.commit(u'branch revision', rev_id=branch_rev_id)
224 trunk_tree.commit(u'merge revision', rev_id=merge_rev_id)230
231 # Merge branch into trunk.
232 trunk_tree.merge_from_branch(branch_tree.branch)
233 trunk_tree.commit(u'merge revision', rev_id=merge_rev_id)
225234
226 LaunchpadZopelessLayer.txn.commit()235 LaunchpadZopelessLayer.txn.commit()
227 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)236 LaunchpadZopelessLayer.switchDbUser(config.branchscanner.dbuser)
228237
=== modified file 'lib/lp/codehosting/scanner/tests/test_mergedetection.py'
--- lib/lp/codehosting/scanner/tests/test_mergedetection.py 2010-04-12 17:02:16 +0000
+++ lib/lp/codehosting/scanner/tests/test_mergedetection.py 2010-08-17 04:46:45 +0000
@@ -3,6 +3,8 @@
33
4"""Tests for the scanner's merge detection."""4"""Tests for the scanner's merge detection."""
55
6from __future__ import with_statement
7
6__metaclass__ = type8__metaclass__ = type
79
8import logging10import logging
@@ -27,6 +29,7 @@
27 BranchMergeProposalJob, BranchMergeProposalJobFactory,29 BranchMergeProposalJob, BranchMergeProposalJobFactory,
28 BranchMergeProposalJobType)30 BranchMergeProposalJobType)
29from lp.code.interfaces.branchlookup import IBranchLookup31from lp.code.interfaces.branchlookup import IBranchLookup
32from lp.services.osutils import override_environ
30from lp.testing import TestCase, TestCaseWithFactory33from lp.testing import TestCase, TestCaseWithFactory
31from lp.testing.mail_helpers import pop_notifications34from lp.testing.mail_helpers import pop_notifications
3235
@@ -129,7 +132,10 @@
129 proposal, db_trunk, db_branch, branch_tree = (132 proposal, db_trunk, db_branch, branch_tree = (
130 self._createBranchesAndProposal())133 self._createBranchesAndProposal())
131134
132 branch_tree.commit(u'another revision', rev_id='another-rev')135 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
136 # required to generate the revision-id.
137 with override_environ(BZR_EMAIL='me@example.com'):
138 branch_tree.commit(u'another revision', rev_id='another-rev')
133 current_proposal_status = proposal.queue_status139 current_proposal_status = proposal.queue_status
134 self.assertNotEqual(140 self.assertNotEqual(
135 current_proposal_status,141 current_proposal_status,
@@ -147,7 +153,10 @@
147 proposal, db_trunk, db_branch, branch_tree = (153 proposal, db_trunk, db_branch, branch_tree = (
148 self._createBranchesAndProposal())154 self._createBranchesAndProposal())
149155
150 branch_tree.commit(u'another revision', rev_id='another-rev')156 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
157 # required to generate the revision-id.
158 with override_environ(BZR_EMAIL='me@example.com'):
159 branch_tree.commit(u'another revision', rev_id='another-rev')
151 current_proposal_status = proposal.queue_status160 current_proposal_status = proposal.queue_status
152 self.assertNotEqual(161 self.assertNotEqual(
153 current_proposal_status,162 current_proposal_status,
154163
=== modified file 'lib/lp/codehosting/tests/test_acceptance.py'
--- lib/lp/codehosting/tests/test_acceptance.py 2010-08-05 11:56:34 +0000
+++ lib/lp/codehosting/tests/test_acceptance.py 2010-08-17 04:46:45 +0000
@@ -242,10 +242,7 @@
242 creator_id, '/~%s/%s/%s' % (user, product, branch))242 creator_id, '/~%s/%s/%s' % (user, product, branch))
243 branch_url = 'file://' + os.path.abspath(243 branch_url = 'file://' + os.path.abspath(
244 os.path.join(branch_root, branch_id_to_path(branch_id)))244 os.path.join(branch_root, branch_id_to_path(branch_id)))
245 self.runInChdir(245 self.push(self.local_branch_path, branch_url, ['--create-prefix'])
246 self.local_branch_path,
247 self.run_bzr, ['push', '--create-prefix', branch_url],
248 retcode=None)
249 return branch_url246 return branch_url
250247
251248
252249
=== modified file 'lib/lp/codehosting/tests/test_branchdistro.py'
--- lib/lp/codehosting/tests/test_branchdistro.py 2010-04-23 05:49:08 +0000
+++ lib/lp/codehosting/tests/test_branchdistro.py 2010-08-17 04:46:45 +0000
@@ -4,6 +4,8 @@
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.
5"""5"""
66
7from __future__ import with_statement
8
7__metaclass__ = type9__metaclass__ = type
810
9import os11import os
@@ -32,6 +34,7 @@
32from lp.codehosting.vfs import branch_id_to_path34from lp.codehosting.vfs import branch_id_to_path
33from lp.registry.interfaces.pocket import PackagePublishingPocket35from lp.registry.interfaces.pocket import PackagePublishingPocket
34from lp.testing import TestCaseWithFactory36from lp.testing import TestCaseWithFactory
37from lp.services.osutils import override_environ
3538
3639
37# We say "RELEASE" often enough to not want to say "PackagePublishingPocket."40# We say "RELEASE" often enough to not want to say "PackagePublishingPocket."
@@ -66,7 +69,10 @@
66 old_branch = FakeBranch(1)69 old_branch = FakeBranch(1)
67 self.get_transport(old_branch.unique_name).create_prefix()70 self.get_transport(old_branch.unique_name).create_prefix()
68 tree = self.make_branch_and_tree(old_branch.unique_name)71 tree = self.make_branch_and_tree(old_branch.unique_name)
69 tree.commit(message='.')72 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
73 # required to generate the revision-id.
74 with override_environ(BZR_EMAIL='me@example.com'):
75 tree.commit(message='.')
7076
71 new_branch = FakeBranch(2)77 new_branch = FakeBranch(2)
7278
@@ -119,7 +125,10 @@
119125
120 _, tree = self.create_branch_and_tree(126 _, tree = self.create_branch_and_tree(
121 tree_location=self.factory.getUniqueString(), db_branch=db_branch)127 tree_location=self.factory.getUniqueString(), db_branch=db_branch)
122 tree.commit('')128 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
129 # required to generate the revision-id.
130 with override_environ(BZR_EMAIL='me@example.com'):
131 tree.commit('')
123132
124 return db_branch133 return db_branch
125134
@@ -484,8 +493,11 @@
484 brancher.makeOneNewBranch(db_branch)493 brancher.makeOneNewBranch(db_branch)
485 url = 'lp-internal:///' + db_branch.unique_name494 url = 'lp-internal:///' + db_branch.unique_name
486 old_bzr_branch = Branch.open(url)495 old_bzr_branch = Branch.open(url)
487 old_bzr_branch.create_checkout(496 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
488 self.factory.getUniqueString()).commit('')497 # required to generate the revision-id.
498 with override_environ(BZR_EMAIL='me@example.com'):
499 old_bzr_branch.create_checkout(
500 self.factory.getUniqueString()).commit('')
489 ok = brancher.checkOneBranch(db_branch)501 ok = brancher.checkOneBranch(db_branch)
490 self.assertLogMessages([502 self.assertLogMessages([
491 '^WARNING Repository at lp-internal:///.*/.*/.*/.* has 1 '503 '^WARNING Repository at lp-internal:///.*/.*/.*/.* has 1 '
492504
=== modified file 'lib/lp/codehosting/tests/test_bzrutils.py'
--- lib/lp/codehosting/tests/test_bzrutils.py 2010-04-23 01:47:30 +0000
+++ lib/lp/codehosting/tests/test_bzrutils.py 2010-08-17 04:46:45 +0000
@@ -14,7 +14,7 @@
14from bzrlib.branch import Branch, BranchReferenceFormat14from bzrlib.branch import Branch, BranchReferenceFormat
15from bzrlib.bzrdir import BzrDir, format_registry15from bzrlib.bzrdir import BzrDir, format_registry
16from bzrlib.remote import RemoteBranch16from bzrlib.remote import RemoteBranch
17from bzrlib.smart import server17from bzrlib.tests import test_server
18from bzrlib.tests import (18from bzrlib.tests import (
19 multiply_tests, TestCase, TestCaseWithTransport, TestLoader,19 multiply_tests, TestCase, TestCaseWithTransport, TestLoader,
20 TestNotApplicable)20 TestNotApplicable)
@@ -191,7 +191,7 @@
191 # of the branch, repo and bzrdir, even if the branch is a191 # of the branch, repo and bzrdir, even if the branch is a
192 # RemoteBranch.192 # RemoteBranch.
193 vfs_branch = self.make_branch('.')193 vfs_branch = self.make_branch('.')
194 smart_server = server.SmartTCPServer_for_testing()194 smart_server = test_server.SmartTCPServer_for_testing()
195 smart_server.start_server(self.get_vfs_only_server())195 smart_server.start_server(self.get_vfs_only_server())
196 self.addCleanup(smart_server.stop_server)196 self.addCleanup(smart_server.stop_server)
197 remote_branch = Branch.open(smart_server.get_url())197 remote_branch = Branch.open(smart_server.get_url())
198198
=== modified file 'lib/lp/codehosting/tests/test_jobs.py'
--- lib/lp/codehosting/tests/test_jobs.py 2010-05-27 02:04:21 +0000
+++ lib/lp/codehosting/tests/test_jobs.py 2010-08-17 04:46:45 +0000
@@ -3,6 +3,7 @@
33
4"""Tests for Job-running facilities."""4"""Tests for Job-running facilities."""
55
6from __future__ import with_statement
67
7from unittest import TestLoader8from unittest import TestLoader
89
@@ -15,6 +16,7 @@
15from lp.code.model.branchjob import RevisionMailJob16from lp.code.model.branchjob import RevisionMailJob
16from lp.code.model.diff import StaticDiff17from lp.code.model.diff import StaticDiff
17from lp.services.job.runner import JobRunner18from lp.services.job.runner import JobRunner
19from lp.services.osutils import override_environ
18from lp.testing import TestCaseWithFactory20from lp.testing import TestCaseWithFactory
1921
2022
@@ -34,7 +36,10 @@
34 tree_transport = tree.bzrdir.root_transport36 tree_transport = tree.bzrdir.root_transport
35 tree_transport.put_bytes("hello.txt", "Hello World\n")37 tree_transport.put_bytes("hello.txt", "Hello World\n")
36 tree.add('hello.txt')38 tree.add('hello.txt')
37 to_revision_id = tree.commit('rev1', timestamp=1e9, timezone=0)39 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
40 # required to generate the revision-id.
41 with override_environ(BZR_EMAIL='me@example.com'):
42 to_revision_id = tree.commit('rev1', timestamp=1e9, timezone=0)
38 job = RevisionMailJob.create(43 job = RevisionMailJob.create(
39 branch, 1, 'from@example.org', 'body', True, 'subject')44 branch, 1, 'from@example.org', 'body', True, 'subject')
40 LaunchpadZopelessLayer.txn.commit()45 LaunchpadZopelessLayer.txn.commit()
4146
=== modified file 'lib/lp/codehosting/vfs/tests/test_transport.py'
--- lib/lp/codehosting/vfs/tests/test_transport.py 2010-04-19 07:05:57 +0000
+++ lib/lp/codehosting/vfs/tests/test_transport.py 2010-08-17 04:46:45 +0000
@@ -43,6 +43,9 @@
43 BlockingProxy(branchfs), LocalTransport(local_path_to_url('.')))43 BlockingProxy(branchfs), LocalTransport(local_path_to_url('.')))
44 self._chroot_servers = []44 self._chroot_servers = []
4545
46 def get_bogus_url(self):
47 return self._scheme + 'bogus'
48
46 def _transportFactory(self, url):49 def _transportFactory(self, url):
47 """See `LaunchpadInternalServer._transportFactory`.50 """See `LaunchpadInternalServer._transportFactory`.
4851
4952
=== modified file 'lib/lp/services/osutils.py'
--- lib/lp/services/osutils.py 2010-03-18 19:18:34 +0000
+++ lib/lp/services/osutils.py 2010-08-17 04:46:45 +0000
@@ -5,12 +5,14 @@
55
6__metaclass__ = type6__metaclass__ = type
7__all__ = [7__all__ = [
8 'override_environ',
8 'remove_tree',9 'remove_tree',
9 'kill_by_pidfile',10 'kill_by_pidfile',
10 'remove_if_exists',11 'remove_if_exists',
11 'two_stage_kill',12 'two_stage_kill',
12 ]13 ]
1314
15from contextlib import contextmanager
14import os.path16import os.path
15import shutil17import shutil
1618
@@ -26,3 +28,33 @@
26 """Remove the tree at 'path' from disk."""28 """Remove the tree at 'path' from disk."""
27 if os.path.exists(path):29 if os.path.exists(path):
28 shutil.rmtree(path)30 shutil.rmtree(path)
31
32
33def set_environ(new_values):
34 """Set the environment variables as specified by new_values.
35
36 :return: a dict of the old values
37 """
38 old_values = {}
39 for name, value in new_values.iteritems():
40 old_values[name] = os.environ.get(name)
41 if value is None:
42 if old_values[name] is not None:
43 del os.environ[name]
44 else:
45 os.environ[name] = value
46 return old_values
47
48
49@contextmanager
50def override_environ(**kwargs):
51 """Override environment variables with the kwarg values.
52
53 If a value is None, the environment variable is deleted. Variables are
54 restored to their previous state when exiting the context.
55 """
56 old_values = set_environ(kwargs)
57 try:
58 yield
59 finally:
60 set_environ(old_values)
2961
=== modified file 'lib/lp/testing/__init__.py'
--- lib/lp/testing/__init__.py 2010-08-02 19:52:59 +0000
+++ lib/lp/testing/__init__.py 2010-08-17 04:46:45 +0000
@@ -117,6 +117,7 @@
117 launchpadlib_credentials_for, launchpadlib_for, oauth_access_token_for)117 launchpadlib_credentials_for, launchpadlib_for, oauth_access_token_for)
118from lp.testing.matchers import Provides118from lp.testing.matchers import Provides
119from lp.testing.fixture import ZopeEventHandlerFixture119from lp.testing.fixture import ZopeEventHandlerFixture
120from lp.services.osutils import override_environ
120121
121# zope.exception demands more of frame objects than twisted.python.failure122# zope.exception demands more of frame objects than twisted.python.failure
122# provides in its fake frames. This is enough to make it work with them123# provides in its fake frames. This is enough to make it work with them
@@ -577,18 +578,11 @@
577 return os.path.join(base, branch_id_to_path(branch.id))578 return os.path.join(base, branch_id_to_path(branch.id))
578579
579 def useTempBzrHome(self):580 def useTempBzrHome(self):
580 # XXX: Extract the temporary environment blatting into a generic
581 # helper function.
582 self.useTempDir()581 self.useTempDir()
583 # Avoid leaking local user configuration into tests.582 # Avoid leaking local user configuration into tests.
584 old_bzr_home = os.environ.get('BZR_HOME')583 self.useContext(override_environ(
585 def restore_bzr_home():584 BZR_HOME=os.getcwd(), BZR_EMAIL=None, EMAIL=None,
586 if old_bzr_home is None:585 ))
587 del os.environ['BZR_HOME']
588 else:
589 os.environ['BZR_HOME'] = old_bzr_home
590 os.environ['BZR_HOME'] = os.getcwd()
591 self.addCleanup(restore_bzr_home)
592586
593 def useBzrBranches(self, direct_database=False):587 def useBzrBranches(self, direct_database=False):
594 """Prepare for using bzr branches.588 """Prepare for using bzr branches.
595589
=== modified file 'lib/lp/translations/scripts/translations_to_branch.py'
--- lib/lp/translations/scripts/translations_to_branch.py 2010-06-16 07:22:57 +0000
+++ lib/lp/translations/scripts/translations_to_branch.py 2010-08-17 04:46:45 +0000
@@ -103,22 +103,16 @@
103 # possible again to commit to these branches at some point.103 # possible again to commit to these branches at some point.
104 # When that happens, remove this workaround and just call104 # When that happens, remove this workaround and just call
105 # _makeDirectBranchCommit directly.105 # _makeDirectBranchCommit directly.
106 committer = self._makeDirectBranchCommit(db_branch)106 if db_branch.stacked_on:
107 if not db_branch.stacked_on:107 bzrbranch = db_branch.getBzrBranch()
108 # The normal case.108 self.logger.info("Unstacking branch to work around bug 375013.")
109 return committer109 bzrbranch.set_stacked_on_url(None)
110110 self.logger.info("Done unstacking branch.")
111 self.logger.info("Unstacking branch to work around bug 375013.")111
112 try:112 # This may have taken a while, so commit for good
113 committer.bzrbranch.set_stacked_on_url(None)113 # manners.
114 finally:114 if self.txn:
115 committer.unlock()115 self.txn.commit()
116 self.logger.info("Done unstacking branch.")
117
118 # This may have taken a while, so commit for good
119 # manners.
120 if self.txn:
121 self.txn.commit()
122116
123 return self._makeDirectBranchCommit(db_branch)117 return self._makeDirectBranchCommit(db_branch)
124118
125119
=== modified file 'lib/lp/translations/tests/test_rosetta_branches_script.py'
--- lib/lp/translations/tests/test_rosetta_branches_script.py 2010-04-23 09:36:47 +0000
+++ lib/lp/translations/tests/test_rosetta_branches_script.py 2010-08-17 04:46:45 +0000
@@ -7,6 +7,8 @@
7provisions to handle Bazaar branches.7provisions to handle Bazaar branches.
8"""8"""
99
10from __future__ import with_statement
11
10__metaclass__ = type12__metaclass__ = type
1113
12from unittest import TestLoader14from unittest import TestLoader
@@ -23,6 +25,7 @@
23 ITranslationImportQueue, RosettaImportStatus)25 ITranslationImportQueue, RosettaImportStatus)
24from canonical.launchpad.scripts.tests import run_script26from canonical.launchpad.scripts.tests import run_script
25from lp.testing import TestCaseWithFactory27from lp.testing import TestCaseWithFactory
28from lp.services.osutils import override_environ
26from canonical.launchpad.webapp.errorlog import globalErrorUtility29from canonical.launchpad.webapp.errorlog import globalErrorUtility
2730
28class TestRosettaBranchesScript(TestCaseWithFactory):31class TestRosettaBranchesScript(TestCaseWithFactory):
@@ -43,7 +46,10 @@
43 branch, tree = self.create_branch_and_tree()46 branch, tree = self.create_branch_and_tree()
44 tree.bzrdir.root_transport.put_bytes(pot_path, pot_content)47 tree.bzrdir.root_transport.put_bytes(pot_path, pot_content)
45 tree.add(pot_path)48 tree.add(pot_path)
46 revision_id = tree.commit("first commit")49 # XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
50 # required to generate the revision-id.
51 with override_environ(BZR_EMAIL='me@example.com'):
52 revision_id = tree.commit("first commit")
47 branch.last_scanned_id = revision_id53 branch.last_scanned_id = revision_id
48 branch.last_mirrored_id = revision_id54 branch.last_mirrored_id = revision_id
49 series = self.factory.makeProductSeries()55 series = self.factory.makeProductSeries()
5056
=== modified file 'utilities/sourcedeps.conf'
--- utilities/sourcedeps.conf 2010-08-16 15:00:28 +0000
+++ utilities/sourcedeps.conf 2010-08-17 04:46:45 +0000
@@ -1,7 +1,7 @@
1bzr-builder lp:~launchpad-pqm/bzr-builder/trunk;revno=651bzr-builder lp:~launchpad-pqm/bzr-builder/trunk;revno=65
2bzr-git lp:~launchpad-pqm/bzr-git/devel;revno=2572bzr-git lp:~launchpad-pqm/bzr-git/devel;revno=257
3bzr-hg lp:~launchpad-pqm/bzr-hg/devel;revno=2813bzr-hg lp:~launchpad-pqm/bzr-hg/devel;revno=282
4bzr-loom lp:~launchpad-pqm/bzr-loom/trunk;revno=474bzr-loom lp:~launchpad-pqm/bzr-loom/trunk;revno=48
5bzr-svn lp:~launchpad-pqm/bzr-svn/devel;revno=27095bzr-svn lp:~launchpad-pqm/bzr-svn/devel;revno=2709
6cscvs lp:~launchpad-pqm/launchpad-cscvs/devel;revno=4326cscvs lp:~launchpad-pqm/launchpad-cscvs/devel;revno=432
7dulwich lp:~launchpad-pqm/dulwich/devel;revno=4237dulwich lp:~launchpad-pqm/dulwich/devel;revno=423
88
=== modified file 'versions.cfg'
--- versions.cfg 2010-08-06 16:52:08 +0000
+++ versions.cfg 2010-08-17 04:46:45 +0000
@@ -5,7 +5,7 @@
5# Alphabetical, case-insensitive, please! :-)5# Alphabetical, case-insensitive, please! :-)
66
7ampoule = 0.2.07ampoule = 0.2.0
8bzr = 2.1.08bzr = 2.2.0
9chameleon.core = 1.0b359chameleon.core = 1.0b35
10chameleon.zpt = 1.0b1710chameleon.zpt = 1.0b17
11ClientForm = 0.2.1011ClientForm = 0.2.10