/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/blackbox/test_resolve.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-08 23:30:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6690.
  • Revision ID: jelmer@jelmer.uk-20170608233031-3qavls2o7a1pqllj
Update imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
    conflicts,
19
19
    tests,
20
20
    )
21
 
from breezy.tests import (
22
 
    script,
23
 
    KnownFailure,
24
 
    )
 
21
from breezy.tests import script
25
22
from breezy.tests.blackbox import test_conflicts
26
23
 
27
24
 
75
72
$ brz conflicts -d branch
76
73
""")
77
74
 
78
 
    def test_bug_842575_manual_rm(self):
79
 
        self.run_script("""\
80
 
$ brz init -q trunk
81
 
$ echo original > trunk/foo
82
 
$ brz add -q trunk/foo
83
 
$ brz commit -q -m first trunk
84
 
$ brz checkout -q trunk tree
85
 
$ brz rm -q trunk/foo
86
 
$ brz commit -q -m second trunk
87
 
$ echo modified > tree/foo
88
 
$ brz update tree
89
 
2>RM  foo => foo.THIS
90
 
2>Contents conflict in foo
91
 
2>1 conflicts encountered.
92
 
2>Updated to revision 2 of branch ...
93
 
$ rm tree/foo.BASE tree/foo.THIS
94
 
$ brz resolve --all -d tree
95
 
2>1 conflict resolved, 0 remaining
96
 
""")
97
 
        try:
98
 
            self.run_script("""\
99
 
$ brz status tree
100
 
""")
101
 
        except AssertionError:
102
 
            raise KnownFailure("bug #842575")
103
 
 
104
 
    def test_bug_842575_take_other(self):
105
 
        self.run_script("""\
106
 
$ brz init -q trunk
107
 
$ echo original > trunk/foo
108
 
$ brz add -q trunk/foo
109
 
$ brz commit -q -m first trunk
110
 
$ brz checkout -q --lightweight trunk tree
111
 
$ brz rm -q trunk/foo
112
 
$ brz ignore -d trunk foo
113
 
$ brz commit -q -m second trunk
114
 
$ echo modified > tree/foo
115
 
$ brz update tree
116
 
2>+N  .bzrignore
117
 
2>RM  foo => foo.THIS
118
 
2>Contents conflict in foo
119
 
2>1 conflicts encountered.
120
 
2>Updated to revision 2 of branch ...
121
 
$ brz resolve --take-other --all -d tree
122
 
2>1 conflict resolved, 0 remaining
123
 
""")
124
 
        try:
125
 
            self.run_script("""\
126
 
$ brz status tree
127
 
$ echo mustignore > tree/foo
128
 
$ brz status tree
129
 
""")
130
 
        except AssertionError:
131
 
            raise KnownFailure("bug 842575")
132
 
 
133
75
 
134
76
class TestBug788000(script.TestCaseWithTransportAndScript):
135
77
 
142
84
$ cd a
143
85
$ brz commit -m one
144
86
$ cd ..
145
 
$ brz branch a b
 
87
$ brz clone a b
146
88
$ echo bar > b/dir/file
147
89
$ cd a
148
90
$ rm -r dir
175
117
        """Text conflicts can be resolved automatically"""
176
118
        tree = self.make_branch_and_tree('tree')
177
119
        self.build_tree_contents([('tree/file',
178
 
                                   b'<<<<<<<\na\n=======\n>>>>>>>\n')])
179
 
        tree.add('file', b'file_id')
180
 
        self.assertEqual(tree.kind('file'), 'file')
181
 
        file_conflict = conflicts.TextConflict('file', file_id=b'file_id')
 
120
            '<<<<<<<\na\n=======\n>>>>>>>\n')])
 
121
        tree.add('file', 'file_id')
 
122
        self.assertEqual(tree.kind('file_id'), 'file')
 
123
        file_conflict = conflicts.TextConflict('file', file_id='file_id')
182
124
        tree.set_conflicts(conflicts.ConflictList([file_conflict]))
183
125
        note = self.run_bzr('resolve', retcode=1, working_dir='tree')[1]
184
126
        self.assertContainsRe(note, '0 conflicts auto-resolved.')
185
127
        self.assertContainsRe(note,
186
 
                              'Remaining conflicts:\nText conflict in file')
187
 
        self.build_tree_contents([('tree/file', b'a\n')])
 
128
            'Remaining conflicts:\nText conflict in file')
 
129
        self.build_tree_contents([('tree/file', 'a\n')])
188
130
        note = self.run_bzr('resolve', working_dir='tree')[1]
189
131
        self.assertContainsRe(note, 'All conflicts resolved.')