← Back to team overview

dulwich-users team mailing list archive

Re: dulwich porcelain

 

Am Thursday, den 13.09.2012, 13:46 -0700 schrieb Mark Mikofski:
> Sorry for top posting but my cellphone is wonky.
> 
> So when I use send pack, I use determine wants all from report.object
> store, which is returning an empty list, but it should be a dictionary
> of refs:shas. When the receive pack handler is called it tries to get
> the keys and bam, attribute error.
> 
> But I have 4 refs/shas in .git/objects by using bin/dulwich commit?
So, the signature for determine_wants is different for send_pack and
receive_pack. determine_wants_all is meant to be used with the pack
receiver.

We should really rename the determine_wants argument for send_pack to
avoid this confusion.

Cheers,

jelmer

> 
> ______________________________________________________________________
> From: Mark Mikofski <bwanamarko@xxxxxxxxx>; 
> To: dulwich-users@xxxxxxxxxxxxxxxxxxx
> <dulwich-users@xxxxxxxxxxxxxxxxxxx>; 
> Subject: Re: [Dulwich-users] dulwich porcelain 
> Sent: Wed, Sep 12, 2012 7:54:48 PM 
> 
> >> Hi,
> 
> >> 
> >> I am new to dulwich, which is really cool, but I've started to
> develop 
> > an android app using python for android (py4a) [1]
> >> and the scripting layer for android (sl4a) [2], mostly for my own
> use. So 
> > far it works great; I can init new repos, do
> >> commits, and I can pull from my remote repos, but there are a few
> things 
> > I'm still struggling with, and so I was
> >> wondering if there was any development or documentation anywhere of
> more 
> > porcelain commands, such as git-reset,
> >> git-checkout and git-push. I have found a few odds and ends,
> stackoverflow, 
> > hg-git, etc. Thanks.
> >> 
> >> 
> >> [1] http://code.google.com/p/python-for-android/
> >> [2] http://code.google.com/p/android-scripting/
> >> 
> >> _______________________________________________
> >> 
> >> 
> > 
> > I've been combing the archives and am slowly putting together a
> collection 
> > of porcelain functions on github
> > https://github.com/mikofski/dulwichPorcelain 
> > 
> > 
> > So far I have dulwich_checkout.py which is based on this stack
> overflow answer
> > http://stackoverflow.com/a/6640755/1020470 
> > 
> > 
> > Also I'm working on push based on this thread in dulwich launchpad
> > https://lists.launchpad.net/dulwich-users/msg00118.html 
> > 
> 
> 
> Here is the push code:
> 
>     from dulwich.repo import Repo
>     from dulwich.client import get_transport_and_path
>     from getopt import getopt
>     import sys
> 
> 
>     def push(args):
>         opts, args = getopt(args, "", [])
>         opts = dict(opts)
>         client, path = get_transport_and_path(args.pop(0))
>         r = Repo(".")
>         objsto = r.object_store
>         refs = client.send_pack(path,
>                                 objsto.determine_wants_all,
>                                 objsto.generate_pack_contents,
>                                 sys.stdout.write)
> 
> and the traceback pushing to github over SSH
> (git@xxxxxxxxxx:mikofski/dulwichPorcelain) reads something like
> this ...
> 
> 
> in client.py at line 289:
>     for refname in set(new_refs.keys() + old_refs.keys()):
>     'List' has no attribute 'keys'
> from client.py at line 450-451:
>     (have, want) = self._handle_receive_pack_head(proto,
>         negotiated_capabilities, old_refs, new_refs)
> from dulwich_push at line 16:
>     progress=sys.stdout.write
> from stdin at line 1
>     push(['git@xxxxxxxxxx:mikofski/dulwichPorcelain'])
> 
> any thoughts? I haven't delved into it but I think it may be that ssh
> isn't supported for send_pack? Maybe I'll try https.
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~dulwich-users
> Post to    : dulwich-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dulwich-users
> More help  : https://help.launchpad.net/ListHelp
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~dulwich-users
> Post to     : dulwich-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dulwich-users
> More help   : https://help.launchpad.net/ListHelp

Attachment: signature.asc
Description: This is a digitally signed message part


Follow ups

References