/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_merge_directive.py

  • Committer: Martin
  • Date: 2018-06-30 22:18:39 UTC
  • mfrom: (7010 work)
  • mto: This revision was merged to the branch mainline in revision 7012.
  • Revision ID: gzlist@googlemail.com-20180630221839-98zi78xwcggestse
Merge trunk to fix conflict

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    )
27
27
 
28
28
 
29
 
OUTPUT1 = """# Bazaar merge directive format 1
 
29
OUTPUT1 = b"""# Bazaar merge directive format 1
30
30
# revision_id: example:
31
31
# target_branch: http://example.com
32
32
# testament_sha1: sha
34
34
#\x20
35
35
booga"""
36
36
 
37
 
OUTPUT1_2 = """# Bazaar merge directive format 2 (Bazaar 0.90)
 
37
OUTPUT1_2 = b"""# Bazaar merge directive format 2 (Bazaar 0.90)
38
38
# revision_id: example:
39
39
# target_branch: http://example.com
40
40
# testament_sha1: sha
44
44
# Begin bundle
45
45
booga"""
46
46
 
47
 
OUTPUT2 = """# Bazaar merge directive format 1
 
47
OUTPUT2 = b"""# Bazaar merge directive format 1
48
48
# revision_id: example:
49
49
# target_branch: http://example.com
50
50
# testament_sha1: sha
54
54
#\x20
55
55
booga"""
56
56
 
57
 
OUTPUT2_2 = """# Bazaar merge directive format 2 (Bazaar 0.90)
 
57
OUTPUT2_2 = b"""# Bazaar merge directive format 2 (Bazaar 0.90)
58
58
# revision_id: example:
59
59
# target_branch: http://example.com
60
60
# testament_sha1: sha
66
66
# Begin patch
67
67
booga"""
68
68
 
69
 
INPUT1 = """
 
69
INPUT1 = b"""
70
70
I was thinking today about creating a merge directive.
71
71
 
72
72
So I did.
88
88
booga""".splitlines(True)
89
89
 
90
90
 
91
 
INPUT1_2 = """
 
91
INPUT1_2 = b"""
92
92
I was thinking today about creating a merge directive.
93
93
 
94
94
So I did.
112
112
booga""".splitlines(True)
113
113
 
114
114
 
115
 
INPUT1_2_OLD = """
 
115
INPUT1_2_OLD = b"""
116
116
I was thinking today about creating a merge directive.
117
117
 
118
118
So I did.
136
136
booga""".splitlines(True)
137
137
 
138
138
 
139
 
OLD_DIRECTIVE_2 = """# Bazaar merge directive format 2 (Bazaar 0.19)
 
139
OLD_DIRECTIVE_2 = b"""# Bazaar merge directive format 2 (Bazaar 0.19)
140
140
# revision_id: abentley@panoramicfeedback.com-20070807234458-\
141
141
#   nzhkoyza56lan7z5
142
142
# target_branch: http://panoramicfeedback.com/opensource/bzr/repo\
176
176
        timezone = 120
177
177
        md = self.make_merge_directive('example:', 'sha', time, timezone,
178
178
            'http://example.com', patch='booga', patch_type='bundle')
179
 
        self.assertEqualDiff(self.OUTPUT1, ''.join(md.to_lines()))
 
179
        self.assertEqualDiff(self.OUTPUT1, b''.join(md.to_lines()))
180
180
        md = self.make_merge_directive('example:', 'sha', time, timezone,
181
181
            'http://example.com', source_branch="http://example.org",
182
182
            patch='booga', patch_type='diff', message="Hi mom!")
183
 
        self.assertEqualDiff(self.OUTPUT2, ''.join(md.to_lines()))
 
183
        self.assertEqualDiff(self.OUTPUT2, b''.join(md.to_lines()))
184
184
 
185
185
    def test_deserialize_junk(self):
186
186
        time = 501