/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: Vincent Ladeuil
  • Date: 2019-06-18 11:21:15 UTC
  • mfrom: (7290.1.31 work)
  • mto: This revision was merged to the branch mainline in revision 7351.
  • Revision ID: v.ladeuil+brz@free.fr-20190618112115-578pnbegj3bnc6pa
Merge 3.0 resolving conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
from .. import (
36
36
    tests,
37
37
    )
 
38
from ...tests.script import TestCaseWithTransportAndScript
38
39
from ...tests.features import PluginLoadedFeature
39
40
 
40
41
 
212
213
        tree.add(['a'])
213
214
        output, error = self.run_bzr(['diff', '--format=git'], retcode=1)
214
215
        self.assertEqual(error, '')
215
 
        # Some older versions of Dulwich (< 0.19.12) formatted diffs slightly differently.
 
216
        # Some older versions of Dulwich (< 0.19.12) formatted diffs slightly
 
217
        # differently.
216
218
        from dulwich import __version__ as dulwich_version
217
219
        if dulwich_version < (0, 19, 12):
218
220
            self.assertEqual(output,
422
424
                self.assertEqual([], list(tree.iter_changes(basis_tree)))
423
425
 
424
426
 
 
427
class SwitchScriptTests(TestCaseWithTransportAndScript):
 
428
 
 
429
    def test_switch_preserves(self):
 
430
        # See https://bugs.launchpad.net/brz/+bug/1820606
 
431
        self.run_script("""
 
432
$ brz init --git r
 
433
Created a standalone tree (format: git)
 
434
$ cd r
 
435
$ echo original > file.txt
 
436
$ brz add
 
437
adding file.txt
 
438
$ brz ci -q -m "Initial"
 
439
$ echo "entered on master branch" > file.txt
 
440
$ brz stat
 
441
modified:
 
442
  file.txt
 
443
$ brz switch -b other
 
444
2>Tree is up to date at revision 1.
 
445
2>Switched to branch other
 
446
$ cat file.txt
 
447
entered on master branch
 
448
""")
 
449
 
 
450
 
425
451
class GrepTests(ExternalBase):
426
452
 
427
453
    def test_simple_grep(self):