[MERGE] Better progress reporting in commit
John Arbash Meinel
john at arbash-meinel.com
Tue Jun 19 13:47:43 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ian Clatworthy wrote:
> One of my goals for 0.18 is to make commit faster. Following the
> direction Rob is driving for each Use Case, the idea is to start at the
> outermost layer, validate that the code is using the right high level
> algorithm and abstractions, and progressively move any inefficiencies
> into logical APIs on Tree, Branch & Repository. We can then address
> those inefficiencies collectively via new file formats at the right time.
>
> The attached patch is step 1 along this path. It cleans up the progress
> monitoring in commit so that it no longer assumes we know the total size
> of the tree. To be more explicit, we do know the total number of stages
> in commit (and it's a stable number) so the progress reporting is "stage
> centric" now. Within one of those stages, we report how many entries
> we've processed so far. FWIW, the total entry count right now is still
> the tree size. In the future though, we can adjust the upper number to
> reflect partial commit file counts, smarter knowledge about just the
> interesting/changed entries, etc.
>
> All that background explanation aside, this patch makes the UI better
> regardless. :-)
>
> Ian C.
>
A few comments...
You again sent a bundle which cannot be applied without more context. So I'm
unable to just "bzr merge bundle". I did apply the patch directly (patch -p0 <
bundle). And I can say I like the reporter.
The other comment is that there is only 1 blank space between class-level entries:
+ def _emit_progress_set_stage(self, name, show_entries=False):
+ """Set the progress stage and emit an update to the progress bar."""
+ self.pb_stage_name = name
+ self.pb_stage_count += 1
+ self.pb_entries_show = show_entries
+ if show_entries:
+ self.pb_entries_count = 0
+ self.pb_entries_total = '?'
+ self._emit_progress()
+
+
+ def _emit_progress_next_entry(self):
+ """Emit an update to the progress bar and increment the file count."""
+ self.pb_entries_count += 1
+ self._emit_progress()
+
+
+ def _emit_progress(self):
+ if self.pb_entries_show:
+ text = "%s [Entry %d/%s] - Stage" % (self.pb_stage_name,
+ self.pb_entries_count,str(self.pb_entries_total))
+ else:
+ text = "%s - Stage" % (self.pb_stage_name)
+ self.pb.update(text, self.pb_stage_count, self.pb_stage_total)
+
def _report_deletes(self):
All these have one too many spaces between them.
I sort of feel like the testing is a little light in this, since it isn't
checking what messages are actually generated.
Also, this seems to report exactly the same information when I do "bzr commit
- -q" and that used to suppress the messages. so you should be checking
'bzrlib.trace.is_quiet()'.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGd9BuJdeBCYSNAAMRAoTYAJ0Xpx0j2NHQBmv/jmxoluNyHB/AjgCg022g
QDUwcWuMzXI1KEM7q8rKhBk=
=TNFC
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list