Merge lp:~jelmer/brz/merge-modified 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/merge-modified
Merge into: lp:brz
Diff against target: 61 lines (+22/-5)
3 files modified
breezy/merge.py (+4/-1)
breezy/tests/per_workingtree/test_workingtree.py (+14/-3)
breezy/transform.py (+4/-1)
To merge this branch: bzr merge lp:~jelmer/brz/merge-modified
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+339727@code.launchpad.net

Commit message

Allow working trees to not implement set_merge_modified.

Description of the change

Allow working trees to not implement set_merge_modified.

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

Seems fine, but see inline notes for queries.

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/merge.py'
--- breezy/merge.py 2017-11-13 22:51:34 +0000
+++ breezy/merge.py 2018-02-26 23:17:11 +0000
@@ -1080,7 +1080,10 @@
1080 if hash is None:1080 if hash is None:
1081 continue1081 continue
1082 modified_hashes[file_id] = hash1082 modified_hashes[file_id] = hash
1083 self.working_tree.set_merge_modified(modified_hashes)1083 try:
1084 self.working_tree.set_merge_modified(modified_hashes)
1085 except errors.UnsupportedOperation:
1086 pass # Well, whatever.
10841087
1085 @staticmethod1088 @staticmethod
1086 def parent(entry, file_id):1089 def parent(entry, file_id):
10871090
=== modified file 'breezy/tests/per_workingtree/test_workingtree.py'
--- breezy/tests/per_workingtree/test_workingtree.py 2018-02-21 20:07:48 +0000
+++ breezy/tests/per_workingtree/test_workingtree.py 2018-02-26 23:17:11 +0000
@@ -711,11 +711,22 @@
711 with tree.lock_write():711 with tree.lock_write():
712 tree.add(['somefile'])712 tree.add(['somefile'])
713 d = {tree.path2id('somefile'): osutils.sha_string('hello')}713 d = {tree.path2id('somefile'): osutils.sha_string('hello')}
714 tree.set_merge_modified(d)714 try:
715 tree.set_merge_modified(d)
716 except errors.UnsupportedOperation:
717 mm = tree.merge_modified()
718 self.assertEqual(mm, {})
719 supports_merge_modified = False
720 else:
721 mm = tree.merge_modified()
722 self.assertEqual(mm, d)
723 supports_merge_modified = True
724 if supports_merge_modified:
715 mm = tree.merge_modified()725 mm = tree.merge_modified()
716 self.assertEqual(mm, d)726 self.assertEqual(mm, d)
717 mm = tree.merge_modified()727 else:
718 self.assertEqual(mm, d)728 mm = tree.merge_modified()
729 self.assertEqual(mm, {})
719730
720 def test_conflicts(self):731 def test_conflicts(self):
721 from breezy.tests.test_conflicts import example_conflicts732 from breezy.tests.test_conflicts import example_conflicts
722733
=== modified file 'breezy/transform.py'
--- breezy/transform.py 2018-01-12 08:52:43 +0000
+++ breezy/transform.py 2018-02-26 23:17:11 +0000
@@ -2874,7 +2874,10 @@
2874 trace.warning(unicode(conflict))2874 trace.warning(unicode(conflict))
2875 pp.next_phase()2875 pp.next_phase()
2876 tt.apply()2876 tt.apply()
2877 working_tree.set_merge_modified(merge_modified)2877 try:
2878 working_tree.set_merge_modified(merge_modified)
2879 except errors.UnsupportedOperation:
2880 pass # well, whatever.
2878 finally:2881 finally:
2879 target_tree.unlock()2882 target_tree.unlock()
2880 tt.finalize()2883 tt.finalize()

Subscribers

People subscribed via source and target branches