~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Andrew Bennetts
  • Date: 2008-11-29 00:31:13 UTC
  • mto: This revision was merged to the branch mainline in revision 3873.
  • Revision ID: andrew.bennetts@canonical.com-20081129003113-7i4ib0spwj53o1l5
Call PyErr_NoMemory() before returning NULL in PatienceSequenceMatcher_new.

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.
98
98
        # must not mutate self._last_revision as its potentially a shared instance
99
99
        self._last_revision = last_revision
100
100
        self.find_ghosts = find_ghosts
 
101
        self._write_group_acquired_callable = _write_group_acquired_callable
101
102
        if pb is None:
102
103
            self.pb = bzrlib.ui.ui_factory.nested_progress_bar()
103
104
            self.nested_pb = self.pb
110
111
            try:
111
112
                self.to_repository.start_write_group()
112
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()
113
118
                    self.__fetch()
114
119
                except:
115
120
                    self.to_repository.abort_write_group(suppress_errors=True)