Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hg-pull-mirror-test2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
heptapod
Testing Projects
hg-pull-mirror-test2
Commits
f0a3918a
Commit
f0a3918a
authored
17 years ago
by
Patrick Mezard
Browse files
Options
Downloads
Patches
Plain Diff
convert: fail if an external required tool is not found
parent
5bff70ff
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
hgext/convert/common.py
+6
-0
6 additions, 0 deletions
hgext/convert/common.py
hgext/convert/cvs.py
+4
-1
4 additions, 1 deletion
hgext/convert/cvs.py
hgext/convert/darcs.py
+3
-1
3 additions, 1 deletion
hgext/convert/darcs.py
hgext/convert/git.py
+4
-1
4 additions, 1 deletion
hgext/convert/git.py
with
17 additions
and
3 deletions
hgext/convert/common.py
+
6
−
0
View file @
f0a3918a
# common code for the convert extension
import
base64
import
cPickle
as
pickle
from
mercurial
import
util
def
encodeargs
(
args
):
def
encodearg
(
s
):
...
...
@@ -15,6 +16,11 @@
s
=
base64
.
decodestring
(
s
)
return
pickle
.
loads
(
s
)
def
checktool
(
exe
,
name
=
None
):
name
=
name
or
exe
if
not
util
.
find_exe
(
exe
):
raise
util
.
Abort
(
'
cannot find required
"
%s
"
tool
'
%
name
)
class
NoRepo
(
Exception
):
pass
SKIPREV
=
'
SKIP
'
...
...
This diff is collapsed.
Click to expand it.
hgext/convert/cvs.py
+
4
−
1
View file @
f0a3918a
...
...
@@ -3,7 +3,7 @@
import
os
,
locale
,
re
,
socket
from
mercurial
import
util
from
common
import
NoRepo
,
commit
,
converter_source
from
common
import
NoRepo
,
commit
,
converter_source
,
checktool
class
convert_cvs
(
converter_source
):
def
__init__
(
self
,
ui
,
path
,
rev
=
None
):
...
...
@@ -13,6 +13,9 @@
if
not
os
.
path
.
exists
(
cvs
):
raise
NoRepo
(
"
couldn
'
t open CVS repo %s
"
%
path
)
for
tool
in
(
'
cvsps
'
,
'
cvs
'
):
checktool
(
tool
)
self
.
changeset
=
{}
self
.
files
=
{}
self
.
tags
=
{}
...
...
This diff is collapsed.
Click to expand it.
hgext/convert/darcs.py
+
3
−
1
View file @
f0a3918a
# darcs support for the convert extension
from
common
import
NoRepo
,
commit
,
converter_source
from
common
import
NoRepo
,
commit
,
converter_source
,
checktool
from
mercurial.i18n
import
_
from
mercurial
import
util
import
os
,
shutil
,
tempfile
...
...
@@ -24,6 +24,8 @@
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
path
,
'
_darcs
'
,
'
inventory
'
)):
raise
NoRepo
(
"
couldn
'
t open darcs repo %s
"
%
path
)
checktool
(
'
darcs
'
)
if
ElementTree
is
None
:
raise
util
.
Abort
(
_
(
"
Python ElementTree module is not available
"
))
...
...
This diff is collapsed.
Click to expand it.
hgext/convert/git.py
+
4
−
1
View file @
f0a3918a
...
...
@@ -3,7 +3,7 @@
import
os
from
mercurial
import
util
from
common
import
NoRepo
,
commit
,
converter_source
from
common
import
NoRepo
,
commit
,
converter_source
,
checktool
class
convert_git
(
converter_source
):
# Windows does not support GIT_DIR= construct while other systems
...
...
@@ -31,6 +31,9 @@
path
+=
"
/.git
"
if
not
os
.
path
.
exists
(
path
+
"
/objects
"
):
raise
NoRepo
(
"
couldn
'
t open GIT repo %s
"
%
path
)
checktool
(
'
git-rev-parse
'
,
'
git
'
)
self
.
path
=
path
def
getheads
(
self
):
...
...
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