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

added hack for pushing first branch

parent 12d4f99c
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@
* bookmarks / tip / named branches - mapping policy to Git branches
- tracking branches?
* submodules?
* .gitignore, etc - try to convert?
PUSH
==========
......@@ -30,7 +31,6 @@
MILESTONES
=============
* Hg<->Git<->Hg
- create a repo in Hg
- push to a Git server
......
......@@ -256,7 +256,9 @@
# sort by tree depth, so we write the deepest trees first
dirs = trees.keys()
dirs.sort(lambda a, b: len(b.split('/'))-len(a.split('/')))
dirs.remove('/')
dirs.append('/')
# write all the trees
tree_sha = None
tree_shas = {}
......@@ -289,9 +291,9 @@
except:
raise
# TODO : for now, we'll just push all heads
# TODO : for now, we'll just push all heads that match remote heads
# * we should have specified push, tracking branches and --all
# takes a dict of refs:shas from the server and returns what should be
# pushed up
def get_changed_refs(self, refs):
keys = refs.keys()
......@@ -293,7 +295,9 @@
# * we should have specified push, tracking branches and --all
# takes a dict of refs:shas from the server and returns what should be
# pushed up
def get_changed_refs(self, refs):
keys = refs.keys()
if not keys:
changed = []
if not keys:
return None
......@@ -299,5 +303,9 @@
return None
changed = []
# TODO : this is a huge hack
if keys[0] == 'capabilities^{}': # nothing on the server yet - first push
changed.append(("0"*40, self.git.ref('master'), 'refs/heads/master'))
for ref_name in keys:
parts = ref_name.split('/')
if parts[0] == 'refs': # strip off 'refs/heads'
......
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