bzr: ERROR: The branch X has no revision None.

Bug #578005 reported by Jason Spashett
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Expired
Undecided
Unassigned

Bug Description

I have a repository in /srv/bzr/repo, containing many branches. Many of them now give output as below when I try and branch from them:

jason@ionrift:/tmp$ bzr version
Bazaar (bzr) 2.1.1
  Python interpreter: /usr/bin/python 2.5.2
  Python standard library: /usr/lib/python2.5
  Platform: Linux-2.6.18.8.xtra-xenguest.1-i686-with-debian-lenny-sid
  bzrlib: /usr/lib/python2.5/site-packages/bzrlib
  Bazaar configuration: /home/jason/.bazaar
  Bazaar log file: /home/jason/.bzr.log

...

jason@ionrift:/tmp$ bzr branch /srv/bzr/repo/spider/trunk/
bzr: ERROR: The branch /srv/bzr/repo/spider/trunk/ has no revision None.

jason@ionrift:/tmp$ bzr reconcile /srv/bzr/repo/spider/trunk/
Reconciling branch file:///srv/bzr/repo/spider/trunk/
Fixing last revision info 1 => 0
Reconciling repository file:///srv/bzr/repo/
Reconciliation complete.

jason@ionrift:/tmp$ bzr branch /srv/bzr/repo/spider/trunk/
bzr: ERROR: The branch /srv/bzr/repo/spider/trunk/ has no revision None.

jason@ionrift:/tmp$ bzr check /srv/bzr/repo/spider/trunk/
Checking branch at 'file:///srv/bzr/repo/bpnn/contrib/'.
Checking branch at 'file:///srv/bzr/repo/bpnn/morning-star/'.
Checking branch at 'file:///srv/bzr/repo/bpnn/trunk/'.
Checking branch at 'file:///srv/bzr/repo/fxdoji/trunk/'.
Checking branch at 'file:///srv/bzr/repo/gltest/leapfrog/'.
Checking branch at 'file:///srv/bzr/repo/gltest/sdl_keyboard/'.
Checking branch at 'file:///srv/bzr/repo/gltest/speedup_test/'.
Checking branch at 'file:///srv/bzr/repo/gltest/trunk/'.
Checking branch at 'file:///srv/bzr/repo/java3d/trunk/'.
Checking branch at 'file:///srv/bzr/repo/metatrader/trunk/'.
Checking branch at 'file:///srv/bzr/repo/oxygen/trunk/'.
Checking branch at 'file:///srv/bzr/repo/showwindow/'.
Checking branch at 'file:///srv/bzr/repo/spider/trunk/'.
Checking branch at 'file:///srv/bzr/repo/wintail/trunk/'.
No working tree found at specified location.
Checking repository at 'file:///srv/bzr/repo/'.
checked repository <bzrlib.transport.local.LocalTransport url=file:///srv/bzr/repo/> format RepositoryFormat2a()
     9 revisions
    22 file-ids
checked branch file:///srv/bzr/repo/gltest/speedup_test/ format Branch format 7
found error:Internal check failed: revno does not match len(mainline) 54 != -1
checked branch file:///srv/bzr/repo/gltest/sdl_keyboard/ format Branch format 7
found error:Internal check failed: revno does not match len(mainline) 56 != -1
checked branch file:///srv/bzr/repo/metatrader/trunk/ format Branch format 7
found error:Internal check failed: revno does not match len(mainline) 12 != -1
checked branch file:///srv/bzr/repo/gltest/trunk/ format Branch format 7
found error:Internal check failed: revno does not match len(mainline) 0 != -1
checked branch file:///srv/bzr/repo/java3d/trunk/ format Branch format 7
found error:Internal check failed: revno does not match len(mainline) 9 != -1
checked branch file:///srv/bzr/repo/bpnn/trunk/ format Branch format 7
found error:Internal check failed: revno does not match len(mainline) 1 != -1
checked branch file:///srv/bzr/repo/fxdoji/trunk/ format Branch format 7
checked branch file:///srv/bzr/repo/bpnn/contrib/ format Branch format 7
found error:Internal check failed: revno does not match len(mainline) 1 != -1
checked branch file:///srv/bzr/repo/bpnn/morning-star/ format Branch format 7
found error:Internal check failed: revno does not match len(mainline) 2 != -1
checked branch file:///srv/bzr/repo/wintail/trunk/ format Branch format 7
found error:Internal check failed: revno does not match len(mainline) 2 != -1
checked branch file:///srv/bzr/repo/spider/trunk/ format Branch format 7
found error:Internal check failed: revno does not match len(mainline) 0 != -1
checked branch file:///srv/bzr/repo/oxygen/trunk/ format Branch format 7
found error:Internal check failed: revno does not match len(mainline) 5 != -1
checked branch file:///srv/bzr/repo/gltest/leapfrog/ format Branch format 7
found error:Internal check failed: revno does not match len(mainline) 45 != -1
checked branch file:///srv/bzr/repo/showwindow/ format Branch format 7
found error:Internal check failed: revno does not match len(mainline) 2 != -1
jason@ionrift:/tmp$

