mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2025-10-31 16:45:48 +01:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
426ed618b2 | ||
|
|
5f34d049b9 | ||
|
|
ea7e9bf31a | ||
|
|
a3a36883c5 | ||
|
|
0fdd28319a | ||
|
|
dfa3ad5fca | ||
|
|
ebd5bdb111 | ||
|
|
00ac711fb2 | ||
|
|
aadc899982 | ||
|
|
4d38bff053 | ||
|
|
a8cd6a92b3 | ||
|
|
a08ad9d2b4 |
6
Makefile
6
Makefile
@@ -14,9 +14,9 @@ build:
|
|||||||
PYTHON=python2 ; \
|
PYTHON=python2 ; \
|
||||||
elif python -c 'import mercurial' 2> /dev/null ; then \
|
elif python -c 'import mercurial' 2> /dev/null ; then \
|
||||||
PYTHON=python ; \
|
PYTHON=python ; \
|
||||||
fi ; \
|
else \
|
||||||
if [ -n "$$PYTHON" ] ; then \
|
echo 'Python with Mercurial not available' >&2 ; \
|
||||||
PYTHON=python ; \
|
exit 1 ; \
|
||||||
fi ; \
|
fi ; \
|
||||||
mkdir -p bin ; \
|
mkdir -p bin ; \
|
||||||
for s in git-remote-hg git-hg-helper ; do \
|
for s in git-remote-hg git-hg-helper ; do \
|
||||||
|
|||||||
@@ -5,6 +5,11 @@
|
|||||||
|
|
||||||
from mercurial import hg, ui, commands, util
|
from mercurial import hg, ui, commands, util
|
||||||
from mercurial import context, subrepo
|
from mercurial import context, subrepo
|
||||||
|
try:
|
||||||
|
# hg >= 5.8
|
||||||
|
from mercurial.utils import urlutil
|
||||||
|
except ImportError:
|
||||||
|
from mercurial import util as urlutil
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
@@ -51,7 +56,13 @@ if sys.version_info[0] == 3:
|
|||||||
stdout = sys.stdout.buffer
|
stdout = sys.stdout.buffer
|
||||||
stderr = sys.stderr.buffer
|
stderr = sys.stderr.buffer
|
||||||
getcwd = os.getcwdb
|
getcwd = os.getcwdb
|
||||||
getenv = os.getenvb if os.supports_bytes_environ else os.getenv
|
@staticmethod
|
||||||
|
def getenvb(val, default):
|
||||||
|
result = os.getenv(val.decode(), default.decode() if hasattr(default, 'decode') else default)
|
||||||
|
# if result is a string, get bytes instead
|
||||||
|
result = result.encode() if hasattr(result, 'encode') else result
|
||||||
|
return result
|
||||||
|
getenv = os.getenvb if os.supports_bytes_environ else getenvb
|
||||||
else:
|
else:
|
||||||
class compat(basecompat):
|
class compat(basecompat):
|
||||||
# life was simple in those days ...
|
# life was simple in those days ...
|
||||||
@@ -308,11 +319,11 @@ class GitHgRepo:
|
|||||||
if not kind in (b'hg', b'git'):
|
if not kind in (b'hg', b'git'):
|
||||||
warn('skipping unsupported subrepo type %s' % kind)
|
warn('skipping unsupported subrepo type %s' % kind)
|
||||||
continue
|
continue
|
||||||
if not util.url(src).isabs():
|
if not urlutil.url(src).isabs():
|
||||||
parent = self.get_hg_repo_url(remote)
|
parent = self.get_hg_repo_url(remote)
|
||||||
if not parent:
|
if not parent:
|
||||||
die(b'could not determine repo url of %s' % remote)
|
die(b'could not determine repo url of %s' % remote)
|
||||||
parent = util.url(parent)
|
parent = urlutil.url(parent)
|
||||||
parent.path = posixpath.join(parent.path or b'', src)
|
parent.path = posixpath.join(parent.path or b'', src)
|
||||||
parent.path = posixpath.normpath(parent.path)
|
parent.path = posixpath.normpath(parent.path)
|
||||||
src = bytes(parent)
|
src = bytes(parent)
|
||||||
|
|||||||
@@ -86,7 +86,13 @@ if sys.version_info[0] == 3:
|
|||||||
stdout = sys.stdout.buffer
|
stdout = sys.stdout.buffer
|
||||||
stderr = sys.stderr.buffer
|
stderr = sys.stderr.buffer
|
||||||
getcwd = os.getcwdb
|
getcwd = os.getcwdb
|
||||||
getenv = os.getenvb if os.supports_bytes_environ else os.getenv
|
@staticmethod
|
||||||
|
def getenvb(val, default):
|
||||||
|
result = os.getenv(val.decode(), default.decode() if hasattr(default, 'decode') else default)
|
||||||
|
# if result is a string, get bytes instead
|
||||||
|
result = result.encode() if hasattr(result, 'encode') else result
|
||||||
|
return result
|
||||||
|
getenv = os.getenvb if os.supports_bytes_environ else getenvb
|
||||||
urlparse = urllib.parse.urlparse
|
urlparse = urllib.parse.urlparse
|
||||||
urljoin = urllib.parse.urljoin
|
urljoin = urllib.parse.urljoin
|
||||||
else:
|
else:
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -3,7 +3,7 @@
|
|||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
# strip leading v
|
# strip leading v
|
||||||
version = 'v1.0.3'[1:]
|
version = 'v1.0.4'[1:]
|
||||||
|
|
||||||
# check for released version
|
# check for released version
|
||||||
assert (len(version) > 0)
|
assert (len(version) > 0)
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ SHARNESS_BUILD_DIRECTORY="$(mktemp -d)"
|
|||||||
export PATH="${PATH#*:}"
|
export PATH="${PATH#*:}"
|
||||||
rmdir "$SHARNESS_BUILD_DIRECTORY"
|
rmdir "$SHARNESS_BUILD_DIRECTORY"
|
||||||
|
|
||||||
|
if [ -z "$TEST_INSTALLED_SCRIPTS" ] ; then
|
||||||
if [ -n "$PYTHON" ] && "$PYTHON" -c 'import mercurial' 2> /dev/null ; then
|
if [ -n "$PYTHON" ] && "$PYTHON" -c 'import mercurial' 2> /dev/null ; then
|
||||||
: Use chosen Python version
|
: Use chosen Python version
|
||||||
elif python3 -c 'import mercurial' 2> /dev/null ; then
|
elif python3 -c 'import mercurial' 2> /dev/null ; then
|
||||||
@@ -50,6 +51,10 @@ if [ -n "$PYTHON" ] ; then
|
|||||||
export PATH="$TEST_BIN${PATH:+:$PATH}"
|
export PATH="$TEST_BIN${PATH:+:$PATH}"
|
||||||
unset TEST_BIN
|
unset TEST_BIN
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
# The build/install process ensures Python is available
|
||||||
|
test_set_prereq PYTHON
|
||||||
|
fi
|
||||||
|
|
||||||
GIT_AUTHOR_EMAIL=author@example.com
|
GIT_AUTHOR_EMAIL=author@example.com
|
||||||
GIT_AUTHOR_NAME='A U Thor'
|
GIT_AUTHOR_NAME='A U Thor'
|
||||||
@@ -60,3 +65,4 @@ export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
|
|||||||
# maintain backwards compatible default
|
# maintain backwards compatible default
|
||||||
# (as used in remote helper)
|
# (as used in remote helper)
|
||||||
git config --global init.defaultBranch master
|
git config --global init.defaultBranch master
|
||||||
|
git config --global protocol.file.allow always
|
||||||
|
|||||||
Reference in New Issue
Block a user