# HG changeset patch # User Scott Chacon # Date 1240942134 25200 # Node ID 562fc51b991ef26bb71a1fa636ecf837c103cb88 # Parent 48a639cceea6e1712b8e864de9e1b58e9610569b we did the same thing, not sure why it conflicted diff --git a/dulwich/client.py b/dulwich/client.py --- a/dulwich/client.py +++ b/dulwich/client.py @@ -112,19 +112,25 @@ :param generate_pack_contents: Function that can return the shas of the objects to upload. """ + print 'SEND PACK' refs, server_capabilities = self.read_refs() + print refs + print server_capabilities changed_refs = [] # FIXME if not changed_refs: + print 'got here - nooo' self.proto.write_pkt_line(None) return + print 'got here - yay' + print changed_refs self.proto.write_pkt_line("%s %s %s\0%s" % (changed_refs[0][0], changed_refs[0][1], changed_refs[0][2], self.capabilities())) want = [] have = [] for changed_ref in changed_refs[:]: - self.proto.write_pkt_line("%s %s %s" % changed_refs) - want.append(changed_refs[1]) - if changed_refs[0] != "0"*40: - have.append(changed_refs[0]) + self.proto.write_pkt_line("%s %s %s" % changed_ref) + want.append(changed_ref[1]) + if changed_ref[0] != "0"*40: + have.append(changed_ref[0]) self.proto.write_pkt_line(None) shas = generate_pack_contents(want, have, None) write_pack_data(self.write, shas, len(shas)) diff --git a/git_handler.py b/git_handler.py --- a/git_handler.py +++ b/git_handler.py @@ -329,8 +329,10 @@ def import_git_commit(self, commit): print "importing: " + commit.id # TODO : look for HG metadata in the message and use it + # TODO : add extra Git data (committer info) as extras to changeset # TODO : (?) have to handle merge contexts at some point (two parent files, etc) + # TODO : throw IOError for removed files def getfilectx(repo, memctx, f): (e, sha, data) = self.git.get_file(commit, f) e = '' # TODO : make this a real mode @@ -377,13 +379,13 @@ def get_transport_and_path(self, uri): from dulwich.client import TCPGitClient, SSHGitClient, SubprocessGitClient - for handler, transport in (("git://", TCPGitClient), ("git@", SSHGitClient)): + for handler, transport in (("git://", TCPGitClient), ("git@", SSHGitClient), ("git+ssh://", SSHGitClient)): if uri.startswith(handler): if handler == 'git@': host, path = uri[len(handler):].split(":", 1) host = 'git@' + host else: - host, path = uri[len(handler):].split('/', 1) + host, path = uri[len(handler):].split("/", 1) return transport(host), '/' + path # if its not git or git+ssh, try a local url.. return SubprocessGitClient(), uri