Revision history for this message
Robert Collins (lifeless) wrote :

Can you check the contents of the '.bzr/branch/last-revision' file in those branches?

Changed in bzr:
status: New → Incomplete
Revision history for this message
Jason Spashett (jspashett) wrote :

Here it is:

jason@ionrift:/srv/bzr/repo/spider/trunk$ cat .bzr/branch/last-revision
0 <email address hidden>

Revision history for this message
Jason Spashett (jspashett) wrote :

jason@ionrift:/srv/bzr/repo$ find . -type f -name last-revision -exec grep .* {} \;
./spider/trunk/.bzr/branch/last-revision:0 <email address hidden>
./metatrader/trunk/.bzr/branch/last-revision:12 <email address hidden>
./time-series/nn1/trunk/.bzr/branch/last-revision:21 <email address hidden>
./time-series/nn1/neuroph/.bzr/branch/last-revision:23 <email address hidden>
./time-series/nn1/encog/.bzr/branch/last-revision:21 <email address hidden>
./time-series/nn1/web_test/.bzr/branch/last-revision:18 <email address hidden>
./fxdoji/trunk/.bzr/branch/last-revision:9 <email address hidden>
./gltest/sdl_keyboard/.bzr/branch/last-revision:56 <email address hidden>
./gltest/trunk/.bzr/branch/last-revision:0 <email address hidden>
./gltest/leapfrog/.bzr/branch/last-revision:45 <email address hidden>
./gltest/speedup_test/.bzr/branch/last-revision:54 <email address hidden>
./oxygen/trunk/.bzr/branch/last-revision:5 <email address hidden>
./wintail/trunk/.bzr/branch/last-revision:2 svn-v4:21518882-096e-4640-a5a2-d65b9d639c66:trunk/wintail:195
./showwindow/.bzr/branch/last-revision:2 svn-v4:21518882-096e-4640-a5a2-d65b9d639c66:trunk/sw:38
./bpnn/trunk/.bzr/branch/last-revision:1 jason.spashett@sw-dev-jspash1-20090908110627-ol7oqkbwg543e3q7
./bpnn/morning-star/.bzr/branch/last-revision:2 jason.spashett@sw-dev-jspash1-20090908162044-fzigjkplnvqcf5ol
./bpnn/contrib/.bzr/branch/last-revision:1 jason.spashett@sw-dev-jspash1-20090908110627-ol7oqkbwg543e3q7
./java3d/trunk/.bzr/branch/last-revision:9 <email address hidden>

I cant' see a pattern at the oment.

Revision history for this message
Jason Spashett (jspashett) wrote :

This doesn't seem right though:

jason@ionrift:/srv/bzr/repo/.bzr$ du -sh repository repository.backup
124K repository
61M repository.backup

I must have upgraded at some point 4th April it seems.
drwxr-sr-x 7 jason jason 4.0K Apr 4 16:29 repository.backup

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 578005] Re: bzr: ERROR: The branch X has no revision None.

Indeed that doesn't seem right - a failed upgrade could show that

Do you have a .bzr.backup ?

Revision history for this message
Jason Spashett (jspashett) wrote :

Unfortunatly not. I am sure I did have one at one point though, I probably removed it. It appears I can actualy push to some of these branches, and so I sort of didn't notice anything amis for quite a while. Anyway. It looks like I might have lost a few small projects and branches, not to worry.

I did start trying to debug though bzr against my repository to see if I could fix something up manually, but bug #587868 got in the way a little, so I'll see if I can fix that first.

It's a pitty I didn't notice sooner, as now it's hard to say exactly how the repository got into this situation, it was an upgrade but from which repository version I am not sure.

Revision history for this message
Robert Collins (lifeless) wrote :

the repository.backup should be an intact copy
you can try this somewhere else
bzr init-repo --no-trees foo
cd foo
rm -rf .bzr/repository
cp -a $repository.backupwhereveritis .bzr/repository

then copy in some of your broken branches and see if they work Get
them all working in this temp repository.

finally, bzr push them back to your new one.

So nothing should be lost.

-Rob

Revision history for this message
Jason Spashett (jspashett) wrote :

Thanks Rob. That does indeed work, so I should be able to fetch everything back to as it was. I thought perhaps I needed the .bzr.backup aswell, but apparently not.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Bazaar because there has been no activity for 60 days.]

Changed in bzr:
status: Incomplete → Expired
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.