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

  • Committer: Jelmer Vernooij
  • Date: 2020-04-05 19:11:34 UTC
  • mto: (7490.7.16 work)
  • mto: This revision was merged to the branch mainline in revision 7501.
  • Revision ID: jelmer@jelmer.uk-20200405191134-0aebh8ikiwygxma5
Populate the .gitignore file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
objects returned.
26
26
"""
27
27
 
 
28
from __future__ import absolute_import
 
29
 
28
30
import sys
29
31
 
30
32
from ..lazy_import import lazy_import
31
33
lazy_import(globals(), """
32
 
import contextlib
33
 
 
34
34
from breezy import (
35
35
    branch as _mod_branch,
 
36
    cleanup,
36
37
    lockable_files,
37
38
    lockdir,
38
39
    osutils,
60
61
from breezy.i18n import gettext
61
62
""")
62
63
 
 
64
from ..sixish import viewitems
63
65
from ..trace import (
64
66
    mutter,
65
67
    note,
378
380
            when working locally.
379
381
        :return: The created control directory
380
382
        """
381
 
        with contextlib.ExitStack() as stack:
 
383
        with cleanup.ExitStack() as stack:
382
384
            fetch_spec_factory = fetch.FetchSpecFactory()
383
385
            if revision_id is not None:
384
386
                fetch_spec_factory.add_revision_ids([revision_id])
430
432
                # actually useful?
431
433
                # Not especially, but it's part of the contract.
432
434
                result_branch = result.create_branch()
433
 
                if revision_id is not None:
434
 
                    result_branch.generate_revision_history(revision_id)
435
435
            else:
436
436
                result_branch = source_branch.sprout(
437
437
                    result, revision_id=revision_id,
1166
1166
 
1167
1167
    def check_support_status(self, allow_unsupported, recommend_upgrade=True,
1168
1168
                             basedir=None):
1169
 
        for name, necessity in self.features.items():
 
1169
        for name, necessity in viewitems(self.features):
1170
1170
            if name in self._present_features:
1171
1171
                continue
1172
1172
            if necessity == b"optional":
1206
1206
        """
1207
1207
        lines = [self.get_format_string()]
1208
1208
        lines.extend([(item[1] + b" " + item[0] + b"\n")
1209
 
                      for item in sorted(self.features.items())])
 
1209
                      for item in sorted(viewitems(self.features))])
1210
1210
        return b"".join(lines)
1211
1211
 
1212
1212
    @classmethod
1493
1493
        # implementation, please add new tests for it to the appropriate place.
1494
1494
        return filename == '.bzr' or filename.startswith('.bzr/')
1495
1495
 
1496
 
    @classmethod
1497
 
    def get_default_format(klass):
1498
 
        """Return the current default format."""
1499
 
        return controldir.format_registry.get('bzr')()
1500
 
 
1501
1496
 
1502
1497
class BzrDirMetaFormat1(BzrDirFormat):
1503
1498
    """Bzr meta control format 1