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

Goffredo Baroncelli kreijack at alice.it
Wed Sep 7 20:14:50 BST 2005

Hi all,

the merged revision aren't inserted into the .bzr/revision-history. The 'bzr check' command checks only 
the revisions listed in .bzr/revision-history, so the merged revision aren't checked at all.

In the bzr repository some merged revision refer to the following missing revisions.

john at arbash-meinel.com-20050709180338-33e3b5a778df9104
john at arbash-meinel.com-20050711051006-2d11704675600e95
mbp at sourcefrog.net-20050707101437-33cd322eed99d580
mbp at sourcefrog.net-20050707075712-4784aa908809b905

# the john at arbash-meinel.com-20050709180338-33e3b5a778df9104 revision is referred by \
# the mbp at sourcefrog.net-20050711064100-c2eb947e0212f487 revision

bzr.dev$ zgrep "john at arbash-meinel.com-20050709180338-33e3b5a778df9104" .bzr/revision-store/*
.bzr/revision-store/mbp at sourcefrog.net-20050711064100-c2eb947e0212f487.gz:<revision_ref revision_id="john at arbash-meinel.com-20050709180338-33e3b5a778df9104" />

# The john at arbash-meinel.com-20050709180338-33e3b5a778df9104 revision doesn't exist

ghigo at therra:~/bazar/test4/bzr.dev$ ls -l ".bzr/revision-store/john at arbash-meinel.com-20050709180338-33e3b5a778df9104*"
ls: .bzr/revision-store/john at arbash-meinel.com-20050709180338-33e3b5a778df9104*: No such file or directory

# The mbp at sourcefrog.net-20050711064100-c2eb947e0212f487 isn't in the .bzr/revision-history file

bzr.dev$ grep "mbp at sourcefrog.net-20050711064100-c2eb947e0212f487.gz" .bzr/revision-history

With the patch below the 'bzr check' command checks every revision listed in 
.bzr/revision-history, and every parent referred by these revisions walking the chain of the revision.

Does anyone know what is the pourpose of the .bzr/merged-patches ? I think that this file should contains
the marged revision UUID, but the docs aren't very clear and it seems that the bzr code creats only the
file and doesn't care anymore.

The main problem is that with this patch, today the bzr repository doesn't pass the check :-)

bzr.dev$ python ../../bzr-check/bzr check
[=========================================] checking revision 1189/1199 0:00:01bzr: ERROR: Branch Branch('/home/ghigo/bazar/test4/bzr.dev') has no revision mbp at sourcefrog.net-20050707075712-4784aa908809b905



*** 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))
             # mutter('    revision {%s}' % rev_id)
             rev = branch.get_revision(rev_id)
             if rev.revision_id != rev_id:
@@ -124,7 +127,7 @@
                                         "start of the branch"
                                         % (rev_id, len(rev.parents)))
                 for prr in rev.parents:
-                    if prr.revision_id == last_rev_id:
+                    if prr.revision_id in history[:revno]:
                     raise BzrCheckError("previous revision {%s} not listed among "
@@ -132,6 +135,10 @@
                                         % (last_rev_id, rev_id))

                 for prr in rev.parents:
+                    if not prr.revision_id in history:
+                        history.append(str(prr.revision_id))
                     if prr.revision_sha1 is None:
                         missing_revision_sha_cnt += 1

gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack @ inwind.it>
Key fingerprint = CE3C 7E01 6782 30A3 5B87  87C0 BB86 505C 6B2A CFF9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050907/0dfff7e5/attachment.pgp 

More information about the bazaar mailing list