dulwich-users team mailing list archive
-
dulwich-users team
-
Mailing list archive
-
Message #00128
Re: Dulwich Pull/Push command?
On Sat, 2010-07-03 at 19:57 +0000, Seth Shelnutt wrote:
> Nevermind about my previous email, I feel dumb. I wasn't actually
> initializing GitClient. My code I have now is,
>
> import os
> from dulwich import *
>
> path = "myrepo"
> if not os.path.exists(path):
> os.makedirs(path)
> if not os.path.exists(os.path.join(path, ".git")):
> r = repo.Repo.init(path)
> else:
> r = os.path.join(path, ".git")
> cl = client.GitClient(True,0,0)
> uri =
> client.get_transport_and_path("git://github.com/Shelnutt2/apptester.git")
> client.GitClient.fetch(cl, uri, r)
>
>
> Which now I am getting the error:
> s.shelnutt@funtoo-64 ~/wine-dev/git-test $ python git-test.py
> Traceback (most recent call last):
> File "git-test.py", line 15, in <module>
> client.GitClient.fetch(cl, uri, r)
> File "/home/s.shelnutt/wine-dev/git-test/dulwich/client.py", line
> 188, in fetch
> determine_wants = target.object_store.determine_wants_all
> AttributeError: 'str' object has no attribute 'object_store'
>
> I've tried to google object_store but I can't really find any
> references to it, so I'm not really sure what the error is, or how to
> go about fixing it. I know that it is trying to store/change the
> attribute which it's saying it doesn't have. But I am not sure how to
> go about adding attributes to variables?
See the implementation of cmd_clone in bin/dulwich. Try something like
this (untested):
client, host_path =
get_transport_and_path("git://github.com/Shelnutt2/apptester.git")
remote_refs = client.fetch(host_path, r,
determine_wants=r.object_store.determine_wants_all,
progress=sys.stdout.write)
Cheers,
Jelmer
Attachment:
signature.asc
Description: This is a digitally signed message part
References