bzr diff raisesNoSuchRevision in _get_revisions on ghost revisions

Bug #393837 reported by Nir Soffer
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Bazaar
Triaged
Medium
Unassigned

Bug Description

The svn server runs Ubuntu 7.0.4 and subversion 1.4.

The bazaar branch was created about 1000 revisions away with older bazaar version (1.10 or 1.12) on Ubuntu 7.0.4.

Both the bazaar branch and the svn repository were accessed with various version of bazaar and bzr-svn on Linux, Windows and Mac OS X.

I have seen this error with this branch with previous bzr and bzr-svn versions.

$ bzr di -c2777
=== modified file 'HGSServer/1.75/signalgw/common/mediaCard.h'
bzr: ERROR: bzrlib.errors.NoSuchRevision: KnitPackRepository('file:///home/nirs/repo/.bzr/repository/') has no revision nirs@jaunty-20090629140736-ao6ps8tluak4q9bx

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 729, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 924, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 560, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 939, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 1815, in run
    extra_trees=extra_trees, using=using)
  File "/usr/lib/python2.6/dist-packages/bzrlib/diff.py", line 427, in show_diff_trees
    return differ.show_diff(specific_files, extra_trees)
  File "/usr/lib/python2.6/dist-packages/bzrlib/diff.py", line 834, in show_diff
    return self._show_diff(specific_files, extra_trees)
  File "/usr/lib/python2.6/dist-packages/bzrlib/diff.py", line 894, in _show_diff
    self._diff(file_id, oldpath, newpath, kind[0], kind[1])
  File "/usr/lib/python2.6/dist-packages/bzrlib/diff.py", line 920, in _diff
    new_path, old_kind, new_kind)
  File "/usr/lib/python2.6/dist-packages/bzrlib/diff.py", line 486, in _diff_many
    new_kind)
  File "/usr/lib/python2.6/dist-packages/bzrlib/diff.py", line 615, in diff
    new_date = _patch_header_date(self.new_tree, file_id, new_path)
  File "/usr/lib/python2.6/dist-packages/bzrlib/diff.py", line 439, in _patch_header_date
    mtime = tree.get_file_mtime(file_id, path)
  File "/usr/lib/python2.6/dist-packages/bzrlib/revisiontree.py", line 105, in get_file_mtime
    revision = self._repository.get_revision(ie.revision)
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/repofmt/knitrepo.py", line 208, in get_revision
    return self.get_revision_reconcile(revision_id)
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/repository.py", line 1700, in get_revision_reconcile
    return self._get_revisions([revision_id])[0]
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 138, in read_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/repository.py", line 1718, in _get_revisions
    raise errors.NoSuchRevision(self, record.key[0])
NoSuchRevision: KnitPackRepository('file:///home/nirs/repo/.bzr/repository/') has no revision nirs@jaunty-20090629140736-ao6ps8tluak4q9bx

bzr 1.16.1 on python 2.6.2 (linux2)
arguments: ['/usr/bin/bzr', 'di', '-c2777']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  bzrtools /usr/lib/python2.6/dist-packages/bzrlib/plugins/bzrtools [1.16]
  dbus /usr/lib/python2.6/dist-packages/bzrlib/plugins/dbus [unknown]
  launchpad /usr/lib/python2.6/dist-packages/bzrlib/plugins/launchpad [1.16.1]
  netrc_credential_store /usr/lib/python2.6/dist-packages/bzrlib/plugins/netrc_credential_store [1.16.1]
  svn /home/nirs/.bazaar/plugins/svn [0.6.2]
*** 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.

Tags: diff ghost
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

this is a bug in the "bzr diff" command, which can't handle texts introduced by ghost revisions.

There's an open bug report about this somewhere already but I can't find it atm.

affects: bzr-svn → bzr
tags: added: diff ghost
Changed in bzr:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Nir Soffer (nirs) wrote :

Here is the output from bzr check:

$ bzr check
Checking working tree at 'file:///home/nirs/repo/trunk/'.
Checking repository at 'file:///home/nirs/repo/'.
checked repository <bzrlib.transport.local.LocalTransport url=file:///home/nirs/repo/> format <RepositoryFormatKnitPack4>
  5359 revisions
  9615 file-ids
 16040 unique file texts
12406162 repeated file texts
     0 unreferenced text versions
     6 ghost revisions
     6 revisions missing parents in ancestry
    31 inconsistent parents
Checking branch at 'file:///home/nirs/repo/trunk/'.
checked branch file:///home/nirs/repo/trunk/ format Branch format 6

Martin Pool (mbp)
summary: - bzr di raises NoSuchRevision in _get_revisions
+ bzr diff raisesNoSuchRevision in _get_revisions on ghost revisions
Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 393837] Re: bzr di raises NoSuchRevision in _get_revisions

On Tue, 2009-06-30 at 13:23 +0000, Jelmer Vernooij wrote:
> this is a bug in the "bzr diff" command, which can't handle texts
> introduced by ghost revisions.

I think it was more that texts from ghosts are not copied around, and
there commit can't be shown.

-Rob

Revision history for this message
Nir Soffer (nirs) wrote :

I downgraded to the official bzr version in jaunty, 1.13.1 - I see the same error.

But after I delete my local repository, created a new repository and got the trunk branch again from another server, the problem seems to be fixed.

I also don't see now ghost revisions in bzr check.

Revision history for this message
dmuir (dmuir) wrote :

Is it just me or this only an issue with the new 2a format?

checkout using 2a:
$ echo "test" >> versioned_file
$ bzr diff
ERROR.....

checkout using rich-roots
$echo "test" >> versioned_file
$bzr diff
...
+test

both checkouts are up to date and are otherwise identical

Revision history for this message
dmuir (dmuir) wrote :

This bug also affects `bzr shelve`. Is there a way to fix this locally?

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Cool =) so how do I get rid of the ghost revisions? Everything was fine a minute ago

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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