~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Martin von Gagern
  • Date: 2011-06-01 12:53:56 UTC
  • mto: This revision was merged to the branch mainline in revision 6009.
  • Revision ID: martin.vgagern@gmx.net-20110601125356-lwozv2vecea6hxfz
Change from no_decorate to classify as name for the argument.

The command line switch remains as --no-classify, to keep backwards
compatibility.  Users are free to include --no-classify in an alias, and
still use --classify to change back.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    do_catching_redirections,
56
56
    local,
57
57
    )
58
 
from bzrlib.i18n import gettext
59
58
""")
60
59
 
61
60
from bzrlib.trace import (
544
543
                    stacked=stacked)
545
544
        return result
546
545
 
 
546
 
 
547
 
547
548
    @staticmethod
548
549
    def create_branch_convenience(base, force_new_repo=False,
549
550
                                  force_new_tree=None, format=None,
633
634
            old_path = self.root_transport.abspath('.bzr')
634
635
            backup_dir = self._available_backup_name('backup.bzr')
635
636
            new_path = self.root_transport.abspath(backup_dir)
636
 
            ui.ui_factory.note(gettext('making backup of {0}\n  to {1}').format(
637
 
                urlutils.unescape_for_display(old_path, 'utf-8'),
638
 
                urlutils.unescape_for_display(new_path, 'utf-8')))
 
637
            ui.ui_factory.note('making backup of %s\n  to %s'
 
638
                               % (old_path, new_path,))
639
639
            self.root_transport.copy_tree('.bzr', backup_dir)
640
640
            return (old_path, new_path)
641
641
        finally:
656
656
            try:
657
657
                to_path = '.bzr.retired.%d' % i
658
658
                self.root_transport.rename('.bzr', to_path)
659
 
                note(gettext("renamed {0} to {1}").format(
660
 
                    self.root_transport.abspath('.bzr'), to_path))
 
659
                note("renamed %s to %s"
 
660
                    % (self.root_transport.abspath('.bzr'), to_path))
661
661
                return
662
662
            except (errors.TransportError, IOError, errors.PathError):
663
663
                i += 1
848
848
            redirected_transport = transport._redirected_to(e.source, e.target)
849
849
            if redirected_transport is None:
850
850
                raise errors.NotBranchError(base)
851
 
            note(gettext('{0} is{1} redirected to {2}').format(
852
 
                 transport.base, e.permanently, redirected_transport.base))
 
851
            note('%s is%s redirected to %s',
 
852
                 transport.base, e.permanently, redirected_transport.base)
853
853
            return redirected_transport
854
854
 
855
855
        try:
1146
1146
        """See BzrDir.can_convert_format()."""
1147
1147
        return True
1148
1148
 
1149
 
    def create_branch(self, name=None, repository=None,
1150
 
            append_revisions_only=None):
 
1149
    def create_branch(self, name=None, repository=None):
1151
1150
        """See BzrDir.create_branch."""
1152
1151
        return self._format.get_branch_format().initialize(self, name=name,
1153
 
                repository=repository,
1154
 
                append_revisions_only=append_revisions_only)
 
1152
                repository=repository)
1155
1153
 
1156
1154
    def destroy_branch(self, name=None):
1157
1155
        """See BzrDir.create_branch."""
1724
1722
                    new_repo_format = None
1725
1723
            if new_repo_format is not None:
1726
1724
                self.repository_format = new_repo_format
1727
 
                note(gettext('Source repository format does not support stacking,'
1728
 
                     ' using format:\n  %s'),
 
1725
                note('Source repository format does not support stacking,'
 
1726
                     ' using format:\n  %s',
1729
1727
                     new_repo_format.get_format_description())
1730
1728
 
1731
1729
        if not self.get_branch_format().supports_stacking():
1744
1742
            if new_branch_format is not None:
1745
1743
                # Does support stacking, use its format.
1746
1744
                self.set_branch_format(new_branch_format)
1747
 
                note(gettext('Source branch format does not support stacking,'
1748
 
                     ' using format:\n  %s'),
 
1745
                note('Source branch format does not support stacking,'
 
1746
                     ' using format:\n  %s',
1749
1747
                     new_branch_format.get_format_description())
1750
1748
 
1751
1749
    def get_converter(self, format=None):
1855
1853
        else:
1856
1854
            if not isinstance(repo._format, self.target_format.repository_format.__class__):
1857
1855
                from bzrlib.repository import CopyConverter
1858
 
                ui.ui_factory.note(gettext('starting repository conversion'))
 
1856
                ui.ui_factory.note('starting repository conversion')
1859
1857
                converter = CopyConverter(self.target_format.repository_format)
1860
1858
                converter.convert(repo, pb)
1861
1859
        for branch in self.bzrdir.list_branches():
2034
2032
                                    possible_transports=[self._bzrdir.root_transport])
2035
2033
            if not self._require_stacking:
2036
2034
                # We have picked up automatic stacking somewhere.
2037
 
                note(gettext('Using default stacking branch {0} at {1}').format(
2038
 
                    self._stack_on, self._stack_on_pwd))
 
2035
                note('Using default stacking branch %s at %s', self._stack_on,
 
2036
                    self._stack_on_pwd)
2039
2037
        repository = self._bzrdir.create_repository(shared=shared)
2040
2038
        self._add_fallback(repository,
2041
2039
                           possible_transports=[self._bzrdir.transport])
2289
2287
    help='Same as 2a.')
2290
2288
 
2291
2289
# The current format that is made on 'bzr init'.
2292
 
format_name = config.GlobalStack().get('default_format')
2293
 
controldir.format_registry.set_default(format_name)
 
2290
format_name = config.GlobalConfig().get_user_option('default_format')
 
2291
if format_name is None:
 
2292
    controldir.format_registry.set_default('2a')
 
2293
else:
 
2294
    controldir.format_registry.set_default(format_name)
2294
2295
 
2295
2296
# XXX 2010-08-20 JRV: There is still a lot of code relying on
2296
2297
# bzrlib.bzrdir.format_registry existing. When BzrDir.create/BzrDir.open/etc