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
bd8fa1a92888
Commit
bd8fa1a92888
authored
15 years ago
by
Scott Chacon
Browse files
Options
Downloads
Plain Diff
Merged in defunkts changes
parents
eb05594fc3c8
52d45a331c92
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
__init__.py
+4
-0
4 additions, 0 deletions
__init__.py
gitrepo.py
+26
-0
26 additions, 0 deletions
gitrepo.py
with
31 additions
and
0 deletions
.gitignore
0 → 100644
+
1
−
0
View file @
bd8fa1a9
*.pyc
This diff is collapsed.
Click to expand it.
__init__.py
+
4
−
0
View file @
bd8fa1a9
...
...
@@ -26,6 +26,10 @@
import
dulwich
from
git_handler
import
GitHandler
# support for `hg clone git://github.com/defunkt/facebox.git`
import
gitrepo
hg
.
schemes
[
'
git
'
]
=
gitrepo
def
gclone
(
ui
,
git_url
,
hg_repo_path
=
None
):
# determine new repo name
if
not
hg_repo_path
:
...
...
This diff is collapsed.
Click to expand it.
gitrepo.py
0 → 100644
+
26
−
0
View file @
bd8fa1a9
from
mercurial
import
hg
,
repo
from
git_handler
import
GitHandler
class
gitrepo
(
repo
.
repository
):
def
__init__
(
self
,
ui
,
path
,
create
=
True
):
dest
=
hg
.
defaultdest
(
path
)
if
dest
.
endswith
(
'
.git
'
):
dest
=
dest
[:
-
4
]
# create the local hg repo on disk
dest_repo
=
hg
.
repository
(
ui
,
dest
,
create
=
True
)
# fetch the initial git data
git
=
GitHandler
(
dest_repo
,
ui
)
git
.
remote_add
(
'
origin
'
,
path
)
git
.
fetch
(
'
origin
'
)
# checkout the tip
node
=
git
.
remote_head
(
'
origin
'
)
hg
.
update
(
dest_repo
,
node
)
# exit to stop normal `hg clone` flow
raise
SystemExit
instance
=
gitrepo
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