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

Goffredo Baroncelli kreijack at alice.it
Mon Sep 12 22:27:30 BST 2005


On Friday 09 September 2005 17:07, you (Robert Collins) wrote:
> 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...
> 

Ok, but I have found some problems on the current repository:

$ python ../bzr-check/bzr check
[=========================================] checking revision 1199/1206 
0:00:02mismatched revision sha1 for parent 
{mbp at sourcefrog.net-20050723140637-c9bf049e0e11ea05} of 
{abentley at panoramicfeedback.com-20050726140611-403e366f3c79c1f1}: 
1c54394ed04cbaa92fea56771f6684677aa62cb9 vs 
314c417124f47b8a83eb3d852c4c5c35249e24b7
[=========================================] checking revision 1229/1235 
0:00:02mismatched revision sha1 for parent 
{mbp at sourcefrog.net-20050711073345-177b10e674961bda} of 
{aaron.bentley at utoronto.ca-20050715015629-cff74c300400f1a7}: 
f486fa751391ea0c34080fc59fb99a9a8e87157b vs 
82748c79c2e039ec7ca9245df7b73212b2e0f312
[=========================================] checking revision 1420/1420 
0:00:00bzr: ERROR: revision 
{mbp at sourcefrog.net-20050627021805-13222ad1af28eeae} 
has no parents listed but preceded by 
{mbp at sourcefrog.net-20050627023805-5fdae55959ab1142}


1 & 2)
$ zgrep revision_ref .bzr/revision-store/abentley at panoramicfeedback.com-20050726140611-403e366f3c79c1f1.gz
<revision_ref revision_id="mbp at sourcefrog.net-20050723140637-c9bf049e0e11ea05" revision_sha1="1c54394ed04cbaa92fea56771f6684677aa62cb9" />
$ zcat .bzr/revision-store/mbp at sourcefrog.net-20050723140637-c9bf049e0e11ea05.gz | sha1sum
314c417124f47b8a83eb3d852c4c5c35249e24b7  -

$ zgrep revision_ref .bzr/revision-store/aaron.bentley at utoronto.ca-20050715015629-cff74c300400f1a7.gz
<revision_ref revision_id="mbp at sourcefrog.net-20050711073345-177b10e674961bda" revision_sha1="f486fa751391ea0c34080fc59fb99a9a8e87157b" />
$ zcat .bzr/revision-store/mbp at sourcefrog.net-20050711073345-177b10e674961bda.gz | sha1sum
82748c79c2e039ec7ca9245df7b73212b2e0f312  -




3) the revision mbp at sourcefrog.net-20050627021805-13222ad1af28eeae 
doesn't have any parent: is it legal ? I think that it is only too old...

$ zcat .bzr/revision-store/"mbp at sourcefrog.net-20050627021805-13222ad1af28eeae".gz
<revision committer="Martin Pool &lt;mbp at sourcefrog.net&gt;" inventory_id="mbp at sourcefrog.net-20050627021805-13222ad1af28eeae" inventory_sha1="1347cf8d1a145cbb6f55c84c8ca6321dc2029c08" revision_id="mbp at sourcefrog.net-20050627021805-13222ad1af28eeae" timestamp="1119838685.639350891" timezone="36000">
<message>Check in old existing knit code.
</message>
</revision>


Do you have any idea ?



> > 
> > *** 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 will work on a test; however I think that should more simple check
if rev_no is < revcount;

if rev_no is < rev count, the revision is a non merged revision, otherwise
is a merged revision.


-- 
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack @ inwind.it>
Key fingerprint = CE3C 7E01 6782 30A3 5B87  87C0 BB86 505C 6B2A CFF9




More information about the bazaar mailing list