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

merge bzr.dev@3883

Show diffs side-by-side

added added

removed removed

Lines of Context:
516
516
        """
517
517
        raise NotImplementedError(self.create_workingtree)
518
518
 
 
519
    def backup_bzrdir(self):
 
520
        """Backup this bzr control directory.
 
521
        
 
522
        :return: Tuple with old path name and new path name
 
523
        """
 
524
        self.root_transport.copy_tree('.bzr', 'backup.bzr')
 
525
        return (self.root_transport.abspath('.bzr'),
 
526
                self.root_transport.abspath('backup.bzr'))
 
527
 
519
528
    def retire_bzrdir(self, limit=10000):
520
529
        """Permanently disable the bzrdir.
521
530
 
1061
1070
 
1062
1071
    def sprout(self, url, revision_id=None, force_new_repo=False,
1063
1072
               recurse='down', possible_transports=None,
1064
 
               accelerator_tree=None, hardlink=False, stacked=False):
 
1073
               accelerator_tree=None, hardlink=False, stacked=False,
 
1074
               source_branch=None):
1065
1075
        """Create a copy of this bzrdir prepared for use as a new line of
1066
1076
        development.
1067
1077
 
1088
1098
        cloning_format = self.cloning_metadir(stacked)
1089
1099
        # Create/update the result branch
1090
1100
        result = cloning_format.initialize_on_transport(target_transport)
1091
 
        try:
1092
 
            source_branch = self.open_branch()
1093
 
            source_repository = source_branch.repository
 
1101
        # if a stacked branch wasn't requested, we don't create one
 
1102
        # even if the origin was stacked
 
1103
        stacked_branch_url = None
 
1104
        if source_branch is not None:
1094
1105
            if stacked:
1095
1106
                stacked_branch_url = self.root_transport.base
1096
 
            else:
1097
 
                # if a stacked branch wasn't requested, we don't create one
1098
 
                # even if the origin was stacked
1099
 
                stacked_branch_url = None
1100
 
        except errors.NotBranchError:
1101
 
            source_branch = None
 
1107
            source_repository = source_branch.repository
 
1108
        else:
1102
1109
            try:
1103
 
                source_repository = self.open_repository()
1104
 
            except errors.NoRepositoryPresent:
1105
 
                source_repository = None
1106
 
            stacked_branch_url = None
 
1110
                source_branch = self.open_branch()
 
1111
                source_repository = source_branch.repository
 
1112
                if stacked:
 
1113
                    stacked_branch_url = self.root_transport.base
 
1114
            except errors.NotBranchError:
 
1115
                source_branch = None
 
1116
                try:
 
1117
                    source_repository = self.open_repository()
 
1118
                except errors.NoRepositoryPresent:
 
1119
                    source_repository = None
1107
1120
        repository_policy = result.determine_repository_policy(
1108
1121
            force_new_repo, stacked_branch_url, require_stacking=stacked)
1109
1122
        result_repo = repository_policy.acquire_repository()
2646
2659
            return False
2647
2660
        return self.get_format_description() == other.get_format_description()
2648
2661
 
 
2662
    @property
 
2663
    def repository_format(self):
 
2664
        # Using a property to avoid early loading of remote
 
2665
        return remote.RemoteRepositoryFormat()
 
2666
 
2649
2667
 
2650
2668
BzrDirFormat.register_control_server_format(RemoteBzrDirFormat)
2651
2669