~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

Fixup pb usage to use nested_progress_bar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
        # must not mutate self._last_revision as its potentially a shared instance
95
95
        self._last_revision = last_revision
96
96
        if pb is None:
97
 
            self.pb = bzrlib.ui.ui_factory.progress_bar()
 
97
            self.pb = bzrlib.ui.ui_factory.nested_progress_bar()
 
98
            self.nested_pb = self.pb
98
99
        else:
99
100
            self.pb = pb
 
101
            self.nested_pb = None
100
102
        self.from_repository.lock_read()
101
103
        try:
102
104
            self.to_repository.lock_write()
103
105
            try:
104
106
                self.__fetch()
105
107
            finally:
 
108
                if self.nested_pb is not None:
 
109
                    self.nested_pb.finished()
106
110
                self.to_repository.unlock()
107
111
        finally:
108
112
            self.from_repository.unlock()