no roundtripping support

Bug #544776 reported by David Coles on 2010-03-23
38
This bug affects 8 people
Affects Status Importance Assigned to Milestone
Bazaar Git Plugin
Wishlist
Unassigned

Bug Description

While trying to reproduce a case where bzr --serve on a shared repository branches from the wrong branch, my simple test case crashed.

The script included creates a branch, commits two files, starts a bzr server and a bzr-git server and tries to branch from them. When trying to branch, you get this error:

----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 49108)
Traceback (most recent call last):
  File "/usr/lib/python2.6/SocketServer.py", line 281, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 307, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__
    self.handle()
  File "/usr/lib/python2.6/dist-packages/dulwich/server.py", line 259, in handle
    h.handle()
  File "/usr/lib/python2.6/dist-packages/dulwich/server.py", line 191, in handle
    if len(objects_iter) == 0:
  File "/usr/lib/python2.6/dist-packages/dulwich/object_store.py", line 543, in __len__
    return len(list(self.itershas()))
  File "/usr/lib/python2.6/dist-packages/dulwich/object_store.py", line 517, in itershas
    for sha in self.sha_iter:
  File "/usr/lib/python2.6/dist-packages/dulwich/object_store.py", line 602, in next
    o = self.object_store[sha]
  File "/usr/lib/python2.6/dist-packages/bzrlib/plugins/git/object_store.py", line 269, in __getitem__
    raise KeyError(sha)
KeyError: 'aeac8b060acee50f309eb1f6698a981c50bdf493'

David Coles (dcoles) wrote :
Jelmer Vernooij (jelmer) wrote :

You can't clone a git repository from a bzr branch through bzr serve - bzr-git doesn't support roundtripping yet.

David Coles (dcoles) wrote :

As discussed on IRC with Jelmer, `bzr serve --git` will only work correctly with bzr-git repositories.

Jelmer Vernooij (jelmer) on 2010-04-06
summary: - bzr serve --git crashes with KeyError on clone
+ no roundtripping support
Changed in bzr-git:
status: New → Triaged
importance: Undecided → Wishlist
assignee: nobody → Jelmer Vernooij (jelmer)
Jelmer Vernooij (jelmer) on 2010-08-14
Changed in bzr-git:
status: Triaged → In Progress
Jelmer Vernooij (jelmer) wrote :

FWIW this mostly works now. You can test it by changing the mapping_registry.set_default() call in mapping.py to specify "git-experimental" rather than "git-v1". After that, "bzr push" and "bzr pull" should work.

Please note that this is not stable yet. It may eat your cat. Or, more likely, git commits you create this way may not safely roundtrip back into bzr in the future, and break in the most horrible ways possible.

Changed in bzr-git:
milestone: none → 0.7.0
Jelmer Vernooij (jelmer) wrote :

Please use this for testing only, and don't publish any branches created this way to prevent future fallout.

Davi Arnaut (davi) wrote :

A couple of issues found when testing roundtripping support with lp:mysql-server/5.5:

- Subsequent pushes into the git repository fail with:

ObjectNotLocked: <bzrlib.groupcompress._GCGraphIndex object at 0x7f76c3136c90> is not locked

Pull from the git repository works though.

- bzr push -r N attempts to copy all tags, which later fails if a tag points to a revision that was not pushed.

Davi Arnaut (davi) wrote :

Also, some git operations on the git repository print some error messages:

error: <email address hidden> does not point to a valid object!
error: <email address hidden> does not point to a valid object!
error: <email address hidden> does not point to a valid object!
[…]

On 09/05/2011 03:16 PM, Davi Arnaut wrote:
> A couple of issues found when testing roundtripping support with lp
> :mysql-server/5.5:
>
> - Subsequent pushes into the git repository fail with:
>
> ObjectNotLocked:<bzrlib.groupcompress._GCGraphIndex object at
> 0x7f76c3136c90> is not locked
>
Can you perhaps paste the traceback fror this error if you have it nearby?

Cheers,

Jelmer

Jelmer Vernooij (jelmer) wrote :

On 05/09/11 15:16, Davi Arnaut wrote:
> A couple of issues found when testing roundtripping support with lp
> :mysql-server/5.5:
>
> - Subsequent pushes into the git repository fail with:
>
> ObjectNotLocked:<bzrlib.groupcompress._GCGraphIndex object at
> 0x7f76c3136c90> is not locked
This should be fixed now.

> Pull from the git repository works though.
>
> - bzr push -r N attempts to copy all tags, which later fails if a tag
> points to a revision that was not pushed.
>
This should now also be fixed.

Cheers,

Jelmer

Jelmer Vernooij (jelmer) on 2012-04-08
Changed in bzr-git:
status: In Progress → Triaged
assignee: Jelmer Vernooij (jelmer) → nobody

With the trunk versions of bzr, bzr-git and dulwich I'm currently getting the following backtrace when trying to clone a bzr repo served with `bzr server --git`:

5.455 Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 284, in _handle_request_nobloc
k
    self.process_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 310, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/home/fr710/src/dulwich/dulwich/server.py", line 750, in _make_handler
    return TCPGitRequestHandler(self.handlers, *args, **kwargs)
  File "/home/fr710/src/dulwich/dulwich/server.py", line 730, in __init__
    SocketServer.StreamRequestHandler.__init__(self, *args, **kwargs)
  File "/usr/lib/python2.7/SocketServer.py", line 638, in __init__
    self.handle()
  File "/home/fr710/src/dulwich/dulwich/server.py", line 741, in handle
    h.handle()
  File "/home/fr710/src/dulwich/dulwich/server.py", line 281, in handle
    write_pack_objects(ProtocolFile(None, write), objects_iter)
  File "/home/fr710/src/dulwich/dulwich/pack.py", line 1514, in write_pack_objec
ts
    return write_pack_data(f, num_objects, pack_contents)
  File "/home/fr710/src/dulwich/dulwich/pack.py", line 1529, in write_pack_data
    for type_num, object_id, delta_base, raw in records:
  File "/home/fr710/src/dulwich/dulwich/pack.py", line 1512, in <genexpr>
    (o.type_num, o.sha().digest(), None, o.as_raw_string())
  File "/home/fr710/.bazaar/plugins/git/object_store.py", line 323, in <genexpr>

    return ((self.store[object_id], path) for (object_id, path) in
  File "/home/fr710/.bazaar/plugins/git/object_store.py", line 659, in __getitem
__
    for (kind, type_data) in self.lookup_git_sha(sha):
  File "/home/fr710/.bazaar/plugins/git/object_store.py", line 651, in lookup_gi
t_sha
    return self.lookup_git_shas([sha])[sha]
  File "/home/fr710/.bazaar/plugins/git/object_store.py", line 643, in lookup_gi
t_shas
    self._update_sha_map()
  File "/home/fr710/.bazaar/plugins/git/object_store.py", line 351, in _update_s
ha_map
    raise AssertionError()
AssertionError

The same happens with --allow-writes and for both the v1 and experimental bzr-git mappings.

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

Other bug subscribers