/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 bzrlib/tests/blackbox/test_status.py

  • Committer: Robert Collins
  • Date: 2007-08-07 22:59:45 UTC
  • mfrom: (2681 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2682.
  • Revision ID: robertc@robertcollins.net-20070807225945-dlxppeb3we4lh897
Merge bzr.dev.

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
 
from bzrlib.builtins import merge
34
37
from bzrlib.osutils import pathjoin
35
38
from bzrlib.revisionspec import RevisionSpec
36
39
from bzrlib.status import show_tree_status
141
144
        b_2 = b_2_dir.open_branch()
142
145
        wt2 = b_2_dir.open_workingtree()
143
146
        wt.commit(u"\N{TIBETAN DIGIT TWO} Empty commit 2")
144
 
        merge(["./branch", -1], [None, None], this_dir = './copy')
 
147
        wt2.merge_from_branch(wt.branch)
145
148
        message = self.status_string(wt2)
146
149
        self.assertStartsWith(message, "pending merges:\n")
147
150
        self.assertEndsWith(message, "Empty commit 2\n")
149
152
        # must be long to make sure we see elipsis at the end
150
153
        wt.commit("Empty commit 3 " +
151
154
                   "blah blah blah blah " * 100)
152
 
        merge(["./branch", -1], [None, None], this_dir = './copy')
 
155
        wt2.merge_from_branch(wt.branch)
153
156
        message = self.status_string(wt2)
154
157
        self.assertStartsWith(message, "pending merges:\n")
155
158
        self.assert_("Empty commit 3" in message)
227
230
        tof.seek(0)
228
231
        self.assertEquals(tof.readlines(), ['?   dir2/\n'])
229
232
 
 
233
    def test_specific_files_conflicts(self):
 
234
        tree = self.make_branch_and_tree('.')
 
235
        self.build_tree(['dir2/'])
 
236
        tree.add('dir2')
 
237
        tree.commit('added dir2')
 
238
        tree.set_conflicts(conflicts.ConflictList(
 
239
            [conflicts.ContentsConflict('foo')]))
 
240
        tof = StringIO()
 
241
        show_tree_status(tree, specific_files=['dir2'], to_file=tof)
 
242
        self.assertEqualDiff('', tof.getvalue())
 
243
        tree.set_conflicts(conflicts.ConflictList(
 
244
            [conflicts.ContentsConflict('dir2')]))
 
245
        tof = StringIO()
 
246
        show_tree_status(tree, specific_files=['dir2'], to_file=tof)
 
247
        self.assertEqualDiff('conflicts:\n  Contents conflict in dir2\n',
 
248
                             tof.getvalue())
 
249
 
 
250
        tree.set_conflicts(conflicts.ConflictList(
 
251
            [conflicts.ContentsConflict('dir2/file1')]))
 
252
        tof = StringIO()
 
253
        show_tree_status(tree, specific_files=['dir2'], to_file=tof)
 
254
        self.assertEqualDiff('conflicts:\n  Contents conflict in dir2/file1\n',
 
255
                             tof.getvalue())
 
256
 
230
257
    def test_status_nonexistent_file(self):
231
258
        # files that don't exist in either the basis tree or working tree
232
259
        # should give an error