/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/git/tests/test_blackbox.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-16 02:23:42 UTC
  • mfrom: (7340 work)
  • mto: This revision was merged to the branch mainline in revision 7350.
  • Revision ID: jelmer@jelmer.uk-20190616022342-ihxzayq04x5culzd
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
212
212
        tree.add(['a'])
213
213
        output, error = self.run_bzr(['diff', '--format=git'], retcode=1)
214
214
        self.assertEqual(error, '')
215
 
        self.assertEqual(output,
216
 
                         'diff --git a/a b/a\n'
217
 
                         'old file mode 0\n'
218
 
                         'new file mode 100644\n'
219
 
                         'index 0000000..c197bd8 100644\n'
220
 
                         '--- /dev/null\n'
221
 
                         '+++ b/a\n'
222
 
                         '@@ -0,0 +1 @@\n'
223
 
                         '+contents of a\n')
 
215
        # Some older versions of Dulwich (< 0.19.12) formatted diffs slightly differently.
 
216
        from dulwich import __version__ as dulwich_version
 
217
        if dulwich_version < (0, 19, 12):
 
218
            self.assertEqual(output,
 
219
                             'diff --git /dev/null b/a\n'
 
220
                             'old mode 0\n'
 
221
                             'new mode 100644\n'
 
222
                             'index 0000000..c197bd8 100644\n'
 
223
                             '--- /dev/null\n'
 
224
                             '+++ b/a\n'
 
225
                             '@@ -0,0 +1 @@\n'
 
226
                             '+contents of a\n')
 
227
        else:
 
228
            self.assertEqual(output,
 
229
                             'diff --git a/a b/a\n'
 
230
                             'old file mode 0\n'
 
231
                             'new file mode 100644\n'
 
232
                             'index 0000000..c197bd8 100644\n'
 
233
                             '--- /dev/null\n'
 
234
                             '+++ b/a\n'
 
235
                             '@@ -0,0 +1 @@\n'
 
236
                             '+contents of a\n')
224
237
 
225
238
    def test_git_import_uncolocated(self):
226
239
        r = GitRepo.init("a", mkdir=True)