~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-04-26 15:39:04 UTC
  • mfrom: (2456.2.6 rename_iter_changes_109993)
  • Revision ID: pqm@pqm.ubuntu.com-20070426153904-l91p9ybsqpxt2vyv
(John Arbash Meinel) Fix bug #109993 by fixing _iter_changes to not sync an on-disk file with an 'absent' dirblock record.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib import (
28
28
    branch as _mod_branch,
29
29
    bzrdir,
30
 
    config,
31
30
    errors,
32
 
    trace,
33
31
    urlutils,
34
32
    )
35
33
from bzrlib.branch import (
283
281
    def test_light_checkout_with_references(self):
284
282
        self.do_checkout_test(lightweight=True)
285
283
 
286
 
    def test_set_push(self):
287
 
        branch = self.make_branch('source', format='dirstate-tags')
288
 
        branch.get_config().set_user_option('push_location', 'old',
289
 
            store=config.STORE_LOCATION)
290
 
        warnings = []
291
 
        def warning(*args):
292
 
            warnings.append(args[0] % args[1:])
293
 
        _warning = trace.warning
294
 
        trace.warning = warning
295
 
        try:
296
 
            branch.set_push_location('new')
297
 
        finally:
298
 
            trace.warning = _warning
299
 
        self.assertEqual(warnings[0], 'Value "new" is masked by "old" from '
300
 
                         'locations.conf')
301
 
 
302
284
class TestBranchReference(TestCaseWithTransport):
303
285
    """Tests for the branch reference facility."""
304
286
 
344
326
        # the installed hooks are saved in self._preserved_hooks.
345
327
        self.assertIsInstance(self._preserved_hooks[_mod_branch.Branch], BranchHooks)
346
328
 
 
329
    def test_install_hook_raises_unknown_hook(self):
 
330
        """install_hook should raise UnknownHook if a hook is unknown."""
 
331
        hooks = BranchHooks()
 
332
        self.assertRaises(UnknownHook, hooks.install_hook, 'silly', None)
 
333
 
 
334
    def test_install_hook_appends_known_hook(self):
 
335
        """install_hook should append the callable for known hooks."""
 
336
        hooks = BranchHooks()
 
337
        hooks.install_hook('set_rh', None)
 
338
        self.assertEqual(hooks['set_rh'], [None])
 
339
 
347
340
 
348
341
class TestPullResult(TestCase):
349
342