diff git_handler.py @ 56:5185af4e649a

hg gfetch now works
author Scott Chacon <schacon@gmail.com>
date Wed, 29 Apr 2009 13:55:22 -0700 (2009-04-29)
parents f6e11b9d7562
children 5ed8316d3cfa
line wrap: on
line diff
--- a/git_handler.py
+++ b/git_handler.py
@@ -113,8 +113,9 @@
     def fetch(self, remote_name):
         self.ui.status(_("fetching from : " + remote_name + "\n"))
         self.export_git_objects()
-        self.fetch_pack(remote_name)
-        self.import_git_objects(remote_name)
+        refs = self.fetch_pack(remote_name)
+        if refs:
+            self.import_git_objects(remote_name)
         self.save_map()
 
     def push(self, remote_name):
@@ -386,7 +387,11 @@
             refs = client.fetch_pack(path, determine_wants, graphwalker, f.write, sys.stdout.write)
             f.close()
             commit()
-            self.git.set_remote_refs(refs, remote_name)
+            if refs:
+                self.git.set_remote_refs(refs, remote_name)
+            else:
+                self.ui.status(_("nothing new on the server\n"))
+            return refs
         except:
             f.close()
             raise
@@ -422,8 +427,9 @@
 
         # import each of the commits, oldest first
         for csha in commits:
-            commit = convert_list[csha]
-            self.import_git_commit(commit)
+            if not self.map_hg_get(csha):
+                commit = convert_list[csha]
+                self.import_git_commit(commit)
 
         self.update_hg_bookmarks(remote_name)