~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

Merge bzr.dev 4157, this breaks a couple per-repository tests.

Looks like removing some of the InterRepo optimizers is revealing places
that we haven't fully finished the RemoteRepo api.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
    """
71
71
 
72
72
    def __init__(self, parent_task=None, ui_factory=None):
 
73
        """Construct a new progress task.
 
74
 
 
75
        Normally you should not call this directly but rather through
 
76
        `ui_factory.nested_progress_bar`.
 
77
        """
73
78
        self._parent_task = parent_task
74
79
        self._last_update = 0
75
80
        self.total_cnt = None
112
117
        if self.current_cnt is not None and self.total_cnt:
113
118
            own_fraction = (float(self.current_cnt) + child_fraction) / self.total_cnt
114
119
        else:
115
 
            own_fraction = None
 
120
            # if this task has no estimation, it just passes on directly
 
121
            # whatever the child has measured...
 
122
            own_fraction = child_fraction
116
123
        if self._parent_task is None:
117
124
            return own_fraction
118
125
        else: