~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Martin Pool
  • Date: 2010-09-15 10:40:51 UTC
  • mfrom: (5425 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5426.
  • Revision ID: mbp@sourcefrog.net-20100915104051-pkjmuc2bc27buysp
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
                format.get_format_description(),
166
166
                basedir)
167
167
 
168
 
    def clone(self, url, revision_id=None, force_new_repo=False,
169
 
              preserve_stacking=False):
170
 
        """Clone this bzrdir and its contents to url verbatim.
171
 
 
172
 
        :param url: The url create the clone at.  If url's last component does
173
 
            not exist, it will be created.
174
 
        :param revision_id: The tip revision-id to use for any branch or
175
 
            working tree.  If not None, then the clone operation may tune
176
 
            itself to download less data.
177
 
        :param force_new_repo: Do not use a shared repository for the target
178
 
                               even if one is available.
179
 
        :param preserve_stacking: When cloning a stacked branch, stack the
180
 
            new branch on top of the other branch's stacked-on branch.
181
 
        """
182
 
        return self.clone_on_transport(get_transport(url),
183
 
                                       revision_id=revision_id,
184
 
                                       force_new_repo=force_new_repo,
185
 
                                       preserve_stacking=preserve_stacking)
186
 
 
187
168
    def clone_on_transport(self, transport, revision_id=None,
188
169
        force_new_repo=False, preserve_stacking=False, stacked_on=None,
189
170
        create_prefix=False, use_existing_dir=True):
1719
1700
    def register_format(klass, format):
1720
1701
        BzrProber.register_bzrdir_format(format)
1721
1702
        # bzr native formats have a network name of their format string.
1722
 
        network_format_registry.register(format.get_format_string(), format.__class__)
 
1703
        controldir.network_format_registry.register(format.get_format_string(), format.__class__)
1723
1704
        controldir.ControlDirFormat.register_format(format)
1724
1705
 
1725
1706
    def _supply_sub_formats_to(self, other_format):
1738
1719
    def unregister_format(klass, format):
1739
1720
        BzrProber.unregister_bzrdir_format(format)
1740
1721
        controldir.ControlDirFormat.unregister_format(format)
1741
 
        network_format_registry.remove(format.get_format_string())
 
1722
        controldir.network_format_registry.remove(format.get_format_string())
1742
1723
 
1743
1724
 
1744
1725
class BzrDirFormat4(BzrDirFormat):
2147
2128
                                  __set_workingtree_format)
2148
2129
 
2149
2130
 
2150
 
network_format_registry = registry.FormatRegistry()
2151
 
"""Registry of formats indexed by their network name.
2152
 
 
2153
 
The network name for a BzrDirFormat is an identifier that can be used when
2154
 
referring to formats with smart server operations. See
2155
 
BzrDirFormat.network_name() for more detail.
2156
 
"""
2157
 
 
2158
 
 
2159
2131
# Register bzr formats
2160
2132
BzrDirFormat.register_format(BzrDirFormat4())
2161
2133
BzrDirFormat.register_format(BzrDirFormat5())
2719
2691
 
2720
2692
    def get_format_description(self):
2721
2693
        if self._network_name:
2722
 
            real_format = network_format_registry.get(self._network_name)
 
2694
            real_format = controldir.network_format_registry.get(self._network_name)
2723
2695
            return 'Remote: ' + real_format.get_format_description()
2724
2696
        return 'bzr remote bzrdir'
2725
2697