Merge lp:~jelmer/brz/wt-righthand-ghost-parents into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: Vincent Ladeuil
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/wt-righthand-ghost-parents
Merge into: lp:brz
Diff against target: 79 lines (+28/-9)
2 files modified
breezy/tests/per_workingtree/test_parents.py (+26/-9)
breezy/workingtree.py (+2/-0)
To merge this branch: bzr merge lp:~jelmer/brz/wt-righthand-ghost-parents
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+339496@code.launchpad.net

Commit message

Allow working tree formats to specify that they don't support righthand ghost parents.

Description of the change

Allow working tree formats to specify that they don't support righthand ghost parents.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Okay, fair enough.

review: Approve
Revision history for this message
Vincent Ladeuil (vila) wrote :

Running landing tests failed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'breezy/tests/per_workingtree/test_parents.py'
--- breezy/tests/per_workingtree/test_parents.py 2018-02-03 13:39:29 +0000
+++ breezy/tests/per_workingtree/test_parents.py 2018-02-25 15:43:15 +0000
@@ -102,9 +102,14 @@
102 # remove the tree's history102 # remove the tree's history
103 uncommit(t.branch, tree=t)103 uncommit(t.branch, tree=t)
104 rev_tree = t.branch.repository.revision_tree(revision_in_repo)104 rev_tree = t.branch.repository.revision_tree(revision_in_repo)
105 t.set_parent_trees([(revision_in_repo, rev_tree),105 if t._format.supports_righthand_parent_id_as_ghost:
106 ('another-missing', None)])106 t.set_parent_trees([(revision_in_repo, rev_tree),
107 self.assertConsistentParents([revision_in_repo, 'another-missing'], t)107 ('another-missing', None)])
108 self.assertConsistentParents([revision_in_repo, 'another-missing'], t)
109 else:
110 self.assertRaises(errors.GhostRevisionUnusableHere,
111 t.set_parent_trees, [(revision_in_repo, rev_tree),
112 ('another-missing', None)])
108113
109 def test_set_three_parents(self):114 def test_set_three_parents(self):
110 t = self.make_branch_and_tree('.')115 t = self.make_branch_and_tree('.')
@@ -154,8 +159,12 @@
154 # remove the tree's history159 # remove the tree's history
155 uncommit(t.branch, tree=t)160 uncommit(t.branch, tree=t)
156 rev_tree = t.branch.repository.revision_tree(revision_in_repo)161 rev_tree = t.branch.repository.revision_tree(revision_in_repo)
157 t.set_parent_ids([revision_in_repo, 'another-missing'])162 if t._format.supports_righthand_parent_id_as_ghost:
158 self.assertConsistentParents([revision_in_repo, 'another-missing'], t)163 t.set_parent_ids([revision_in_repo, 'another-missing'])
164 self.assertConsistentParents([revision_in_repo, 'another-missing'], t)
165 else:
166 self.assertRaises(errors.GhostRevisionUnusableHere,
167 t.set_parent_ids, [revision_in_repo, 'another-missing'])
159168
160 def test_set_three_parents_ids(self):169 def test_set_three_parents_ids(self):
161 t = self.make_branch_and_tree('.')170 t = self.make_branch_and_tree('.')
@@ -316,8 +325,12 @@
316 """Test adding the second parent id - as a ghost"""325 """Test adding the second parent id - as a ghost"""
317 tree = self.make_branch_and_tree('.')326 tree = self.make_branch_and_tree('.')
318 first_revision = tree.commit('first post')327 first_revision = tree.commit('first post')
319 tree.add_parent_tree_id('second')328 if tree._format.supports_righthand_parent_id_as_ghost:
320 self.assertConsistentParents([first_revision, 'second'], tree)329 tree.add_parent_tree_id('second')
330 self.assertConsistentParents([first_revision, 'second'], tree)
331 else:
332 self.assertRaises(errors.GhostRevisionUnusableHere,
333 tree.add_parent_tree_id, 'second')
321334
322 def test_add_first_parent_tree(self):335 def test_add_first_parent_tree(self):
323 """Test adding the first parent id"""336 """Test adding the first parent id"""
@@ -360,8 +373,12 @@
360 """Test adding the second parent id - as a ghost"""373 """Test adding the second parent id - as a ghost"""
361 tree = self.make_branch_and_tree('.')374 tree = self.make_branch_and_tree('.')
362 first_revision = tree.commit('first post')375 first_revision = tree.commit('first post')
363 tree.add_parent_tree(('second', None))376 if tree._format.supports_righthand_parent_id_as_ghost:
364 self.assertConsistentParents([first_revision, 'second'], tree)377 tree.add_parent_tree(('second', None))
378 self.assertConsistentParents([first_revision, 'second'], tree)
379 else:
380 self.assertRaises(errors.GhostRevisionUnusableHere,
381 tree.add_parent_tree, ('second', None))
365382
366383
367class UpdateToOneParentViaDeltaTests(TestCaseWithWorkingTree):384class UpdateToOneParentViaDeltaTests(TestCaseWithWorkingTree):
368385
=== modified file 'breezy/workingtree.py'
--- breezy/workingtree.py 2018-02-17 02:57:14 +0000
+++ breezy/workingtree.py 2018-02-25 15:43:15 +0000
@@ -1419,6 +1419,8 @@
14191419
1420 supports_leftmost_parent_id_as_ghost = True1420 supports_leftmost_parent_id_as_ghost = True
14211421
1422 supports_righthand_parent_id_as_ghost = True
1423
1422 def initialize(self, controldir, revision_id=None, from_branch=None,1424 def initialize(self, controldir, revision_id=None, from_branch=None,
1423 accelerator_tree=None, hardlink=False):1425 accelerator_tree=None, hardlink=False):
1424 """Initialize a new working tree in controldir.1426 """Initialize a new working tree in controldir.

Subscribers

People subscribed via source and target branches