mirror of
https://github.com/mnauw/git-remote-hg.git
synced 2025-10-30 16:15:48 +01:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
426ed618b2 | ||
|
|
5f34d049b9 | ||
|
|
ea7e9bf31a | ||
|
|
a3a36883c5 | ||
|
|
0fdd28319a | ||
|
|
dfa3ad5fca | ||
|
|
ebd5bdb111 | ||
|
|
00ac711fb2 |
2
Makefile
2
Makefile
@@ -14,7 +14,7 @@ build:
|
||||
PYTHON=python2 ; \
|
||||
elif python -c 'import mercurial' 2> /dev/null ; then \
|
||||
PYTHON=python ; \
|
||||
else ; \
|
||||
else \
|
||||
echo 'Python with Mercurial not available' >&2 ; \
|
||||
exit 1 ; \
|
||||
fi ; \
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
|
||||
from mercurial import hg, ui, commands, util
|
||||
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 sys
|
||||
@@ -51,7 +56,13 @@ if sys.version_info[0] == 3:
|
||||
stdout = sys.stdout.buffer
|
||||
stderr = sys.stderr.buffer
|
||||
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:
|
||||
class compat(basecompat):
|
||||
# life was simple in those days ...
|
||||
@@ -308,11 +319,11 @@ class GitHgRepo:
|
||||
if not kind in (b'hg', b'git'):
|
||||
warn('skipping unsupported subrepo type %s' % kind)
|
||||
continue
|
||||
if not util.url(src).isabs():
|
||||
if not urlutil.url(src).isabs():
|
||||
parent = self.get_hg_repo_url(remote)
|
||||
if not parent:
|
||||
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.normpath(parent.path)
|
||||
src = bytes(parent)
|
||||
|
||||
@@ -86,7 +86,13 @@ if sys.version_info[0] == 3:
|
||||
stdout = sys.stdout.buffer
|
||||
stderr = sys.stderr.buffer
|
||||
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
|
||||
urljoin = urllib.parse.urljoin
|
||||
else:
|
||||
|
||||
2
setup.py
2
setup.py
@@ -3,7 +3,7 @@
|
||||
import setuptools
|
||||
|
||||
# strip leading v
|
||||
version = 'v1.0.3.1'[1:]
|
||||
version = 'v1.0.4'[1:]
|
||||
|
||||
# check for released version
|
||||
assert (len(version) > 0)
|
||||
|
||||
@@ -65,3 +65,4 @@ export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
|
||||
# maintain backwards compatible default
|
||||
# (as used in remote helper)
|
||||
git config --global init.defaultBranch master
|
||||
git config --global protocol.file.allow always
|
||||
|
||||
Reference in New Issue
Block a user