~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Martin Packman
  • Date: 2012-01-05 10:44:12 UTC
  • mfrom: (6424 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6427.
  • Revision ID: martin.packman@canonical.com-20120105104412-z03fi9m43h946fvs
Merge bzr.dev to resolve conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
from __future__ import absolute_import
 
18
 
17
19
from bzrlib.lazy_import import lazy_import
18
20
lazy_import(globals(), """
19
21
import itertools
20
22
import time
21
23
 
22
24
from bzrlib import (
23
 
    bzrdir,
24
25
    config,
25
26
    controldir,
26
27
    debug,
39
40
""")
40
41
 
41
42
from bzrlib import (
 
43
    bzrdir,
42
44
    errors,
43
45
    registry,
44
46
    symbol_versioning,
1291
1293
        """Returns the policy for making working trees on new branches."""
1292
1294
        return not self._transport.has('no-working-trees')
1293
1295
 
 
1296
    @needs_write_lock
 
1297
    def update_feature_flags(self, updated_flags):
 
1298
        """Update the feature flags for this branch.
 
1299
 
 
1300
        :param updated_flags: Dictionary mapping feature names to necessities
 
1301
            A necessity can be None to indicate the feature should be removed
 
1302
        """
 
1303
        self._format._update_feature_flags(updated_flags)
 
1304
        self.control_transport.put_bytes('format', self._format.as_string())
 
1305
 
1294
1306
 
1295
1307
class RepositoryFormatRegistry(controldir.ControlComponentFormatRegistry):
1296
1308
    """Repository format registry."""
1495
1507
            hook(params)
1496
1508
 
1497
1509
 
1498
 
class RepositoryFormatMetaDir(bzrdir.BzrDirMetaComponentFormat, RepositoryFormat):
 
1510
class RepositoryFormatMetaDir(bzrdir.BzrFormat, RepositoryFormat):
1499
1511
    """Common base class for the new repositories using the metadir layout."""
1500
1512
 
1501
1513
    rich_root_data = False
1512
1524
 
1513
1525
    def __init__(self):
1514
1526
        RepositoryFormat.__init__(self)
1515
 
        bzrdir.BzrDirMetaComponentFormat.__init__(self)
 
1527
        bzrdir.BzrFormat.__init__(self)
1516
1528
 
1517
1529
    def _create_control_files(self, a_bzrdir):
1518
1530
        """Create the required files and the initial control_files object."""
1557
1569
            raise errors.NoRepositoryPresent(a_bzrdir)
1558
1570
        return klass._find_format(format_registry, 'repository', format_string)
1559
1571
 
 
1572
    def check_support_status(self, allow_unsupported, recommend_upgrade=True,
 
1573
            basedir=None):
 
1574
        RepositoryFormat.check_support_status(self,
 
1575
            allow_unsupported=allow_unsupported, recommend_upgrade=recommend_upgrade,
 
1576
            basedir=basedir)
 
1577
        bzrdir.BzrFormat.check_support_status(self, allow_unsupported=allow_unsupported,
 
1578
            recommend_upgrade=recommend_upgrade, basedir=basedir)
 
1579
 
1560
1580
 
1561
1581
# formats which have no format string are not discoverable or independently
1562
1582
# creatable on disk, so are not registered in format_registry.  They're