~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: John Arbash Meinel
  • Date: 2010-01-12 22:36:23 UTC
  • mfrom: (4953 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4955.
  • Revision ID: john@arbash-meinel.com-20100112223623-836x5mou0gm5vsep
merge bzr.dev 4953 to clean up the ui factory issues

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    bzrdir,
25
25
    check,
26
26
    chk_map,
 
27
    config,
27
28
    debug,
28
29
    errors,
29
30
    fetch as _mod_fetch,
1304
1305
        self._reconcile_does_inventory_gc = True
1305
1306
        self._reconcile_fixes_text_parents = False
1306
1307
        self._reconcile_backsup_inventory = True
1307
 
        # not right yet - should be more semantically clear ?
1308
 
        #
1309
 
        # TODO: make sure to construct the right store classes, etc, depending
1310
 
        # on whether escaping is required.
1311
 
        self._warn_if_deprecated()
1312
1308
        self._write_group = None
1313
1309
        # Additional places to query for data.
1314
1310
        self._fallback_repositories = []
1389
1385
        locked = self.is_locked()
1390
1386
        result = self.control_files.lock_write(token=token)
1391
1387
        if not locked:
 
1388
            self._warn_if_deprecated()
1392
1389
            self._note_lock('w')
1393
1390
            for repo in self._fallback_repositories:
1394
1391
                # Writes don't affect fallback repos
1400
1397
        locked = self.is_locked()
1401
1398
        self.control_files.lock_read()
1402
1399
        if not locked:
 
1400
            self._warn_if_deprecated()
1403
1401
            self._note_lock('r')
1404
1402
            for repo in self._fallback_repositories:
1405
1403
                repo.lock_read()
2782
2780
        result.check(callback_refs)
2783
2781
        return result
2784
2782
 
2785
 
    def _warn_if_deprecated(self):
 
2783
    def _warn_if_deprecated(self, branch=None):
2786
2784
        global _deprecation_warning_done
2787
2785
        if _deprecation_warning_done:
2788
2786
            return
2789
 
        _deprecation_warning_done = True
2790
 
        warning("Format %s for %s is deprecated - please use 'bzr upgrade' to get better performance"
2791
 
                % (self._format, self.bzrdir.transport.base))
 
2787
        try:
 
2788
            if branch is None:
 
2789
                conf = config.GlobalConfig()
 
2790
            else:
 
2791
                conf = branch.get_config()
 
2792
            if conf.suppress_warning('format_deprecation'):
 
2793
                return
 
2794
            warning("Format %s for %s is deprecated -"
 
2795
                    " please use 'bzr upgrade' to get better performance"
 
2796
                    % (self._format, self.bzrdir.transport.base))
 
2797
        finally:
 
2798
            _deprecation_warning_done = True
2792
2799
 
2793
2800
    def supports_rich_root(self):
2794
2801
        return self._format.rich_root_data