launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #26230
[Merge] ~cjwatson/launchpad:py3-breezy-revid-bytes into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:py3-breezy-revid-bytes into launchpad:master.
Commit message:
Pass Breezy revision IDs as bytes
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/397587
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-breezy-revid-bytes into launchpad:master.
diff --git a/lib/lp/code/model/tests/test_branchjob.py b/lib/lp/code/model/tests/test_branchjob.py
index a6266e9..821e3a1 100644
--- a/lib/lp/code/model/tests/test_branchjob.py
+++ b/lib/lp/code/model/tests/test_branchjob.py
@@ -579,7 +579,7 @@ class TestRevisionsAddedJob(TestCaseWithFactory):
self.addCleanup(job.bzr_branch.unlock)
self.assertEqual(
set([b'rev2a-id', b'rev3-id', b'rev2b-id', b'rev2c-id']),
- job.getMergedRevisionIDs('rev2d-id', graph))
+ job.getMergedRevisionIDs(b'rev2d-id', graph))
def test_findRelatedBMP(self):
"""The related branch merge proposals can be identified."""
diff --git a/lib/lp/code/scripts/tests/test_scan_branches.py b/lib/lp/code/scripts/tests/test_scan_branches.py
index a8a09ab..91b77b1 100644
--- a/lib/lp/code/scripts/tests/test_scan_branches.py
+++ b/lib/lp/code/scripts/tests/test_scan_branches.py
@@ -40,9 +40,9 @@ class TestScanBranches(TestCaseWithFactory):
# XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
# required to generate the revision-id.
with override_environ(BRZ_EMAIL='me@xxxxxxxxxxx'):
- target_tree.commit('First commit', rev_id='rev1')
- target_tree.commit('Second commit', rev_id='rev2')
- target_tree.commit('Third commit', rev_id='rev3')
+ target_tree.commit('First commit', rev_id=b'rev1')
+ target_tree.commit('Second commit', rev_id=b'rev2')
+ target_tree.commit('Third commit', rev_id=b'rev3')
BranchScanJob.create(db_branch)
transaction.commit()
diff --git a/lib/lp/code/scripts/tests/test_sendbranchmail.py b/lib/lp/code/scripts/tests/test_sendbranchmail.py
index 30cecae..6e595b1 100644
--- a/lib/lp/code/scripts/tests/test_sendbranchmail.py
+++ b/lib/lp/code/scripts/tests/test_sendbranchmail.py
@@ -38,7 +38,7 @@ class TestSendbranchmail(TestCaseWithFactory):
# XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
# required to generate the revision-id.
with override_environ(BRZ_EMAIL='me@xxxxxxxxxxx'):
- tree.commit('Added foo.', rev_id='rev1')
+ tree.commit('Added foo.', rev_id=b'rev1')
return branch, tree
def test_sendbranchmail(self):
@@ -69,7 +69,7 @@ class TestSendbranchmail(TestCaseWithFactory):
# XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
# required to generate the revision-id.
with override_environ(BRZ_EMAIL='me@xxxxxxxxxxx'):
- tree.commit('Added foo.', rev_id='rev2')
+ tree.commit('Added foo.', rev_id=b'rev2')
job = RevisionsAddedJob.create(
branch, 'rev1', 'rev2', 'from@xxxxxxxxxxx')
transaction.commit()
diff --git a/lib/lp/codehosting/scanner/tests/test_buglinks.py b/lib/lp/codehosting/scanner/tests/test_buglinks.py
index aa220e9..a2286ac 100644
--- a/lib/lp/codehosting/scanner/tests/test_buglinks.py
+++ b/lib/lp/codehosting/scanner/tests/test_buglinks.py
@@ -147,7 +147,7 @@ class TestBugLinking(BzrSyncTestCase):
def test_newMainlineRevisionAddsBugBranch(self):
"""New mainline revisions with bugs properties create BugBranches."""
self.commitRevision(
- rev_id='rev1',
+ rev_id=b'rev1',
revprops={'bugs': '%s fixed' % self.getBugURL(self.bug1)})
self.syncBazaarBranchToDatabase(self.bzr_branch, self.db_branch)
self.assertBugBranchLinked(self.bug1, self.db_branch)
@@ -155,7 +155,7 @@ class TestBugLinking(BzrSyncTestCase):
def test_scanningTwiceDoesntMatter(self):
"""Scanning a branch twice is the same as scanning it once."""
self.commitRevision(
- rev_id='rev1',
+ rev_id=b'rev1',
revprops={'bugs': '%s fixed' % self.getBugURL(self.bug1)})
self.syncBazaarBranchToDatabase(self.bzr_branch, self.db_branch)
self.syncBazaarBranchToDatabase(self.bzr_branch, self.db_branch)
@@ -172,7 +172,7 @@ class TestBugLinking(BzrSyncTestCase):
# We can link a bug to an official package branch. Test added to catch
# bug 391303.
self.commitRevision(
- rev_id='rev1',
+ rev_id=b'rev1',
revprops={'bugs': '%s fixed' % self.getBugURL(self.bug1)})
branch = self.makePackageBranch()
self.syncBazaarBranchToDatabase(self.bzr_branch, branch)
@@ -181,7 +181,7 @@ class TestBugLinking(BzrSyncTestCase):
def test_knownMainlineRevisionsDoesntMakeLink(self):
"""Don't add BugBranches for known mainline revision."""
self.commitRevision(
- rev_id='rev1',
+ rev_id=b'rev1',
revprops={'bugs': '%s fixed' % self.getBugURL(self.bug1)})
self.syncBazaarBranchToDatabase(self.bzr_branch, self.db_branch)
# Create a new DB branch to sync with.
@@ -196,7 +196,7 @@ class TestBugLinking(BzrSyncTestCase):
# required to generate the revision-id.
with override_environ(BRZ_EMAIL='me@xxxxxxxxxxx'):
self.bzr_tree.commit(
- u'common parent', committer=author, rev_id='r1',
+ u'common parent', committer=author, rev_id=b'r1',
allow_pointless=True)
# Branch from the base revision.
@@ -205,17 +205,17 @@ class TestBugLinking(BzrSyncTestCase):
# Commit to both branches
self.bzr_tree.commit(
- u'commit one', committer=author, rev_id='r2',
+ u'commit one', committer=author, rev_id=b'r2',
allow_pointless=True)
new_tree.commit(
- u'commit two', committer=author, rev_id='r1.1.1',
+ u'commit two', committer=author, rev_id=b'r1.1.1',
allow_pointless=True,
revprops={'bugs': '%s fixed' % self.getBugURL(self.bug1)})
# Merge and commit.
self.bzr_tree.merge_from_branch(new_tree.branch)
self.bzr_tree.commit(
- u'merge', committer=author, rev_id='r3',
+ u'merge', committer=author, rev_id=b'r3',
allow_pointless=True)
self.syncBazaarBranchToDatabase(self.bzr_branch, self.db_branch)
@@ -226,7 +226,7 @@ class TestBugLinking(BzrSyncTestCase):
self.assertRaises(NotFoundError, getUtility(IBugSet).get, 99999)
self.assertEqual([], list(self.db_branch.linked_bugs))
self.commitRevision(
- rev_id='rev1',
+ rev_id=b'rev1',
revprops={'bugs': 'https://launchpad.net/bugs/99999 fixed'})
self.syncBazaarBranchToDatabase(self.bzr_branch, self.db_branch)
self.assertEqual([], list(self.db_branch.linked_bugs))
@@ -234,7 +234,7 @@ class TestBugLinking(BzrSyncTestCase):
def test_multipleBugsInProperty(self):
"""Create BugBranch links for *all* bugs in the property."""
self.commitRevision(
- rev_id='rev1',
+ rev_id=b'rev1',
revprops={'bugs': '%s fixed\n%s fixed' % (
self.getBugURL(self.bug1), self.getBugURL(self.bug2))})
self.syncBazaarBranchToDatabase(self.bzr_branch, self.db_branch)
diff --git a/lib/lp/codehosting/scanner/tests/test_bzrsync.py b/lib/lp/codehosting/scanner/tests/test_bzrsync.py
index 83f8e65..3c49360 100644
--- a/lib/lp/codehosting/scanner/tests/test_bzrsync.py
+++ b/lib/lp/codehosting/scanner/tests/test_bzrsync.py
@@ -392,9 +392,9 @@ class TestBzrSync(BzrSyncTestCase):
def test_timestamp_parsing(self):
# Test that the timezone selected does not affect the
# timestamp recorded in the database.
- self.commitRevision(rev_id='rev-1',
+ self.commitRevision(rev_id=b'rev-1',
timestamp=1000000000.0, timezone=0)
- self.commitRevision(rev_id='rev-2',
+ self.commitRevision(rev_id=b'rev-2',
timestamp=1000000000.0, timezone=28800)
self.syncAndCount(
new_revisions=2, new_numbers=2, new_parents=1, new_authors=2)
@@ -478,7 +478,7 @@ class TestBzrSync(BzrSyncTestCase):
def test_revisionsToInsert_linear(self):
# If the branch has a linear ancestry, revisionsToInsert() should
# yield each revision along with a sequence number, starting at 1.
- self.commitRevision(rev_id='rev-1')
+ self.commitRevision(rev_id=b'rev-1')
bzrsync = self.makeBzrSync(self.db_branch)
bzr_history = branch_revision_history(self.bzr_branch)
added_ancestry = bzrsync.getAncestryDelta(self.bzr_branch)[0]
@@ -822,7 +822,7 @@ class TestRevisionProperty(BzrSyncTestCase):
# Revisions with properties should have records stored in the
# RevisionProperty table, accessible through Revision.getProperties().
properties = {'name': 'value'}
- self.commitRevision(rev_id='rev1', revprops=properties)
+ self.commitRevision(rev_id=b'rev1', revprops=properties)
self.makeBzrSync(self.db_branch).syncBranchAndClose()
# Check that properties were saved to the revision.
bzr_revision = self.bzr_branch.repository.get_revision('rev1')
diff --git a/lib/lp/codehosting/scanner/tests/test_mergedetection.py b/lib/lp/codehosting/scanner/tests/test_mergedetection.py
index 75775a2..34202df 100644
--- a/lib/lp/codehosting/scanner/tests/test_mergedetection.py
+++ b/lib/lp/codehosting/scanner/tests/test_mergedetection.py
@@ -146,7 +146,7 @@ class TestAutoMergeDetectionForMergeProposals(BzrSyncTestCase):
# XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
# required to generate the revision-id.
with override_environ(BRZ_EMAIL='me@xxxxxxxxxxx'):
- branch_tree.commit(u'another revision', rev_id='another-rev')
+ branch_tree.commit(u'another revision', rev_id=b'another-rev')
current_proposal_status = proposal.queue_status
self.assertNotEqual(
current_proposal_status,
@@ -167,7 +167,7 @@ class TestAutoMergeDetectionForMergeProposals(BzrSyncTestCase):
# XXX: AaronBentley 2010-08-06 bug=614404: a bzr username is
# required to generate the revision-id.
with override_environ(BRZ_EMAIL='me@xxxxxxxxxxx'):
- branch_tree.commit(u'another revision', rev_id='another-rev')
+ branch_tree.commit(u'another revision', rev_id=b'another-rev')
current_proposal_status = proposal.queue_status
self.assertNotEqual(
current_proposal_status,
diff --git a/lib/lp/codehosting/tests/helpers.py b/lib/lp/codehosting/tests/helpers.py
index 81fbea1..1104782 100644
--- a/lib/lp/codehosting/tests/helpers.py
+++ b/lib/lp/codehosting/tests/helpers.py
@@ -61,7 +61,7 @@ class LoomTestMixin:
loom_tree = tree.controldir.open_workingtree()
loom_tree.lock_write()
loom_tree.branch.new_thread('bottom-thread')
- loom_tree.commit('this is a commit', rev_id='commit-1')
+ loom_tree.commit('this is a commit', rev_id=b'commit-1')
loom_tree.unlock()
loom_tree.branch.record_loom('sample loom')
self.get_transport().delete_tree('checkout')
@@ -79,7 +79,7 @@ class LoomTestMixin:
loom_tree = tree.controldir.open_workingtree()
loom_tree.lock_write()
loom_tree.branch.new_thread('bottom-thread')
- loom_tree.commit('this is a commit', rev_id='commit-1')
+ loom_tree.commit('this is a commit', rev_id=b'commit-1')
loom_tree.unlock()
loom_tree.branch.record_loom('sample loom')
return loom_tree
diff --git a/lib/lp/codehosting/tests/test_acceptance.py b/lib/lp/codehosting/tests/test_acceptance.py
index f9df88c..cf8dd34 100644
--- a/lib/lp/codehosting/tests/test_acceptance.py
+++ b/lib/lp/codehosting/tests/test_acceptance.py
@@ -367,7 +367,7 @@ class AcceptanceTests(WithScenarios, SSHTestCase):
self.assertEqual(self.revid, remote_revision)
# Add a single revision to the local branch.
tree = WorkingTree.open(self.local_branch.base)
- tree.commit('Empty commit', rev_id='rev2')
+ tree.commit('Empty commit', rev_id=b'rev2')
# Push the new revision.
self.push(self.local_branch_path, remote_url)
self.assertBranchesMatch(self.local_branch_path, remote_url)
@@ -615,7 +615,7 @@ class SmartserverTests(WithScenarios, SSHTestCase):
# Create a new revision on the local branch.
tree = WorkingTree.open(self.local_branch.base)
- tree.commit('Empty commit', rev_id='rev2')
+ tree.commit('Empty commit', rev_id=b'rev2')
# Push the local branch to the remote url
remote_url = self.getTransportURL('~mark/+junk/ro-branch')
diff --git a/lib/lp/codehosting/tests/test_upgrade.py b/lib/lp/codehosting/tests/test_upgrade.py
index 775a179..ae8ef77 100644
--- a/lib/lp/codehosting/tests/test_upgrade.py
+++ b/lib/lp/codehosting/tests/test_upgrade.py
@@ -48,7 +48,7 @@ class TestUpgrader(TestCaseWithFactory):
self.useBzrBranches(direct_database=True)
branch, tree = self.create_branch_and_tree(format=format)
tree.commit(
- 'foo', rev_id='prepare-commit', committer='jrandom@xxxxxxxxxxx')
+ 'foo', rev_id=b'prepare-commit', committer='jrandom@xxxxxxxxxxx')
if loomify_branch:
loomify(tree.branch)
bzr_branch = tree.controldir.open_branch()