/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/builtins.py

  • Committer: Martin Pool
  • Date: 2007-03-07 01:31:55 UTC
  • mto: (2321.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: mbp@sourcefrog.net-20070307013155-kxvc6ppleyv8jswg
Add blackbox test that join gives clean error when the repository doesn't support rich roots

Show diffs side-by-side

added added

removed removed

Lines of Context:
3238
3238
        sub_tree = WorkingTree.open(tree)
3239
3239
        parent_dir = osutils.dirname(sub_tree.basedir)
3240
3240
        containing_tree = WorkingTree.open_containing(parent_dir)[0]
3241
 
        # XXX: Would be better to just raise a nicely printable exception from
3242
 
        # the real origin. mbp 20070306
 
3241
        repo = containing_tree.branch.repository
 
3242
        if not repo.supports_rich_root():
 
3243
            raise errors.BzrCommandError(
 
3244
                "Can't join trees because %s doesn't support rich root data.\n"
 
3245
                "You can use bzr upgrade on the repository."
 
3246
                % (repo,))
3243
3247
        if reference:
3244
3248
            try:
3245
3249
                containing_tree.add_reference(sub_tree)
3246
3250
            except errors.BadReferenceTarget, e:
 
3251
                # XXX: Would be better to just raise a nicely printable
 
3252
                # exception from the real origin.  Also below.  mbp 20070306
3247
3253
                raise errors.BzrCommandError("Cannot join %s.  %s" %
3248
3254
                                             (tree, e.reason))
3249
3255
        else: