When using ui.progress(), there's a clear pattern that is followed:
- Pass the same topic and unit
- Usually pass the same total
- Call with pos=None to close the progress bar
- Often keep track of the current position and increment it
This patch creates a simple helper class for this. I'll probably make
it implement the context manager protocol later (calling update(None)
on exit).
Progress is used in low-level modules like changegroup, so I also
exposed it via a method on the ui object. Perhaps the class itself
should also live in ui.py?
This patch also makes merge.oy use it to show that it works.