~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-12-20 16:16:34 UTC
  • mfrom: (3123.5.18 hardlinks)
  • Revision ID: pqm@pqm.ubuntu.com-20071220161634-2kcjb650o21ydko4
Accelerate build_tree using similar workingtrees (abentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import sys
22
22
 
23
23
from bzrlib.branch import Branch
24
 
from bzrlib.directory_service import directories
25
24
from bzrlib.osutils import pathjoin
26
25
from bzrlib.tests.blackbox import ExternalBase
27
26
from bzrlib.uncommit import uncommit
306
305
        self.assertContainsRe(out, 'bar')
307
306
        self.assertNotContainsRe(out, 'added:')
308
307
        self.assertNotContainsRe(out, 'foo')
309
 
 
310
 
    def test_pull_quiet(self):
311
 
        """Check that bzr pull --quiet does not print anything"""
312
 
        tree_a = self.make_branch_and_tree('tree_a')
313
 
        self.build_tree(['tree_a/foo'])
314
 
        tree_a.add('foo')
315
 
        revision_id = tree_a.commit('bar')
316
 
        tree_b = tree_a.bzrdir.sprout('tree_b').open_workingtree()
317
 
        out, err = self.run_bzr('pull --quiet -d tree_b')
318
 
        self.assertEqual(out, '')
319
 
        self.assertEqual(err, '')
320
 
        self.assertEqual(tree_b.last_revision(), revision_id)
321
 
        self.build_tree(['tree_a/moo'])
322
 
        tree_a.add('moo')
323
 
        revision_id = tree_a.commit('quack')
324
 
        out, err = self.run_bzr('pull --quiet -d tree_b')
325
 
        self.assertEqual(out, '')
326
 
        self.assertEqual(err, '')
327
 
        self.assertEqual(tree_b.last_revision(), revision_id)
328
 
 
329
 
    def test_pull_from_directory_service(self):
330
 
        source = self.make_branch_and_tree('source')
331
 
        source.commit('commit 1')
332
 
        target = source.bzrdir.sprout('target').open_workingtree()
333
 
        source_last = source.commit('commit 2')
334
 
        class FooService(object):
335
 
            """A directory service that always returns source"""
336
 
 
337
 
            def look_up(self, name, url):
338
 
                return 'source'
339
 
        directories.register('foo:', FooService, 'Testing directory service')
340
 
        self.addCleanup(lambda: directories.remove('foo:'))
341
 
        self.run_bzr('pull foo:bar -d target')
342
 
        self.assertEqual(source_last, target.last_revision())