~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

add a clean target

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
    def update(self, msg, current_cnt=None, total_cnt=None):
192
192
        """Update and redraw progress bar."""
193
193
 
194
 
        if current_cnt < 0:
195
 
            current_cnt = 0
196
 
            
197
 
        if current_cnt > total_cnt:
198
 
            total_cnt = current_cnt
199
 
 
200
194
        # save these for the tick() function
201
195
        self.last_msg = msg
202
196
        self.last_cnt = current_cnt
205
199
        if self.throttle():
206
200
            return 
207
201
        
 
202
        if total_cnt:
 
203
            assert current_cnt <= total_cnt
 
204
        if current_cnt:
 
205
            assert current_cnt >= 0
 
206
        
208
207
        if self.show_eta and self.start_time and total_cnt:
209
208
            eta = get_eta(self.start_time, current_cnt, total_cnt)
210
209
            eta_str = " " + str_tdelta(eta)