Mercurial > hg-git
diff git_handler.py @ 125:5b702bbf078f
local git branches to remotes
author | Ian Dees <undees@gmail.com> |
---|---|
date | Sun, 17 May 2009 15:29:18 -0700 |
parents | 9dafb9ac24ff |
children | 705b88c9f3d1 |
line wrap: on
line diff
--- a/git_handler.py Sun May 17 14:50:50 2009 -0700 +++ b/git_handler.py Sun May 17 15:29:18 2009 -0700 @@ -124,6 +124,7 @@ def push(self, remote_name): self.ui.status(_("pushing to : %s\n") % remote_name) self.export() + self.update_remote_references(remote_name) self.upload_pack(remote_name) def remote_add(self, remote_name, git_url): @@ -174,6 +175,13 @@ c = self.map_git_get(hex(self.repo.changelog.tip())) self.git.set_ref('refs/heads/master', c) + def update_remote_references(self, remote_name): + def is_local_head(item): return item[0].startswith('refs/heads') + refs = self.git.get_refs() + heads = dict(filter(is_local_head, refs.items())) + + self.git.set_remote_refs(heads, remote_name) + def export_git_objects(self): self.ui.status(_("exporting git objects\n")) total = len(self.repo.changelog)