← Back to team overview

dulwich-users team mailing list archive

Re: dulwich porcelain

 

>> 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.



References