Mercurial > hg
comparison mercurial/scmutil.py @ 38374:800f5a2c869e
progress: make the progress helper a context manager
This lets us simplify the use site in streamclone.
Differential Revision: https://phab.mercurial-scm.org/D3775
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sun, 17 Jun 2018 13:48:58 -0700 |
parents | ef692614e601 |
children | 6dea017eb6ba |
comparison
equal
deleted
inserted
replaced
38373:ef692614e601 | 38374:800f5a2c869e |
---|---|
1291 self.pos = 0 | 1291 self.pos = 0 |
1292 self.topic = topic | 1292 self.topic = topic |
1293 self.unit = unit | 1293 self.unit = unit |
1294 self.total = total | 1294 self.total = total |
1295 | 1295 |
1296 def __enter__(self): | |
1297 pass | |
1298 | |
1299 def __exit__(self, exc_type, exc_value, exc_tb): | |
1300 self.complete() | |
1301 | |
1296 def update(self, pos, item="", total=None): | 1302 def update(self, pos, item="", total=None): |
1297 if total: | 1303 if total: |
1298 self.total = total | 1304 self.total = total |
1299 self.pos = pos | 1305 self.pos = pos |
1300 self._print(item) | 1306 self._print(item) |