Rebuilding shamap crashes if non-git revisions exist in shared repository

Bug #577110 reported by Max Bowsher
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Git Plugin
Fix Released
Medium
Jelmer Vernooij

Bug Description

I have the result of a 'bzr git-import', i.e. a shared repository with multiple git branches, in which I've also made some local branches with bzr. For whatever reason (format change perhaps) the shamap needed to be rebuilt. bzr-git crashed.

I've determined that the problem is that it attempts to build a shamap based on repository.all_revision_ids() (see BazaarObjectStore._update_sha_map), which is of course doomed if some of the revisions are not git revisions.

bzr-git revno 909
dulwich revno 588

Revision history for this message
Max Bowsher (maxb) wrote :
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This isn't a problem for me, updating the shamap works fine in a repository with non-git revisions (bzr-git revno 926).

Can you try again, perhaps after removing the cache first?

Changed in bzr-git:
status: New → Incomplete
Revision history for this message
Max Bowsher (maxb) wrote :

It is still broken:

bzr git-import git://git.debian.org/collab-maint/tortoisehg.git
cd tortoisehg.git
bzr branch lp:~maxb/tortoisehg/ppa
rm -r .bzr/repository/git
cd HEAD
bzr pull git://git.debian.org/collab-maint/tortoisehg.git

bzr: ERROR: exceptions.KeyError: 'No such TDB entry'
   File "/home/maxb/wc/bzr/bzr/2.1/bzrlib/branch.py", line 962, in pull
     possible_transports=possible_transports, *args, **kwargs)
   File "/home/maxb/.bazaar/plugins/git/branch.py", line 510, in pull
     stop_revision, overwrite=overwrite, graph=graph, limit=limit)
   File "/home/maxb/.bazaar/plugins/git/branch.py", line 459, in _update_revisions
     determine_wants, self.source.mapping, limit=limit)
   File "/home/maxb/.bazaar/plugins/git/fetch.py", line 525, in fetch_objects
     [store._lookup_revision_sha1(head) for head in heads])
   File "/home/maxb/.bazaar/plugins/git/object_store.py", line 487, in _lookup_revision_sha1
     return self._cache.idmap.lookup_commit(revid)
   File "/home/maxb/.bazaar/plugins/git/shamap.py", line 530, in lookup_commit
     return sha_to_hex(self.db["commit\0" + revid][:20])
 KeyError: 'No such TDB entry'

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

That works fine here. Are you sure you're using the latest versions of dulwich and bzr-git?

Revision history for this message
Max Bowsher (maxb) wrote :

Yes I am:

~/.bazaar/plugins/git$ bzr revision-info
926 <email address hidden>

(and I have no system-wide bzr-git installation either)

dulwich:
~/wc/bzr/dulwich/trunk$ bzr revision-info
606 git-v1:bf40399d233bae68bd2b7640db18ef0e45ffc564

$ bzr version
Bazaar (bzr) 2.1.3dev
  from bzr checkout /home/maxb/wc/bzr/bzr/2.1
    revision: 4846
    revid: <email address hidden>

Jelmer Vernooij (jelmer)
Changed in bzr-git:
status: Incomplete → Fix Committed
assignee: nobody → Jelmer Vernooij (jelmer)
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
Changed in bzr-git:
milestone: none → 0.5.2
Jelmer Vernooij (jelmer)
Changed in bzr-git:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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