Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
hg-git
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
hg-git
Commits
fcfb4db8
Commit
fcfb4db8
authored
15 years ago
by
Scott Chacon
Browse files
Options
Downloads
Patches
Plain Diff
added hack for pushing first branch
parent
12d4f99c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
TODO.txt
+1
-1
1 addition, 1 deletion
TODO.txt
git_handler.py
+12
-4
12 additions, 4 deletions
git_handler.py
with
13 additions
and
5 deletions
TODO.txt
+
1
−
1
View file @
fcfb4db8
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
git_handler.py
+
12
−
4
View file @
fcfb4db8
...
...
@@ -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'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment