/breezy-hg/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy-hg/trunk

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Jelmer Vernooij
  • Date: 2011-12-20 15:50:52 UTC
  • Revision ID: jelmer@canonical.com-20111220155052-m9i6qmhn47xxuhla
Drop support for bzr < 2.4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
"""
22
22
 
 
23
from __future__ import absolute_import
 
24
 
23
25
import bzrlib
24
26
import bzrlib.api
25
27
from bzrlib.transport import register_transport_proto
26
28
 
27
 
from info import (
 
29
from bzrlib.plugins.hg.info import (
28
30
    bzr_compatible_versions,
29
31
    hg_compatible_version_strings,
30
32
    bzr_plugin_version as version_info,
188
190
 
189
191
ControlDirFormat.register_prober(HgProber)
190
192
ControlDirFormat._server_probers.insert(0, HgProber)
191
 
if not getattr(Prober, "known_formats", False): # bzr < 2.4
192
 
    from bzrlib.plugins.hg.dir import HgControlDirFormat
193
 
    ControlDirFormat.register_format(HgControlDirFormat())
194
 
    # Provide RevisionTree.get_file_revision, so various parts of bzr-svn
195
 
    # can avoid inventories.
196
 
    from bzrlib.revisiontree import RevisionTree
197
 
    def get_file_revision(tree, file_id, path=None):
198
 
        return tree.inventory[file_id].revision
199
 
    RevisionTree.get_file_revision = get_file_revision
200
 
 
201
193
 
202
194
controldir_network_format_registry.register_lazy("hg",
203
195
    "bzrlib.plugins.hg.dir", "HgControlDirFormat")
220
212
branch_network_format_registry.register_lazy(
221
213
    "hg", "bzrlib.plugins.hg.branch", "HgBranchFormat")
222
214
 
223
 
try:
224
 
    from bzrlib.branch import (
225
 
        format_registry as branch_format_registry,
226
 
        )
227
 
except ImportError: # bzr < 2.4
228
 
    pass
229
 
else:
230
 
    branch_format_registry.register_extra_lazy(
231
 
        "bzrlib.plugins.hg.branch", "HgBranchFormat")
232
 
 
233
 
try:
234
 
    from bzrlib.workingtree import (
235
 
        format_registry as workingtree_format_registry,
236
 
        )
237
 
except ImportError: # bzr < 2.4
238
 
    pass
239
 
else:
240
 
    workingtree_format_registry.register_extra_lazy(
241
 
        "bzrlib.plugins.hg.workingtree", "HgWorkingTreeFormat")
242
 
 
243
 
 
244
 
try:
245
 
    register_extra_lazy_repository_format = getattr(repository_format_registry,
246
 
        "register_extra_lazy")
247
 
except AttributeError: # bzr < 2.4
248
 
    pass
249
 
else:
250
 
    register_extra_lazy_repository_format('bzrlib.plugins.hg.repository',
 
215
from bzrlib.branch import (
 
216
    format_registry as branch_format_registry,
 
217
    )
 
218
branch_format_registry.register_extra_lazy(
 
219
    "bzrlib.plugins.hg.branch", "HgBranchFormat")
 
220
 
 
221
from bzrlib.workingtree import (
 
222
    format_registry as workingtree_format_registry,
 
223
    )
 
224
workingtree_format_registry.register_extra_lazy(
 
225
    "bzrlib.plugins.hg.workingtree", "HgWorkingTreeFormat")
 
226
 
 
227
repository_format_registry.register_extra_lazy('bzrlib.plugins.hg.repository',
251
228
        'HgRepositoryFormat')
252
229
 
253
230
send_format_registry.register_lazy('hg', 'bzrlib.plugins.hg.send',
265
242
register_transport_proto('hg+ssh://',
266
243
        help="Access using the Mercurial smart server protocol over SSH.")
267
244
 
268
 
from bzrlib.revisionspec import dwim_revspecs, RevisionSpec_dwim
269
 
if getattr(RevisionSpec_dwim, "append_possible_lazy_revspec", None):
270
 
    RevisionSpec_dwim.append_possible_lazy_revspec(
271
 
        "bzrlib.plugins.hg.revspec", "RevisionSpec_hg")
272
 
else: # bzr < 2.4
273
 
    from bzrlib.plugins.hg.revspec import RevisionSpec_hg
274
 
    dwim_revspecs.append(RevisionSpec_hg)
 
245
from bzrlib.revisionspec import RevisionSpec_dwim
 
246
RevisionSpec_dwim.append_possible_lazy_revspec(
 
247
    "bzrlib.plugins.hg.revspec", "RevisionSpec_hg")
275
248
 
276
249
def test_suite():
277
250
    from unittest import TestSuite, TestLoader