changeset 35:562fc51b991e

we did the same thing, not sure why it conflicted
author Scott Chacon <schacon@gmail.com>
date Tue, 28 Apr 2009 11:08:54 -0700
parents 48a639cceea6
children c13c5f8e03fd
files dulwich/client.py git_handler.py
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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))
--- 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