~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Martin Pool
  • Date: 2010-02-27 01:34:49 UTC
  • mto: This revision was merged to the branch mainline in revision 5064.
  • Revision ID: mbp@canonical.com-20100227013449-zxostilwfoendxfv
Handle "Directory not empty" from ftp as DirectoryNotEmpty.

FtpTransport._translate_ftp_error can handle all ftp errors; there's no clear
distinction between 'temporary' and 'permament'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Canonical Ltd
 
1
# Copyright (C) 2006-2010 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
29
29
 
30
30
import os
31
31
import sys
 
32
import warnings
32
33
 
33
34
from bzrlib.lazy_import import lazy_import
34
35
lazy_import(globals(), """
77
78
from bzrlib.trace import (
78
79
    mutter,
79
80
    note,
 
81
    warning,
80
82
    )
81
83
 
82
84
from bzrlib import (
128
130
        return True
129
131
 
130
132
    def check_conversion_target(self, target_format):
 
133
        """Check that a bzrdir as a whole can be converted to a new format."""
 
134
        # The only current restriction is that the repository content can be 
 
135
        # fetched compatibly with the target.
131
136
        target_repo_format = target_format.repository_format
132
 
        source_repo_format = self._format.repository_format
133
 
        source_repo_format.check_conversion_target(target_repo_format)
 
137
        try:
 
138
            self.open_repository()._format.check_conversion_target(
 
139
                target_repo_format)
 
140
        except errors.NoRepositoryPresent:
 
141
            # No repo, no problem.
 
142
            pass
134
143
 
135
144
    @staticmethod
136
145
    def _check_supported(format, allow_unsupported,
346
355
                for subdir in sorted(subdirs, reverse=True):
347
356
                    pending.append(current_transport.clone(subdir))
348
357
 
 
358
    def list_branches(self):
 
359
        """Return a sequence of all branches local to this control directory.
 
360
 
 
361
        """
 
362
        try:
 
363
            return [self.open_branch()]
 
364
        except errors.NotBranchError:
 
365
            return []
 
366
 
349
367
    @staticmethod
350
368
    def find_branches(transport):
351
369
        """Find all branches under a transport.
363
381
            except errors.NoRepositoryPresent:
364
382
                pass
365
383
            else:
366
 
                return False, (None, repository)
367
 
            try:
368
 
                branch = bzrdir.open_branch()
369
 
            except errors.NotBranchError:
370
 
                return True, (None, None)
371
 
            else:
372
 
                return True, (branch, None)
373
 
        branches = []
374
 
        for branch, repo in BzrDir.find_bzrdirs(transport, evaluate=evaluate):
 
384
                return False, ([], repository)
 
385
            return True, (bzrdir.list_branches(), None)
 
386
        ret = []
 
387
        for branches, repo in BzrDir.find_bzrdirs(transport,
 
388
                                                  evaluate=evaluate):
375
389
            if repo is not None:
376
 
                branches.extend(repo.find_branches())
377
 
            if branch is not None:
378
 
                branches.append(branch)
379
 
        return branches
 
390
                ret.extend(repo.find_branches())
 
391
            if branches is not None:
 
392
                ret.extend(branches)
 
393
        return ret
380
394
 
381
395
    def destroy_repository(self):
382
396
        """Destroy the repository in this BzrDir"""
566
580
 
567
581
        :return: Tuple with old path name and new path name
568
582
        """
 
583
        def name_gen(base='backup.bzr'):
 
584
            counter = 1
 
585
            name = "%s.~%d~" % (base, counter)
 
586
            while self.root_transport.has(name):
 
587
                counter += 1
 
588
                name = "%s.~%d~" % (base, counter)
 
589
            return name
 
590
 
 
591
        backup_dir=name_gen()
569
592
        pb = ui.ui_factory.nested_progress_bar()
570
593
        try:
571
594
            # FIXME: bug 300001 -- the backup fails if the backup directory
575
598
            # FIXME: bug 262450 -- the backup directory should have the same
576
599
            # permissions as the .bzr directory (probably a bug in copy_tree)
577
600
            old_path = self.root_transport.abspath('.bzr')
578
 
            new_path = self.root_transport.abspath('backup.bzr')
579
 
            pb.note('making backup of %s' % (old_path,))
580
 
            pb.note('  to %s' % (new_path,))
581
 
            self.root_transport.copy_tree('.bzr', 'backup.bzr')
 
601
            new_path = self.root_transport.abspath(backup_dir)
 
602
            ui.ui_factory.note('making backup of %s\n  to %s' % (old_path, new_path,))
 
603
            self.root_transport.copy_tree('.bzr', backup_dir)
582
604
            return (old_path, new_path)
583
605
        finally:
584
606
            pb.finished()
1384
1406
        # that can do wonky stuff here, and that only
1385
1407
        # happens for creating checkouts, which cannot be
1386
1408
        # done on this format anyway. So - acceptable wart.
 
1409
        if hardlink:
 
1410
            warning("can't support hardlinked working trees in %r"
 
1411
                % (self,))
1387
1412
        try:
1388
1413
            result = self.open_workingtree(recommend_upgrade=False)
1389
1414
        except errors.NoSuchFile:
1526
1551
    This is a deprecated format and may be removed after sept 2006.
1527
1552
    """
1528
1553
 
 
1554
    def has_workingtree(self):
 
1555
        """See BzrDir.has_workingtree."""
 
1556
        return True
 
1557
    
1529
1558
    def open_repository(self):
1530
1559
        """See BzrDir.open_repository."""
1531
1560
        from bzrlib.repofmt.weaverepo import RepositoryFormat5
1547
1576
    This is a deprecated format and may be removed after sept 2006.
1548
1577
    """
1549
1578
 
 
1579
    def has_workingtree(self):
 
1580
        """See BzrDir.has_workingtree."""
 
1581
        return True
 
1582
    
1550
1583
    def open_repository(self):
1551
1584
        """See BzrDir.open_repository."""
1552
1585
        from bzrlib.repofmt.weaverepo import RepositoryFormat6
1630
1663
 
1631
1664
    def get_branch_transport(self, branch_format):
1632
1665
        """See BzrDir.get_branch_transport()."""
 
1666
        # XXX: this shouldn't implicitly create the directory if it's just
 
1667
        # promising to get a transport -- mbp 20090727
1633
1668
        if branch_format is None:
1634
1669
            return self.transport.clone('branch')
1635
1670
        try:
1670
1705
            pass
1671
1706
        return self.transport.clone('checkout')
1672
1707
 
 
1708
    def has_workingtree(self):
 
1709
        """Tell if this bzrdir contains a working tree.
 
1710
 
 
1711
        This will still raise an exception if the bzrdir has a workingtree that
 
1712
        is remote & inaccessible.
 
1713
 
 
1714
        Note: if you're going to open the working tree, you should just go
 
1715
        ahead and try, and not ask permission first.
 
1716
        """
 
1717
        from bzrlib.workingtree import WorkingTreeFormat
 
1718
        try:
 
1719
            WorkingTreeFormat.find_format(self)
 
1720
        except errors.NoWorkingTree:
 
1721
            return False
 
1722
        return True
 
1723
 
1673
1724
    def needs_format_conversion(self, format=None):
1674
1725
        """See BzrDir.needs_format_conversion()."""
1675
1726
        if format is None:
1791
1842
    def probe_transport(klass, transport):
1792
1843
        """Return the .bzrdir style format present in a directory."""
1793
1844
        try:
1794
 
            format_string = transport.get(".bzr/branch-format").read()
 
1845
            format_string = transport.get_bytes(".bzr/branch-format")
1795
1846
        except errors.NoSuchFile:
1796
1847
            raise errors.NotBranchError(path=transport.base)
1797
1848
 
2573
2624
    def convert(self, to_convert, pb):
2574
2625
        """See Converter.convert()."""
2575
2626
        self.bzrdir = to_convert
2576
 
        self.pb = pb
2577
 
        self.pb.note('starting upgrade from format 4 to 5')
2578
 
        if isinstance(self.bzrdir.transport, local.LocalTransport):
2579
 
            self.bzrdir.get_workingtree_transport(None).delete('stat-cache')
2580
 
        self._convert_to_weaves()
2581
 
        return BzrDir.open(self.bzrdir.root_transport.base)
 
2627
        if pb is not None:
 
2628
            warnings.warn("pb parameter to convert() is deprecated")
 
2629
        self.pb = ui.ui_factory.nested_progress_bar()
 
2630
        try:
 
2631
            ui.ui_factory.note('starting upgrade from format 4 to 5')
 
2632
            if isinstance(self.bzrdir.transport, local.LocalTransport):
 
2633
                self.bzrdir.get_workingtree_transport(None).delete('stat-cache')
 
2634
            self._convert_to_weaves()
 
2635
            return BzrDir.open(self.bzrdir.root_transport.base)
 
2636
        finally:
 
2637
            self.pb.finished()
2582
2638
 
2583
2639
    def _convert_to_weaves(self):
2584
 
        self.pb.note('note: upgrade may be faster if all store files are ungzipped first')
 
2640
        ui.ui_factory.note('note: upgrade may be faster if all store files are ungzipped first')
2585
2641
        try:
2586
2642
            # TODO permissions
2587
2643
            stat = self.bzrdir.transport.stat('weaves')
2615
2671
        self.pb.clear()
2616
2672
        self._write_all_weaves()
2617
2673
        self._write_all_revs()
2618
 
        self.pb.note('upgraded to weaves:')
2619
 
        self.pb.note('  %6d revisions and inventories', len(self.revisions))
2620
 
        self.pb.note('  %6d revisions not present', len(self.absent_revisions))
2621
 
        self.pb.note('  %6d texts', self.text_count)
 
2674
        ui.ui_factory.note('upgraded to weaves:')
 
2675
        ui.ui_factory.note('  %6d revisions and inventories' % len(self.revisions))
 
2676
        ui.ui_factory.note('  %6d revisions not present' % len(self.absent_revisions))
 
2677
        ui.ui_factory.note('  %6d texts' % self.text_count)
2622
2678
        self._cleanup_spare_files_after_format4()
2623
2679
        self.branch._transport.put_bytes(
2624
2680
            'branch-format',
2692
2748
                       len(self.known_revisions))
2693
2749
        if not self.branch.repository.has_revision(rev_id):
2694
2750
            self.pb.clear()
2695
 
            self.pb.note('revision {%s} not present in branch; '
2696
 
                         'will be converted as a ghost',
 
2751
            ui.ui_factory.note('revision {%s} not present in branch; '
 
2752
                         'will be converted as a ghost' %
2697
2753
                         rev_id)
2698
2754
            self.absent_revisions.add(rev_id)
2699
2755
        else:
2825
2881
    def convert(self, to_convert, pb):
2826
2882
        """See Converter.convert()."""
2827
2883
        self.bzrdir = to_convert
2828
 
        self.pb = pb
2829
 
        self.pb.note('starting upgrade from format 5 to 6')
2830
 
        self._convert_to_prefixed()
2831
 
        return BzrDir.open(self.bzrdir.root_transport.base)
 
2884
        pb = ui.ui_factory.nested_progress_bar()
 
2885
        try:
 
2886
            ui.ui_factory.note('starting upgrade from format 5 to 6')
 
2887
            self._convert_to_prefixed()
 
2888
            return BzrDir.open(self.bzrdir.root_transport.base)
 
2889
        finally:
 
2890
            pb.finished()
2832
2891
 
2833
2892
    def _convert_to_prefixed(self):
2834
2893
        from bzrlib.store import TransportStore
2835
2894
        self.bzrdir.transport.delete('branch-format')
2836
2895
        for store_name in ["weaves", "revision-store"]:
2837
 
            self.pb.note("adding prefixes to %s" % store_name)
 
2896
            ui.ui_factory.note("adding prefixes to %s" % store_name)
2838
2897
            store_transport = self.bzrdir.transport.clone(store_name)
2839
2898
            store = TransportStore(store_transport, prefixed=True)
2840
2899
            for urlfilename in store_transport.list_dir('.'):
2867
2926
        from bzrlib.repofmt.weaverepo import RepositoryFormat7
2868
2927
        from bzrlib.branch import BzrBranchFormat5
2869
2928
        self.bzrdir = to_convert
2870
 
        self.pb = pb
 
2929
        self.pb = ui.ui_factory.nested_progress_bar()
2871
2930
        self.count = 0
2872
2931
        self.total = 20 # the steps we know about
2873
2932
        self.garbage_inventories = []
2874
2933
        self.dir_mode = self.bzrdir._get_dir_mode()
2875
2934
        self.file_mode = self.bzrdir._get_file_mode()
2876
2935
 
2877
 
        self.pb.note('starting upgrade from format 6 to metadir')
 
2936
        ui.ui_factory.note('starting upgrade from format 6 to metadir')
2878
2937
        self.bzrdir.transport.put_bytes(
2879
2938
                'branch-format',
2880
2939
                "Converting to format 6",
2930
2989
        else:
2931
2990
            has_checkout = True
2932
2991
        if not has_checkout:
2933
 
            self.pb.note('No working tree.')
 
2992
            ui.ui_factory.note('No working tree.')
2934
2993
            # If some checkout files are there, we may as well get rid of them.
2935
2994
            for name, mandatory in checkout_files:
2936
2995
                if name in bzrcontents:
2953
3012
            'branch-format',
2954
3013
            BzrDirMetaFormat1().get_format_string(),
2955
3014
            mode=self.file_mode)
 
3015
        self.pb.finished()
2956
3016
        return BzrDir.open(self.bzrdir.root_transport.base)
2957
3017
 
2958
3018
    def make_lock(self, name):
2994
3054
    def convert(self, to_convert, pb):
2995
3055
        """See Converter.convert()."""
2996
3056
        self.bzrdir = to_convert
2997
 
        self.pb = pb
 
3057
        self.pb = ui.ui_factory.nested_progress_bar()
2998
3058
        self.count = 0
2999
3059
        self.total = 1
3000
3060
        self.step('checking repository format')
3005
3065
        else:
3006
3066
            if not isinstance(repo._format, self.target_format.repository_format.__class__):
3007
3067
                from bzrlib.repository import CopyConverter
3008
 
                self.pb.note('starting repository conversion')
 
3068
                ui.ui_factory.note('starting repository conversion')
3009
3069
                converter = CopyConverter(self.target_format.repository_format)
3010
3070
                converter.convert(repo, pb)
3011
 
        try:
3012
 
            branch = self.bzrdir.open_branch()
3013
 
        except errors.NotBranchError:
3014
 
            pass
3015
 
        else:
 
3071
        for branch in self.bzrdir.list_branches():
3016
3072
            # TODO: conversions of Branch and Tree should be done by
3017
3073
            # InterXFormat lookups/some sort of registry.
3018
3074
            # Avoid circular imports
3033
3089
                      new is _mod_branch.BzrBranchFormat8):
3034
3090
                    branch_converter = _mod_branch.Converter7to8()
3035
3091
                else:
3036
 
                    raise errors.BadConversionTarget("No converter", new)
 
3092
                    raise errors.BadConversionTarget("No converter", new,
 
3093
                        branch._format)
3037
3094
                branch_converter.convert(branch)
3038
3095
                branch = self.bzrdir.open_branch()
3039
3096
                old = branch._format.__class__
3059
3116
                isinstance(self.target_format.workingtree_format,
3060
3117
                    workingtree_4.WorkingTreeFormat6)):
3061
3118
                workingtree_4.Converter4or5to6().convert(tree)
 
3119
        self.pb.finished()
3062
3120
        return to_convert
3063
3121
 
3064
3122
 
3071
3129
 
3072
3130
    def __init__(self):
3073
3131
        BzrDirMetaFormat1.__init__(self)
 
3132
        # XXX: It's a bit ugly that the network name is here, because we'd
 
3133
        # like to believe that format objects are stateless or at least
 
3134
        # immutable,  However, we do at least avoid mutating the name after
 
3135
        # it's returned.  See <https://bugs.edge.launchpad.net/bzr/+bug/504102>
3074
3136
        self._network_name = None
3075
3137
 
 
3138
    def __repr__(self):
 
3139
        return "%s(_network_name=%r)" % (self.__class__.__name__,
 
3140
            self._network_name)
 
3141
 
3076
3142
    def get_format_description(self):
 
3143
        if self._network_name:
 
3144
            real_format = network_format_registry.get(self._network_name)
 
3145
            return 'Remote: ' + real_format.get_format_description()
3077
3146
        return 'bzr remote bzrdir'
3078
3147
 
3079
3148
    def get_format_string(self):
3212
3281
        args.append(self._serialize_NoneString(repo_format_name))
3213
3282
        args.append(self._serialize_NoneTrueFalse(make_working_trees))
3214
3283
        args.append(self._serialize_NoneTrueFalse(shared_repo))
3215
 
        if self._network_name is None:
3216
 
            self._network_name = \
 
3284
        request_network_name = self._network_name or \
3217
3285
            BzrDirFormat.get_default_format().network_name()
3218
3286
        try:
3219
3287
            response = client.call('BzrDirFormat.initialize_ex_1.16',
3220
 
                self.network_name(), path, *args)
 
3288
                request_network_name, path, *args)
3221
3289
        except errors.UnknownSmartMethod:
3222
3290
            client._medium._remember_remote_is_before((1,16))
3223
3291
            local_dir_format = BzrDirMetaFormat1()
3473
3541
                experimental_pairs.append((key, help))
3474
3542
            else:
3475
3543
                output += wrapped(key, help, info)
3476
 
        output += "\nSee ``bzr help formats`` for more about storage formats."
 
3544
        output += "\nSee :doc:`formats-help` for more about storage formats."
3477
3545
        other_output = ""
3478
3546
        if len(experimental_pairs) > 0:
3479
3547
            other_output += "Experimental formats are shown below.\n\n"
3492
3560
            other_output += \
3493
3561
                "\nNo deprecated formats are available.\n\n"
3494
3562
        other_output += \
3495
 
            "\nSee ``bzr help formats`` for more about storage formats."
 
3563
                "\nSee :doc:`formats-help` for more about storage formats."
3496
3564
 
3497
3565
        if topic == 'other-formats':
3498
3566
            return other_output
3542
3610
            if self._require_stacking:
3543
3611
                raise
3544
3612
 
 
3613
    def requires_stacking(self):
 
3614
        """Return True if this policy requires stacking."""
 
3615
        return self._stack_on is not None and self._require_stacking
 
3616
 
3545
3617
    def _get_full_stack_on(self):
3546
3618
        """Get a fully-qualified URL for the stack_on location."""
3547
3619
        if self._stack_on is None:
3663
3735
format_registry.register('weave', BzrDirFormat6,
3664
3736
    'Pre-0.8 format.  Slower than knit and does not'
3665
3737
    ' support checkouts or shared repositories.',
 
3738
    hidden=True,
3666
3739
    deprecated=True)
3667
3740
format_registry.register_metadir('metaweave',
3668
3741
    'bzrlib.repofmt.weaverepo.RepositoryFormat7',
3669
3742
    'Transitional format in 0.8.  Slower than knit.',
3670
3743
    branch_format='bzrlib.branch.BzrBranchFormat5',
3671
3744
    tree_format='bzrlib.workingtree.WorkingTreeFormat3',
 
3745
    hidden=True,
3672
3746
    deprecated=True)
3673
3747
format_registry.register_metadir('knit',
3674
3748
    'bzrlib.repofmt.knitrepo.RepositoryFormatKnit1',
3675
3749
    'Format using knits.  Recommended for interoperation with bzr <= 0.14.',
3676
3750
    branch_format='bzrlib.branch.BzrBranchFormat5',
3677
3751
    tree_format='bzrlib.workingtree.WorkingTreeFormat3',
 
3752
    hidden=True,
3678
3753
    deprecated=True)
3679
3754
format_registry.register_metadir('dirstate',
3680
3755
    'bzrlib.repofmt.knitrepo.RepositoryFormatKnit1',
3684
3759
    # this uses bzrlib.workingtree.WorkingTreeFormat4 because importing
3685
3760
    # directly from workingtree_4 triggers a circular import.
3686
3761
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
 
3762
    hidden=True,
3687
3763
    deprecated=True)
3688
3764
format_registry.register_metadir('dirstate-tags',
3689
3765
    'bzrlib.repofmt.knitrepo.RepositoryFormatKnit1',
3692
3768
        ' Incompatible with bzr < 0.15.',
3693
3769
    branch_format='bzrlib.branch.BzrBranchFormat6',
3694
3770
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
 
3771
    hidden=True,
3695
3772
    deprecated=True)
3696
3773
format_registry.register_metadir('rich-root',
3697
3774
    'bzrlib.repofmt.knitrepo.RepositoryFormatKnit4',
3699
3776
        ' bzr < 1.0.',
3700
3777
    branch_format='bzrlib.branch.BzrBranchFormat6',
3701
3778
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
 
3779
    hidden=True,
3702
3780
    deprecated=True)
3703
3781
format_registry.register_metadir('dirstate-with-subtree',
3704
3782
    'bzrlib.repofmt.knitrepo.RepositoryFormatKnit3',
3715
3793
    help='New in 0.92: Pack-based format with data compatible with '
3716
3794
        'dirstate-tags format repositories. Interoperates with '
3717
3795
        'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
3718
 
        'Previously called knitpack-experimental.  '
3719
 
        'For more information, see '
3720
 
        'http://doc.bazaar-vcs.org/latest/developers/packrepo.html.',
 
3796
        ,
3721
3797
    branch_format='bzrlib.branch.BzrBranchFormat6',
3722
3798
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3723
3799
    )
3726
3802
    help='New in 0.92: Pack-based format with data compatible with '
3727
3803
        'dirstate-with-subtree format repositories. Interoperates with '
3728
3804
        'bzr repositories before 0.92 but cannot be read by bzr < 0.92. '
3729
 
        'Previously called knitpack-experimental.  '
3730
 
        'For more information, see '
3731
 
        'http://doc.bazaar-vcs.org/latest/developers/packrepo.html.',
 
3805
        ,
3732
3806
    branch_format='bzrlib.branch.BzrBranchFormat6',
3733
3807
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
3734
3808
    hidden=True,
3740
3814
         '(needed for bzr-svn and bzr-git).',
3741
3815
    branch_format='bzrlib.branch.BzrBranchFormat6',
3742
3816
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
 
3817
    hidden=True,
3743
3818
    )
3744
3819
format_registry.register_metadir('1.6',
3745
3820
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack5',
3748
3823
         'not present locally.',
3749
3824
    branch_format='bzrlib.branch.BzrBranchFormat7',
3750
3825
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
 
3826
    hidden=True,
3751
3827
    )
3752
3828
format_registry.register_metadir('1.6.1-rich-root',
3753
3829
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack5RichRoot',
3755
3831
         '(needed for bzr-svn and bzr-git).',
3756
3832
    branch_format='bzrlib.branch.BzrBranchFormat7',
3757
3833
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
 
3834
    hidden=True,
3758
3835
    )
3759
3836
format_registry.register_metadir('1.9',
3760
3837
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6',
3763
3840
         'performance for most operations.',
3764
3841
    branch_format='bzrlib.branch.BzrBranchFormat7',
3765
3842
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
 
3843
    hidden=True,
3766
3844
    )
3767
3845
format_registry.register_metadir('1.9-rich-root',
3768
3846
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6RichRoot',
3770
3848
         '(needed for bzr-svn and bzr-git).',
3771
3849
    branch_format='bzrlib.branch.BzrBranchFormat7',
3772
3850
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
 
3851
    hidden=True,
3773
3852
    )
3774
3853
format_registry.register_metadir('1.14',
3775
3854
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack6',
3791
3870
        'to and from rich-root-pack (and anything compatible with '
3792
3871
        'rich-root-pack) format repositories. Repositories and branches in '
3793
3872
        'this format can only be read by bzr.dev. Please read '
3794
 
        'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
 
3873
        'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3795
3874
        'before use.',
3796
3875
    branch_format='bzrlib.branch.BzrBranchFormat7',
3797
3876
    tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3798
3877
    experimental=True,
3799
3878
    alias=True,
 
3879
    hidden=True,
3800
3880
    )
3801
3881
format_registry.register_metadir('development-subtree',
3802
3882
    'bzrlib.repofmt.pack_repo.RepositoryFormatPackDevelopment2Subtree',
3804
3884
        'from pack-0.92-subtree (and anything compatible with '
3805
3885
        'pack-0.92-subtree) format repositories. Repositories and branches in '
3806
3886
        'this format can only be read by bzr.dev. Please read '
3807
 
        'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
 
3887
        'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3808
3888
        'before use.',
3809
3889
    branch_format='bzrlib.branch.BzrBranchFormat7',
3810
3890
    tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3811
3891
    experimental=True,
 
3892
    hidden=True,
3812
3893
    alias=False, # Restore to being an alias when an actual development subtree format is added
3813
3894
                 # This current non-alias status is simply because we did not introduce a
3814
3895
                 # chk based subtree format.
3819
3900
    'bzrlib.repofmt.groupcompress_repo.RepositoryFormatCHK1',
3820
3901
    help='pack-1.9 with 255-way hashed CHK inv, group compress, rich roots '
3821
3902
        'Please read '
3822
 
        'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
 
3903
        'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3823
3904
        'before use.',
3824
3905
    branch_format='bzrlib.branch.BzrBranchFormat7',
3825
3906
    tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3831
3912
    'bzrlib.repofmt.groupcompress_repo.RepositoryFormatCHK2',
3832
3913
    help='pack-1.9 with 255-way hashed CHK inv, bencode revision, group compress, '
3833
3914
        'rich roots. Please read '
3834
 
        'http://doc.bazaar-vcs.org/latest/developers/development-repo.html '
 
3915
        'http://doc.bazaar.canonical.com/latest/developers/development-repo.html '
3835
3916
        'before use.',
3836
3917
    branch_format='bzrlib.branch.BzrBranchFormat7',
3837
3918
    tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3854
3935
# The following format should be an alias for the rich root equivalent 
3855
3936
# of the default format
3856
3937
format_registry.register_metadir('default-rich-root',
3857
 
    'bzrlib.repofmt.pack_repo.RepositoryFormatKnitPack4',
3858
 
    help='Default format, rich root variant. (needed for bzr-svn and bzr-git).',
3859
 
    branch_format='bzrlib.branch.BzrBranchFormat6',
3860
 
    tree_format='bzrlib.workingtree.WorkingTreeFormat4',
 
3938
    'bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a',
 
3939
    branch_format='bzrlib.branch.BzrBranchFormat7',
 
3940
    tree_format='bzrlib.workingtree.WorkingTreeFormat6',
3861
3941
    alias=True,
3862
 
    )
 
3942
    hidden=True,
 
3943
    help='Same as 2a.')
 
3944
 
3863
3945
# The current format that is made on 'bzr init'.
3864
 
format_registry.set_default('pack-0.92')
 
3946
format_registry.set_default('2a')