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
562fc51b
Commit
562fc51b
authored
15 years ago
by
Scott Chacon
Browse files
Options
Downloads
Patches
Plain Diff
we did the same thing, not sure why it conflicted
parent
48a639cc
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
dulwich/client.py
+10
-4
10 additions, 4 deletions
dulwich/client.py
git_handler.py
+4
-2
4 additions, 2 deletions
git_handler.py
with
14 additions
and
6 deletions
dulwich/client.py
+
10
−
4
View file @
562fc51b
...
...
@@ -112,4 +112,5 @@
:param generate_pack_contents: Function that can return the shas of the
objects to upload.
"""
print
'
SEND PACK
'
refs
,
server_capabilities
=
self
.
read_refs
()
...
...
@@ -115,3 +116,5 @@
refs
,
server_capabilities
=
self
.
read_refs
()
print
refs
print
server_capabilities
changed_refs
=
[]
# FIXME
if
not
changed_refs
:
...
...
@@ -116,4 +119,5 @@
changed_refs
=
[]
# FIXME
if
not
changed_refs
:
print
'
got here - nooo
'
self
.
proto
.
write_pkt_line
(
None
)
return
...
...
@@ -118,6 +122,8 @@
self
.
proto
.
write_pkt_line
(
None
)
return
print
'
got here - yay
'
print
changed_refs
self
.
proto
.
write_pkt_line
(
"
%s %s %s
\0
%s
"
%
(
changed_refs
[
0
][
0
],
changed_refs
[
0
][
1
],
changed_refs
[
0
][
2
],
self
.
capabilities
()))
want
=
[]
have
=
[]
for
changed_ref
in
changed_refs
[:]:
...
...
@@ -120,11 +126,11 @@
self
.
proto
.
write_pkt_line
(
"
%s %s %s
\0
%s
"
%
(
changed_refs
[
0
][
0
],
changed_refs
[
0
][
1
],
changed_refs
[
0
][
2
],
self
.
capabilities
()))
want
=
[]
have
=
[]
for
changed_ref
in
changed_refs
[:]:
self
.
proto
.
write_pkt_line
(
"
%s %s %s
"
%
changed_ref
s
)
want
.
append
(
changed_ref
s
[
1
])
if
changed_ref
s
[
0
]
!=
"
0
"
*
40
:
have
.
append
(
changed_ref
s
[
0
])
self
.
proto
.
write_pkt_line
(
"
%s %s %s
"
%
changed_ref
)
want
.
append
(
changed_ref
[
1
])
if
changed_ref
[
0
]
!=
"
0
"
*
40
:
have
.
append
(
changed_ref
[
0
])
self
.
proto
.
write_pkt_line
(
None
)
shas
=
generate_pack_contents
(
want
,
have
,
None
)
write_pack_data
(
self
.
write
,
shas
,
len
(
shas
))
...
...
This diff is collapsed.
Click to expand it.
git_handler.py
+
4
−
2
View file @
562fc51b
...
...
@@ -329,5 +329,6 @@
def
import_git_commit
(
self
,
commit
):
print
"
importing:
"
+
commit
.
id
# TODO : look for HG metadata in the message and use it
# TODO : add extra Git data (committer info) as extras to changeset
# TODO : (?) have to handle merge contexts at some point (two parent files, etc)
...
...
@@ -332,5 +333,6 @@
# TODO : (?) have to handle merge contexts at some point (two parent files, etc)
# TODO : throw IOError for removed files
def
getfilectx
(
repo
,
memctx
,
f
):
(
e
,
sha
,
data
)
=
self
.
git
.
get_file
(
commit
,
f
)
e
=
''
# TODO : make this a real mode
...
...
@@ -377,9 +379,9 @@
def
get_transport_and_path
(
self
,
uri
):
from
dulwich.client
import
TCPGitClient
,
SSHGitClient
,
SubprocessGitClient
for
handler
,
transport
in
((
"
git://
"
,
TCPGitClient
),
(
"
git@
"
,
SSHGitClient
)):
for
handler
,
transport
in
((
"
git://
"
,
TCPGitClient
),
(
"
git@
"
,
SSHGitClient
),
(
"
git+ssh://
"
,
SSHGitClient
)):
if
uri
.
startswith
(
handler
):
if
handler
==
'
git@
'
:
host
,
path
=
uri
[
len
(
handler
):].
split
(
"
:
"
,
1
)
host
=
'
git@
'
+
host
else
:
...
...
@@ -381,9 +383,9 @@
if
uri
.
startswith
(
handler
):
if
handler
==
'
git@
'
:
host
,
path
=
uri
[
len
(
handler
):].
split
(
"
:
"
,
1
)
host
=
'
git@
'
+
host
else
:
host
,
path
=
uri
[
len
(
handler
):].
split
(
'
/
'
,
1
)
host
,
path
=
uri
[
len
(
handler
):].
split
(
"
/
"
,
1
)
return
transport
(
host
),
'
/
'
+
path
# if its not git or git+ssh, try a local url..
return
SubprocessGitClient
(),
uri
...
...
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