[PATCH][BUG] The 'bzr check' command doesn't check the merged revision

Robert Collins robertc at robertcollins.net
Fri Sep 9 16:07:50 BST 2005


On Wed, 2005-09-07 at 21:14 +0200, Goffredo Baroncelli wrote:
> Hi all,

Hi Goffredo,
	Chatting with Aaron on IRC, we agree that this is useful, but it should
emit a warning when NoSuchRevision is emitted. I've done a quick look at
the rest of your patch...

> 
> *** modified file 'bzrlib/check.py'
> --- bzrlib/check.py
> +++ bzrlib/check.py
> @@ -108,9 +108,12 @@
> 
>          progress = bzrlib.ui.ui_factory.progress_bar()
> 
> -        for rev_id in history:
> +        while revno < len(history):
> +
> +            rev_id = history[revno]
> +
>              revno += 1
> -            progress.update('checking revision', revno, revcount)
> +            progress.update('checking revision', revno, len(history))
> 

The combination of changing from for revid in history, and appending
revisions to the history means that your rev_no counter no longer
matches the rev_no's shown by 'bzr log' etc. Other than that it looks
good (though a test would be fantastic!). Tests for things like this are
often hard though, and diminish returns may make that not worthwhile.

I suggest something like this for the iteration:

to_check = enumerate(history)
rev_offset = 0
while rev_offset < len(to_check):
  if to_check[rev_offset][0] is not None:
    revno = to_check[rev_offset][0] + 1
  rev_id = to_check[rev_offset][1]

  ...
  rev_offset += 1

and use 
  to_check.append((None, rev_id))
to append a new revision.

then use:
  rev_offset : the number of revisions checked
  revno : the revision number in the revision-history
  rev_ud : the revision being checked..

Cheers,
Rob



-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050910/399db20b/attachment.pgp 


More information about the bazaar mailing list