# HG changeset patch # User Ian Dees # Date 1242603754 25200 # Node ID 705b88c9f3d1a3154976c01a56b1d2b4d4cd5b6c # Parent 5b702bbf078f30ae0355539151e89b7dfcca0f72 remote branches to server diff -r 5b702bbf078f -r 705b88c9f3d1 git_handler.py --- a/git_handler.py Sun May 17 15:29:18 2009 -0700 +++ b/git_handler.py Sun May 17 16:42:34 2009 -0700 @@ -175,12 +175,15 @@ c = self.map_git_get(hex(self.repo.changelog.tip())) self.git.set_ref('refs/heads/master', c) + # Make sure there's a refs/remotes/remote_name/name + # for every refs/heads/name def update_remote_references(self, remote_name): + self.git.set_remote_refs(self.local_heads(), remote_name) + + def local_heads(self): 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) + return dict(filter(is_local_head, refs.items())) def export_git_objects(self): self.ui.status(_("exporting git objects\n")) @@ -389,6 +392,13 @@ if local_ref: if not local_ref == refs[ref_name]: changed[ref_name] = local_ref + + # Also push any local branches not on the server yet + for head in self.local_heads(): + if not head in refs: + ref = self.git.ref(head) + changed[head] = ref + return changed # takes a list of shas the server wants and shas the server has