~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_status.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-07-23 15:55:12 UTC
  • mfrom: (1551.15.59 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20070723155512-ckelzx8u6m5vxyja
Test that default behavior is as before

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
import sys
29
29
from tempfile import TemporaryFile
30
30
 
31
 
from bzrlib import bzrdir, errors
 
31
from bzrlib import (
 
32
    bzrdir,
 
33
    conflicts,
 
34
    errors,
 
35
    )
32
36
import bzrlib.branch
33
37
from bzrlib.builtins import merge
34
38
from bzrlib.osutils import pathjoin
227
231
        tof.seek(0)
228
232
        self.assertEquals(tof.readlines(), ['?   dir2/\n'])
229
233
 
 
234
    def test_specific_files_conflicts(self):
 
235
        tree = self.make_branch_and_tree('.')
 
236
        self.build_tree(['dir2/'])
 
237
        tree.add('dir2')
 
238
        tree.commit('added dir2')
 
239
        tree.set_conflicts(conflicts.ConflictList(
 
240
            [conflicts.ContentsConflict('foo')]))
 
241
        tof = StringIO()
 
242
        show_tree_status(tree, specific_files=['dir2'], to_file=tof)
 
243
        self.assertEqualDiff('', tof.getvalue())
 
244
        tree.set_conflicts(conflicts.ConflictList(
 
245
            [conflicts.ContentsConflict('dir2')]))
 
246
        tof = StringIO()
 
247
        show_tree_status(tree, specific_files=['dir2'], to_file=tof)
 
248
        self.assertEqualDiff('conflicts:\n  Contents conflict in dir2\n',
 
249
                             tof.getvalue())
 
250
 
 
251
        tree.set_conflicts(conflicts.ConflictList(
 
252
            [conflicts.ContentsConflict('dir2/file1')]))
 
253
        tof = StringIO()
 
254
        show_tree_status(tree, specific_files=['dir2'], to_file=tof)
 
255
        self.assertEqualDiff('conflicts:\n  Contents conflict in dir2/file1\n',
 
256
                             tof.getvalue())
 
257
 
230
258
    def test_status_nonexistent_file(self):
231
259
        # files that don't exist in either the basis tree or working tree
232
260
        # should give an error