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
1099f702
Commit
1099f702
authored
3 years ago
by
Dan Villiom Podlaski Christiansen
Browse files
Options
Downloads
Patches
Plain Diff
schemes: use proper wrapping for `hg.defaultdest()`
parent
9657f906
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!107
Refactor __init__.py to many modules; use exthelper
Pipeline
#22251
passed
3 years ago
Stage: current
Stage: compat
Stage: upcoming
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hggit/schemes.py
+5
-11
5 additions, 11 deletions
hggit/schemes.py
with
5 additions
and
11 deletions
hggit/schemes.py
+
5
−
11
View file @
1099f702
...
...
@@ -27,7 +27,6 @@
# support for `hg clone localgitrepo`
_oldlocal
=
hg
.
schemes
[
b
'
file
'
]
hgdefaultdest
=
hg
.
defaultdest
def
isgitdir
(
path
):
"""
True if the given file path is a git repo.
"""
...
...
@@ -70,8 +69,8 @@
return
httpgitscheme
def
defaultdest
(
source
):
for
scheme
in
util
.
gitschemes
:
if
source
.
startswith
(
b
'
%s://
'
%
scheme
)
and
source
.
endswith
(
b
'
.git
'
):
return
hgdefaultdest
(
source
[:
-
4
])
@eh.wrapfunction
(
hg
,
b
'
defaultdest
'
)
def
defaultdest
(
orig
,
source
)
:
if
source
.
endswith
(
b
'
.git
'
):
return
orig
(
source
[:
-
4
])
...
...
@@ -77,8 +76,5 @@
if
source
.
endswith
(
b
'
.git
'
):
return
hgdefaultdest
(
source
[:
-
4
])
return
hgdefaultdest
(
source
)
return
orig
(
source
)
@eh.wrapfunction
(
hg
,
b
'
peer
'
)
...
...
@@ -119,8 +115,6 @@
hg
.
schemes
[
b
'
http
'
]
=
_httpgitwrapper
(
hg
.
schemes
[
b
'
http
'
])
hg
.
schemes
[
b
'
file
'
]
=
_local
hg
.
defaultdest
=
defaultdest
# support for `hg clone git://github.com/defunkt/facebox.git`
# also hg clone git+ssh://git@github.com/schacon/simplegit.git
for
_scheme
in
util
.
gitschemes
:
...
...
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