/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/plugins/fastimport/tests/test_commands.py

  • Committer: Jelmer Vernooij
  • Date: 2019-05-29 03:28:14 UTC
  • mfrom: (7303 work)
  • mto: This revision was merged to the branch mainline in revision 7305.
  • Revision ID: jelmer@jelmer.uk-20190529032814-fzqbrgf9647u9ptq
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
        self.assertIsNot(b"bla", stream.read())
60
60
 
61
61
 
62
 
fast_export_baseline_data = """commit refs/heads/master
63
 
mark :1
64
 
committer
65
 
data 15
66
 
add c, remove b
67
 
M 644 inline a
68
 
data 13
69
 
test 1
70
 
test 3
71
 
M 644 inline c
72
 
data 6
73
 
test 4
 
62
fast_export_baseline_data1 = """reset refs/heads/master
 
63
commit refs/heads/master
 
64
mark :1
 
65
committer
 
66
data 15
 
67
add c, remove b
 
68
M 644 inline a
 
69
data 13
 
70
test 1
 
71
test 3
 
72
M 644 inline c
 
73
data 6
 
74
test 4
 
75
commit refs/heads/master
 
76
mark :2
 
77
committer
 
78
data 14
 
79
modify a again
 
80
from :1
 
81
M 644 inline a
 
82
data 20
 
83
test 1
 
84
test 3
 
85
test 5
 
86
commit refs/heads/master
 
87
mark :3
 
88
committer
 
89
data 5
 
90
add d
 
91
from :2
 
92
M 644 inline d
 
93
data 6
 
94
test 6
 
95
"""
 
96
 
 
97
 
 
98
fast_export_baseline_data2 = """reset refs/heads/master
 
99
commit refs/heads/master
 
100
mark :1
 
101
committer
 
102
data 15
 
103
add c, remove b
 
104
M 644 inline c
 
105
data 6
 
106
test 4
 
107
M 644 inline a
 
108
data 13
 
109
test 1
 
110
test 3
74
111
commit refs/heads/master
75
112
mark :2
76
113
committer
107
144
        tree.commit("pointless")
108
145
        data = self.run_bzr("fast-export br")[0]
109
146
        self.assertTrue(data.startswith(
110
 
            'commit refs/heads/master\nmark :1\ncommitter'))
 
147
            'reset refs/heads/master\n'
 
148
            'commit refs/heads/master\n'
 
149
            'mark :1\ncommitter'), data)
111
150
 
112
151
    def test_file(self):
113
152
        tree = self.make_branch_and_tree("br")
114
153
        tree.commit("pointless")
115
154
        data = self.run_bzr("fast-export br br.fi")[0]
116
155
        self.assertEquals("", data)
117
 
        try:
118
 
            self.assertPathExists("br.fi")
119
 
        except AttributeError:  # bzr < 2.4
120
 
            self.failUnlessExists("br.fi")
 
156
        self.assertPathExists("br.fi")
121
157
 
122
158
    def test_tag_rewriting(self):
123
159
        tree = self.make_branch_and_tree("br")
188
224
        # followed by the deltas for 4 and 5
189
225
        data = self.run_bzr("fast-export --baseline -r 3.. bl")[0]
190
226
        data = re.sub('committer.*', 'committer', data)
191
 
        self.assertEquals(fast_export_baseline_data, data)
 
227
        self.assertIn(data, (fast_export_baseline_data1, fast_export_baseline_data2))
192
228
 
193
229
        # Also confirm that --baseline with no args is identical to full export
194
230
        data1 = self.run_bzr("fast-export --baseline bl")[0]