/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: 2018-11-16 23:15:15 UTC
  • mfrom: (7180 work)
  • mto: This revision was merged to the branch mainline in revision 7183.
  • Revision ID: jelmer@jelmer.uk-20181116231515-zqd2yn6kj8lfydyp
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
test 6
94
94
"""
95
95
 
 
96
 
96
97
class TestFastExport(ExternalBase):
97
98
 
98
99
    _test_needs_features = [FastimportFeature]
105
106
        tree = self.make_branch_and_tree("br")
106
107
        tree.commit("pointless")
107
108
        data = self.run_bzr("fast-export br")[0]
108
 
        self.assertTrue(data.startswith('commit refs/heads/master\nmark :1\ncommitter'))
 
109
        self.assertTrue(data.startswith(
 
110
            'commit refs/heads/master\nmark :1\ncommitter'))
109
111
 
110
112
    def test_file(self):
111
113
        tree = self.make_branch_and_tree("br")
114
116
        self.assertEquals("", data)
115
117
        try:
116
118
            self.assertPathExists("br.fi")
117
 
        except AttributeError: # bzr < 2.4
 
119
        except AttributeError:  # bzr < 2.4
118
120
            self.failUnlessExists("br.fi")
119
121
 
120
122
    def test_tag_rewriting(self):
128
130
        # first check --no-rewrite-tag-names
129
131
        data = self.run_bzr("fast-export --plain --no-rewrite-tag-names br")[0]
130
132
        self.assertNotEqual(-1, data.find("reset refs/tags/goodTag"))
131
 
        self.assertEqual(data.find("reset refs/tags/"), data.rfind("reset refs/tags/"))
 
133
        self.assertEqual(data.find("reset refs/tags/"),
 
134
                         data.rfind("reset refs/tags/"))
132
135
 
133
136
        # and now with --rewrite-tag-names
134
137
        data = self.run_bzr("fast-export --plain --rewrite-tag-names br")[0]
192
195
        data2 = self.run_bzr("fast-export bl")[0]
193
196
        self.assertEquals(data1, data2)
194
197
 
 
198
 
195
199
simple_fast_import_stream = b"""commit refs/heads/master
196
200
mark :1
197
201
committer Jelmer Vernooij <jelmer@samba.org> 1299718135 +0100
224
228
data 15
225
229
""")])
226
230
        self.make_branch_and_tree("br")
227
 
        self.run_bzr_error(['brz: ERROR: 4: Parse error: line 4: Command .*commit.* is missing section .*committer.*\n'], "fast-import empty.fi br")
228
 
 
 
231
        self.run_bzr_error(
 
232
            ['brz: ERROR: 4: Parse error: line 4: Command .*commit.* is missing section .*committer.*\n'], "fast-import empty.fi br")