Skip to content
Snippets Groups Projects
Commit 5185af4e authored by Scott Chacon's avatar Scott Chacon
Browse files

hg gfetch now works

parent 4b1fa3d0
No related branches found
No related tags found
No related merge requests found
......@@ -73,10 +73,12 @@
repo.ui.status(_("clearing out the git cache data\n"))
git = GitHandler(repo, ui)
git.clear()
def gfetch(ui, repo):
dest_repo.ui.status(_("pulling from git url\n"))
def gfetch(ui, repo, remote_name='origin'):
repo.ui.status(_("pulling from git url\n"))
git = GitHandler(repo, ui)
git.fetch(remote_name)
commands.norepo += " gclone"
cmdtable = {
"gclone":
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment