~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree.py

  • Committer: Blake Winton
  • Date: 2007-10-16 16:02:01 UTC
  • mto: This revision was merged to the branch mainline in revision 2921.
  • Revision ID: bwinton@latte.ca-20071016160201-os2bci2ujf7in7an
Change 'print >> f,'s to 'f.write('s.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
        """See WorkingTreeFormat.get_format_string()."""
95
95
        return "Sample tree format."
96
96
 
97
 
    def initialize(self, a_bzrdir, revision_id=None, from_branch=None,
98
 
                   accelerator_tree=None):
 
97
    def initialize(self, a_bzrdir, revision_id=None):
99
98
        """Sample branches cannot be created."""
100
99
        t = a_bzrdir.get_workingtree_transport(self)
101
100
        t.put_bytes('format', self.get_format_string())
310
309
        self.assertEqual(['t', 'u', 't', 'u'], tree._locks)
311
310
 
312
311
 
313
 
class TestRevert(TestCaseWithTransport):
314
 
 
315
 
    def test_revert_conflicts_recursive(self):
316
 
        this_tree = self.make_branch_and_tree('this-tree')
317
 
        self.build_tree_contents([('this-tree/foo/',),
318
 
                                  ('this-tree/foo/bar', 'bar')])
319
 
        this_tree.add(['foo', 'foo/bar'])
320
 
        this_tree.commit('created foo/bar')
321
 
        other_tree = this_tree.bzrdir.sprout('other-tree').open_workingtree()
322
 
        self.build_tree_contents([('other-tree/foo/bar', 'baz')])
323
 
        other_tree.commit('changed bar')
324
 
        self.build_tree_contents([('this-tree/foo/bar', 'qux')])
325
 
        this_tree.commit('changed qux')
326
 
        this_tree.merge_from_branch(other_tree.branch)
327
 
        self.assertEqual(1, len(this_tree.conflicts()))
328
 
        this_tree.revert(['foo'])
329
 
        self.assertEqual(0, len(this_tree.conflicts()))
330
 
 
331
 
 
332
312
class TestAutoResolve(TestCaseWithTransport):
333
313
 
334
314
    def test_auto_resolve(self):
376
356
        file_conflict = conflicts.TextConflict('file', None, 'hello-id')
377
357
        tree.set_conflicts(conflicts.ConflictList([file_conflict]))
378
358
        tree.auto_resolve()
379
 
 
380
 
 
381
 
class TestFindTrees(TestCaseWithTransport):
382
 
 
383
 
    def test_find_trees(self):
384
 
        self.make_branch_and_tree('foo')
385
 
        self.make_branch_and_tree('foo/bar')
386
 
        # Sticking a tree inside a control dir is heinous, so let's skip it
387
 
        self.make_branch_and_tree('foo/.bzr/baz')
388
 
        self.make_branch('qux')
389
 
        trees = workingtree.WorkingTree.find_trees('.')
390
 
        self.assertEqual(2, len(list(trees)))