add_inventory_by_delta raises errors.RootMissing()

Bug #593545 reported by shuerhaaken
This bug report is a duplicate of:  Bug #688459: RootMissing error on branch. Edit Remove
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Bazaar Hg Plugin
Fix Committed
Low
Jelmer Vernooij
Launchpad itself
In Progress
Medium
Jelmer Vernooij

Bug Description

A few days ago I added my project, that is using mercurial and is hosted on googlecode to launchpad.
Unfortunately the code import does not work.
The project:
https://launchpad.net/xnoise

There also the import logs can be found in the code section. They report some problem with code import:
Traceback (most recent call last):
  File "/srv/importd.launchpad.net/production/launchpad-rev-9420/scripts/code-import-worker.py", line 82, in <module>
    sys.exit(script.main())
  File "/srv/importd.launchpad.net/production/launchpad-rev-9420/scripts/code-import-worker.py", line 77, in main
    return import_worker.run()
...

Curtis Hovey (sinzui)
affects: launchpad → launchpad-code
Aaron Bentley (abentley)
Changed in launchpad-code:
importance: Undecided → Medium
status: New → Triaged
Tim Penhey (thumper)
tags: added: code-import
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

There are no code imports for xnoise at the moment; what's the error you're getting?

Changed in bzr-hg:
status: New → Incomplete
Revision history for this message
shuerhaaken (shkn) wrote :

Now I re-added the code import for xnoise and the errors came back:
https://code.launchpad.net/~shkn/xnoise/default

Tim Penhey (thumper)
summary: - mercurial code import seems not to work
+ add_inventory_by_delta raises errors.RootMissing()
tags: added: hg
Revision history for this message
Andi Albrecht (andialbrecht) wrote :

This happens for me too. As with xnoise it's a Mercurial repository hosted at Google Code. The import branch is lp:crunchyfrog

Revision history for this message
Andi Albrecht (andialbrecht) wrote :

For me it turned out that the first commit caused the troubles. IIRC this commit was auto-generated by Google Code and contains no delta (see http://code.google.com/p/crunchyfrog/source/detail?r=43079b00fe0cdca66cdf3f5ba648f5d227cd37e6).

An import using "bzr pull" with bzr-hg plugin worked for me after making the following changes, i.e. ignoring the first revision when it's empty. I bet that this is a very bad hack since it changes commit history and that there are much better approaches :)

=== modified file 'fetch.py'
--- fetch.py 2010-10-11 11:25:55 +0000
+++ fetch.py 2010-11-15 11:40:44 +0000
@@ -375,13 +375,19 @@
     def _add_inventories(self, todo, mapping, pb):
         assert isinstance(todo, list)
         total = len(self._revisions)
+ force_null_revision = False
         # add the actual revisions
         for i, (revid, (manifest, flags)) in enumerate(self._target_overlay.get_manifest_and_flags_by_revids(todo)):
             pb.update("adding inventories", i, len(todo))
             rev = self._revisions[revid]
             files = self._files[rev.revision_id]
             del self._files[rev.revision_id]
- if rev.parent_ids == ():
+ if rev.parent_ids == () and not files and i == 0:
+ force_null_revision = True
+ continue
+ if rev.parent_ids == () or force_null_revision:
+ force_null_revision = False
+ rev.parent_ids = ()
                 basis_revid = NULL_REVISION
             else:
                 basis_revid = rev.parent_ids[0]

Jelmer Vernooij (jelmer)
Changed in bzr-hg:
status: Incomplete → Triaged
Jelmer Vernooij (jelmer)
Changed in bzr-hg:
status: Triaged → Fix Committed
importance: Undecided → Low
Changed in launchpad:
status: Triaged → In Progress
Changed in bzr-hg:
assignee: nobody → Jelmer Vernooij (jelmer)
Changed in launchpad:
assignee: nobody → Jelmer Vernooij (jelmer)
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.