/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 bzrlib/fetch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-11-28 01:11:17 UTC
  • mfrom: (3834.4.5 newpack-cache-limit)
  • Revision ID: pqm@pqm.ubuntu.com-20081128011117-4l4jwujo8pm2mitn
Make InterPackRepo set the new pack's cache size even when there is
        stacking.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
    """
78
78
 
79
79
    def __init__(self, to_repository, from_repository, last_revision=None, pb=None,
80
 
        find_ghosts=True):
 
80
        find_ghosts=True, _write_group_acquired_callable=None):
81
81
        """Create a repo fetcher.
82
82
 
83
83
        :param find_ghosts: If True search the entire history for ghosts.
 
84
        :param _write_group_acquired_callable: Don't use; this parameter only
 
85
            exists to facilitate a hack done in InterPackRepo.fetch.  We would
 
86
            like to remove this parameter.
84
87
        """
85
88
        # result variables.
86
89
        self.failed_revisions = []
95
98
        # must not mutate self._last_revision as its potentially a shared instance
96
99
        self._last_revision = last_revision
97
100
        self.find_ghosts = find_ghosts
 
101
        self._write_group_acquired_callable = _write_group_acquired_callable
98
102
        if pb is None:
99
103
            self.pb = bzrlib.ui.ui_factory.nested_progress_bar()
100
104
            self.nested_pb = self.pb
107
111
            try:
108
112
                self.to_repository.start_write_group()
109
113
                try:
 
114
                    if self._write_group_acquired_callable is not None:
 
115
                        # Used by InterPackRepo.fetch to set_write_cache_size
 
116
                        # on the new pack.
 
117
                        self._write_group_acquired_callable()
110
118
                    self.__fetch()
111
119
                except:
112
120
                    self.to_repository.abort_write_group(suppress_errors=True)