Log on file inconsistent revno with log on branch (also "revno does not match len(mainline)")

Bug #338613 reported by Colin D Bennett
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Breezy
Triaged
Medium
Unassigned

Bug Description

I have a branch where 'bzr log FILE' reports that FILE was changed in revision 21, but 'bzr log -r 21' shows a different commit message!

Bazaar version:
Bazaar (bzr) 1.13dev
  from bzr checkout /home/cdb/bin/bzr.current
    revision: 4086
    revid: <email address hidden>
    branch nick: bzr.dev

Here's the deal.

Log inconsistent
=======================

First, I log all branch revisions. I can do this many ways, and I get the same result. The file 'vcs_log_data.tex' appears to have been modified in revision 22.

$ bzr log -r 21..22 --show-ids -v
------------------------------------------------------------
revno: 22
revision-id: <email address hidden>
parent: <email address hidden>
committer: Colin D Bennett <email address hidden>
branch nick: final_report
timestamp: Thu 2009-03-05 21:51:00 -0800
message:
  Log edit: Attribute primary authorship of arc algorithm fix to Eric.
modified:
  Documentation/Final_report/vcs_log_data.tex vcs_log_data.tex-20090305235736-ru0pj1ye509q41tf-1
------------------------------------------------------------
revno: 21
revision-id: <email address hidden>
parent: <email address hidden>
committer: Colin D Bennett <email address hidden>
branch nick: final_report
timestamp: Thu 2009-03-05 21:36:18 -0800
message:
  Updated directory tree listing from trunk.
  Listing of directory tree of revision:
  revid:<email address hidden>
modified:
  Documentation/Final_report/tree.txt tree.txt-20090302052656-c8hlho75v5aqqj5c-1

Next, I try to log just that file. However, it appears to have been modified in revision 21 instead!

$ bzr log Documentation/Final_report/vcs_log_data.tex --show-ids -v
------------------------------------------------------------
revno: 21
revision-id: <email address hidden>
parent: <email address hidden>
committer: Colin D Bennett <email address hidden>
branch nick: final_report
timestamp: Thu 2009-03-05 21:51:00 -0800
message:
  Log edit: Attribute primary authorship of arc algorithm fix to Eric.
modified:
  Documentation/Final_report/vcs_log_data.tex vcs_log_data.tex-20090305235736-ru0pj1ye509q41tf-1
------------------------------------------------------------
revno: 19
revision-id: <email address hidden>
parent: <email address hidden>
committer: Colin D Bennett <email address hidden>
branch nick: final_report
timestamp: Thu 2009-03-05 15:58:05 -0800
message:
  Checked in log after merging version 3.0 into trunk.
added:
  Documentation/Final_report/vcs_log_data.tex vcs_log_data.tex-20090305235736-ru0pj1ye509q41tf-1
modified:
  Documentation/Final_report/vcs_log.tex vcs_log.tex-20090228232739-mt6z613sq8gkuu1l-15

$ bzr info
Repository branch (format: 1.9-rich-root or development-wt5-rich-root)
Location:
  shared repository: /home/cdb/school/cscd494/repo
  repository branch: .

Related branches:
  parent branch: /home/cdb/school/cscd494/repo/version_3.0

Note that 'bzr diff -c 21 Documentation/Final_report/vcs_log_data.tex' prints no output.
On the other hand, 'bzr diff -c 22 Documentation/Final_report/vcs_log_data.tex' does print the diff.
So the log on the whole branch is correct, but 'log FILE' is wrong.

I've been using bzr-svn in the repository, but this branch is only local to my Bazaar repo. I get the same results with --no-plugins.

Check crashes
=======================
I just tried 'bzr check' on the branch, and it crashed:

cdb@gamma ~/school/cscd494/repo/final_report $ bzr check
No working tree found at specified location.
Checking repository at 'file:///home/cdb/school/cscd494/repo/'.
checked repository <bzrlib.transport.local.LocalTransport url=file:///home/cdb/school/cscd494/repo/> format <RepositoryFormatKnitPack6RichRoot>
   166 revisions
  4023 file-ids
  4063 unique file texts
 47754 repeated file texts
     0 unreferenced text versions
Checking branch at 'file:///home/cdb/school/cscd494/repo/final_report/'.
bzr: ERROR: bzrlib.errors.BzrCheckError: Internal check failed: revno does not match len(mainline) 24 != 23

Traceback (most recent call last):
  File "/home/cdb/bin/bzr.current/bzrlib/commands.py", line 923, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/home/cdb/bin/bzr.current/bzrlib/commands.py", line 868, in run_bzr
    ret = run(*run_argv)
  File "/home/cdb/bin/bzr.current/bzrlib/commands.py", line 547, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/cdb/bin/bzr.current/bzrlib/builtins.py", line 2867, in run
    check_dwim(path, verbose, do_branch=branch, do_repo=repo, do_tree=tree)
  File "/home/cdb/bin/bzr.current/bzrlib/check.py", line 311, in check_dwim
    check_branch(branch, verbose)
  File "/home/cdb/bin/bzr.current/bzrlib/check.py", line 266, in check_branch
    branch_result = branch.check()
  File "/home/cdb/bin/bzr.current/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/home/cdb/bin/bzr.current/bzrlib/branch.py", line 1003, in check
    ' %s != %s' % (last_revno, len(real_rev_history)))
BzrCheckError: Internal check failed: revno does not match len(mainline) 24 != 23

bzr 1.13dev on python 2.5.4 (linux2)
arguments: ['/home/cdb/bin/bzr', 'check']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.utf8'
plugins:
  automv /home/cdb/.bazaar/plugins/automv [unknown]
  bzrtools /home/cdb/.bazaar/plugins/bzrtools [1.12]
  extmerge /home/cdb/.bazaar/plugins/extmerge [unknown]
  gtk /home/cdb/.bazaar/plugins/gtk [0.96.0.dev.1]
  launchpad /home/cdb/bin/bzr.current/bzrlib/plugins/launchpad [unknown]
  loom /home/cdb/.bazaar/plugins/loom [1.4dev]
  mirror /home/cdb/.bazaar/plugins/mirror [unknown]
  netrc_credential_store /home/cdb/bin/bzr.current/bzrlib/plugins/netrc_credential_store [unknown]
  qbzr /home/cdb/.bazaar/plugins/qbzr [0.9.9dev]
  repo_push /home/cdb/.bazaar/plugins/repo_push [1.1]
  svn /home/cdb/.bazaar/plugins/svn [0.5.3dev]
  xmloutput /home/cdb/.bazaar/plugins/xmloutput [0.8.3]
*** Bazaar has encountered an internal error.
    Please report a bug at https://bugs.launchpad.net/bzr/+filebug
    including this traceback, and a description of what you
    were doing when the error occurred.
cdb@gamma ~/school/cscd494/repo/final_report $

Tags: log
Revision history for this message
Colin D Bennett (colinb) wrote :

After running 'bzr reconcile' it seems to be fixed.

cdb@gamma ~/school/cscd494/work/final_report $ bzr reconcile
Reconciling branch file:///home/cdb/school/cscd494/repo/final_report/
Fixing last revision info 25 => 24
bzr: ERROR: No repository present: "file:///home/cdb/school/cscd494/work/final_report/"

After this, running a 'log' on the branch shows revision 21 as being "Log edit: Attribute primary authorship...", and now things are consistent.

Martin Pool (mbp)
Changed in bzr:
status: New → Confirmed
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
tags: added: log
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
Changed in brz:
status: New → Triaged
importance: Undecided → Medium
tags: removed: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.