Broken branch from svn

Jelmer Vernooij jelmer at samba.org
Fri Oct 23 16:42:33 BST 2009


On Fri, 2009-10-23 at 15:17 +0400, Ivan Sagalaev wrote:
> Hello!
> 
> Recently we started working with an SVN repo from bzr. We're working 
> with checkouts to ensure that branches are always in sync with the svn 
> repo. After couple of commits we've got a problem for which I don't have 
> any name beside "strange".
> 
> Unfortunately I can't publish a faulty branch (it has "NDA" stickers all 
> over it) but I'm a Python programmer and can do any testing and 
> debugging needed. I just don't know where the hell to start %-). So 
> please help!
> 
> Environment:
> 
> - 2 developers (a "guy" and a "girl" for easy reference)
> - bzr 2.0.1, bzr-svn 1.0
> 
> Symptoms:
> 
> - svn revno are absent after one of the commits:
> 
>      revno: 500 [merge]
>      committer: guy
>      branch nick: trunk/lenta_ng
>      timestamp: Wed 2009-10-21 16:42:30 +0400
>      message:
>        ...
>      ------------------------------------------------------------
>      revno: 499
>      svn revno: 7052 (on /trunk/lenta_ng)
>      committer: girl
>      timestamp: Tue 2009-10-20 09:09:34 +0000
>      message:
>        ...
> 
> However svn itself has those revisions, I can see them.
> 
> - trying to get a diff between 499 and 500 revisions fails with a traceback:
> 
>       Traceback (most recent call last):
>         File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 
> 842, in exception_to_return_code
>           return the_callable(*args, **kwargs)
>         File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 
> 1037, in run_bzr
>           ret = run(*run_argv)
>         File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 
> 654, in run_argv_aliases
>           return self.run(**all_cmd_args)
>         File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 
> 1052, in ignore_pipe
>           result = func(*args, **kwargs)
>         File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 
> 1917, in run
>           extra_trees=extra_trees, using=using)
>         File "/usr/lib/python2.6/dist-packages/bzrlib/diff.py", line 
> 432, in show_diff_trees
>           return differ.show_diff(specific_files, extra_trees)
>         File "/usr/lib/python2.6/dist-packages/bzrlib/diff.py", line 
> 839, in show_diff
>           return self._show_diff(specific_files, extra_trees)
>         File "/usr/lib/python2.6/dist-packages/bzrlib/diff.py", line 
> 899, in _show_diff
>           self._diff(file_id, oldpath, newpath, kind[0], kind[1])
>         File "/usr/lib/python2.6/dist-packages/bzrlib/diff.py", line 
> 925, in _diff
>           new_path, old_kind, new_kind)
>         File "/usr/lib/python2.6/dist-packages/bzrlib/diff.py", line 
> 491, in _diff_many
>           new_kind)
>         File "/usr/lib/python2.6/dist-packages/bzrlib/diff.py", line 
> 620, 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 
> 444, in _patch_header_date
>           mtime = tree.get_file_mtime(file_id, path)
>         File "/usr/lib/python2.6/dist-packages/bzrlib/revisiontree.py", 
> line 106, 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 1846, 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 1863, in _get_revisions
>           raise errors.NoSuchRevision(self, revid)
>       NoSuchRevision: 
> CHKInventoryRepository('file:///home/isagalaev/Desktop/lenta_ng/.bzr/repository/') 
> has no revision vgol at pandev.yandex.ru-20091021123548-0o87tyxkbdx5x2ei
> 
> - the same exception is raised when diffing between any revision for the 
> files that were in commit 500 (I'm guessing it happens upon accessing 
> their history)
This is a known bug in bzr dealing with ghost revisions in "bzr diff" -
bug 393837.

> - those exception happen only on girl's checkouts but the guy who 
> actually committed that revision 500 can work with his branch normally
> 
> - `bzr check` on a fresh checkout says:
> 
>      Checking working tree at '/home/isagalaev/Desktop/lenta_ng'.
>      Checking branch at 'file:///home/isagalaev/Desktop/lenta_ng/'.
>      Checking repository at 'file:///home/isagalaev/Desktop/lenta_ng/'.
>      checked repository <bzrlib.transport.local.LocalTransport 
> url=file:///home/isagalaev/Desktop/lenta_ng/> format <RepositoryFormat2a>
>         504 revisions
>         882 file-ids
>           2 ghost revisions
>           7 inconsistent parents
>      checked branch file:///home/isagalaev/Desktop/lenta_ng/ format 
> Branch format 7
> 
> - after `bzr reconcile` inconsistent parents are gone, 2 ghosts still there
> 
> - if it means anything, that commit was made with `debcommit -Rr` that 
> was calling bzr commands (bzr commit, bzr tag).
> 
> Looks like there are indeed 2 revisions that somehow got "lost" in the 
> process but I don't know how to make a branch to forget about them. 
> We'll happily discard current bzr repo and make a new one, if needed.
You should be able to push those two revisions to e.g. /branches/foo in
the repository, that will make the ghost issue go away.

I'm not sure what the easiest workaround is in this case. 

Bug 393837 does not look like it would be too hard to fix, we just need
to come up with the timestamp to use for ghost texts. 

Cheers,

Jelmer

-- 
Jelmer Vernooij <jelmer at samba.org> - http://samba.org/~jelmer/
Jabber: jelmer at jabber.fsfe.org



More information about the bazaar mailing list