~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/test_commit_builder.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-01-12 17:21:32 UTC
  • mfrom: (5557.1.18 2.3-commit-to-stacked)
  • Revision ID: pqm@pqm.ubuntu.com-20110112172132-p7n9cxhslpn6svhh
(jameinel) Allow commits to stacked branches (John A Meinel)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2006-2011 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
1300
1300
 
1301
1301
    def test_stacked_repositories_reject_commit_builder(self):
1302
1302
        # As per bug 375013, committing to stacked repositories is currently
1303
 
        # broken, so repositories with fallbacks refuse to hand out a commit
1304
 
        # builder.
 
1303
        # broken if we aren't in a chk repository. So old repositories with
 
1304
        # fallbacks refuse to hand out a commit builder.
1305
1305
        repo_basis = self.make_repository('basis')
1306
1306
        branch = self.make_branch('local')
1307
1307
        repo_local = branch.repository
1309
1309
            repo_local.add_fallback_repository(repo_basis)
1310
1310
        except errors.UnstackableRepositoryFormat:
1311
1311
            raise tests.TestNotApplicable("not a stackable format.")
1312
 
        repo_local.lock_write()
1313
 
        self.addCleanup(repo_local.unlock)
1314
 
        self.assertRaises(errors.BzrError, repo_local.get_commit_builder,
1315
 
            branch, [], branch.get_config())
 
1312
        self.addCleanup(repo_local.lock_write().unlock)
 
1313
        if not repo_local._format.supports_chks:
 
1314
            self.assertRaises(errors.BzrError, repo_local.get_commit_builder,
 
1315
                branch, [], branch.get_config())
 
1316
        else:
 
1317
            builder = repo_local.get_commit_builder(branch, [],
 
1318
                                                    branch.get_config())
 
1319
            builder.abort()
1316
1320
 
1317
1321
    def test_committer_no_username(self):
1318
1322
        # Ensure that when no username is available but a committer is