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

lp:~jelmer/brz/merge-modified updated
6867. By Jelmer Vernooij

Fix walkdirs tests for formats without versioned directories.

Merged from https://code.launchpad.net/~jelmer/brz/walkdirs/+merge/339726

6868. By Jelmer Vernooij

Move Tree.plan_file_merge to InventoryTree.plan_file_merge.

Merged from https://code.launchpad.net/~jelmer/brz/plan-merge/+merge/339452

6869. By Jelmer Vernooij

Remove unused NoSuchIdInRepository exception.

Merged from https://code.launchpad.net/~jelmer/brz/no-such-repo/+merge/339451

6870. By Jelmer Vernooij

Make progress bars context managers.

Merged from https://code.launchpad.net/~jelmer/brz/pb-context/+merge/339449

6871. By Jelmer Vernooij

Make progress bars context managers.

Merged from https://code.launchpad.net/~jelmer/brz/pb-context/+merge/339449

6872. By Jelmer Vernooij

Allow working trees to not implement set_merge_modified.

Merged from https://code.launchpad.net/~jelmer/brz/merge-modified/+merge/339727

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/merge.py'
2--- breezy/merge.py 2017-11-13 22:51:34 +0000
3+++ breezy/merge.py 2018-02-26 23:17:11 +0000
4@@ -1080,7 +1080,10 @@
5 if hash is None:
6 continue
7 modified_hashes[file_id] = hash
8- self.working_tree.set_merge_modified(modified_hashes)
9+ try:
10+ self.working_tree.set_merge_modified(modified_hashes)
11+ except errors.UnsupportedOperation:
12+ pass # Well, whatever.
13
14 @staticmethod
15 def parent(entry, file_id):
16
17=== modified file 'breezy/tests/per_workingtree/test_workingtree.py'
18--- breezy/tests/per_workingtree/test_workingtree.py 2018-02-21 20:07:48 +0000
19+++ breezy/tests/per_workingtree/test_workingtree.py 2018-02-26 23:17:11 +0000
20@@ -711,11 +711,22 @@
21 with tree.lock_write():
22 tree.add(['somefile'])
23 d = {tree.path2id('somefile'): osutils.sha_string('hello')}
24- tree.set_merge_modified(d)
25+ try:
26+ tree.set_merge_modified(d)
27+ except errors.UnsupportedOperation:
28+ mm = tree.merge_modified()
29+ self.assertEqual(mm, {})
30+ supports_merge_modified = False
31+ else:
32+ mm = tree.merge_modified()
33+ self.assertEqual(mm, d)
34+ supports_merge_modified = True
35+ if supports_merge_modified:
36 mm = tree.merge_modified()
37 self.assertEqual(mm, d)
38- mm = tree.merge_modified()
39- self.assertEqual(mm, d)
40+ else:
41+ mm = tree.merge_modified()
42+ self.assertEqual(mm, {})
43
44 def test_conflicts(self):
45 from breezy.tests.test_conflicts import example_conflicts
46
47=== modified file 'breezy/transform.py'
48--- breezy/transform.py 2018-01-12 08:52:43 +0000
49+++ breezy/transform.py 2018-02-26 23:17:11 +0000
50@@ -2874,7 +2874,10 @@
51 trace.warning(unicode(conflict))
52 pp.next_phase()
53 tt.apply()
54- working_tree.set_merge_modified(merge_modified)
55+ try:
56+ working_tree.set_merge_modified(merge_modified)
57+ except errors.UnsupportedOperation:
58+ pass # well, whatever.
59 finally:
60 target_tree.unlock()
61 tt.finalize()

Subscribers

People subscribed via source and target branches