8 Commits
v0.4 ... v1.0.1

Author SHA1 Message Date
Mark Nauwelaerts
de95133416 Release v1.0.1 2019-04-27 15:08:20 +02:00
Mark Nauwelaerts
e0b752be8f Move release version management to make stage
... to ensure setup.py does not trip some later time.

Fixes mnauw/git-remote-hg#25
2019-04-27 15:08:20 +02:00
native-api
f050de1bcc Additional installation step in Windows
fixes https://github.com/mnauw/git-remote-hg/issues/23
2019-03-19 20:41:21 +01:00
Mark Nauwelaerts
0bf3db826b Handle platform dependency in atomic file renaming 2019-01-06 15:51:42 +01:00
Mark Nauwelaerts
3698638e98 Always pass forward slash to git
Fixes mnauw/git-remote-hg#22
2019-01-06 15:51:42 +01:00
Mark Nauwelaerts
765f9ae287 Add python pip packaging
Fixes mnauw/git-remote-hg#13
2018-10-14 16:27:51 +02:00
Mark Nauwelaerts
5ddcdd33ec Adjust to Mercurial 4.7 wrt deprecated revlog method 2018-09-09 12:08:29 +02:00
Mark Nauwelaerts
435373ee83 Adjust to Mercurial 4.7 wrt more restricted changectx API
Fixes mnauw/git-remote-hg#18
2018-09-09 12:08:26 +02:00
4 changed files with 85 additions and 6 deletions

View File

@@ -26,4 +26,16 @@ install-doc: doc
install -d -m 755 $(D)$(mandir)/
install -m 644 doc/git-remote-hg.1 $(D)$(mandir)/git-remote-hg.1
.PHONY: all test install install-doc clean
pypi:
version=`git describe --tags ${REV}` && \
sed -i "s/version = .*/version = '$$version'/" setup.py
-rm -rf dist build
python setup.py sdist bdist_wheel
pypi-upload:
twine upload dist/*
pypi-test:
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
.PHONY: all test install install-doc clean pypy pypy-upload

View File

@@ -13,6 +13,13 @@ wget https://raw.github.com/mnauw/git-remote-hg/master/git-remote-hg -O ~/bin/gi
chmod +x ~/bin/git-remote-hg
--------------------------------------
In Windows, you also need to put and an NTFS symbolic link named `python2.exe` somewhere
on your `$PATH` pointing to your Python 2 executable:
--------------------------------------
mklink <path to link> <path to python.exe>
--------------------------------------
That's it :)
Obviously you will need Mercurial installed.

View File

@@ -14,7 +14,7 @@
# "$GIT_DIR/hg/origin/clone/.hg/".
from mercurial import hg, ui, bookmarks, context, encoding
from mercurial import node, error, extensions, discovery, util
from mercurial import node, error, extensions, discovery, util, scmutil
from mercurial import changegroup
import re
@@ -285,10 +285,16 @@ class Parser:
return (user, int(date), -tz)
def fix_file_path(path):
def posix_path(path):
if os.sep == '/':
return path
# even Git for Windows expects forward
return path.replace(os.sep, '/')
# also converts forward slash to backwards slash on Win
path = os.path.normpath(path)
if not os.path.isabs(path):
return path
return os.path.relpath(path, '/')
return posix_path(path)
return posix_path(os.path.relpath(path, '/'))
def export_files(files):
final = []
@@ -629,7 +635,7 @@ def export_ref(repo, name, kind, head):
notes.update(pending_revs)
def export_tag(repo, tag):
export_ref(repo, tag, 'tags', repo[hgref(tag)])
export_ref(repo, tag, 'tags', scmutil.revsingle(repo, hgref(tag)))
def export_bookmark(repo, bmark):
head = bmarks[hgref(bmark)]
@@ -1121,7 +1127,10 @@ def checkheads_bmark(repo, ref, ctx, force):
print "error %s unknown" % ref
return False
if not repo.changelog.descendant(ctx_old.rev(), ctx_new.rev()):
# replaced around Mercurial 4.7
isancestor = repo.changelog.isancestorrev if hasattr(repo.changelog, 'isancestorrev') \
else repo.changelog.descendant
if not isancestor(ctx_old.rev(), ctx_new.rev()):
if force:
print "ok %s forced update" % ref
else:
@@ -1480,6 +1489,11 @@ def do_push_refspec(parser, refspec, revs):
if tmpmarks and os.path.exists(tmpmarks):
if ok and not dry_run:
# the commits made it through, now we can commit
# sigh ... no atomic rename for existing destination on some platform ...
# (use unofficial platform check)
if os.sep != '/':
if os.path.exists(marks):
os.remove(marks)
os.rename(tmpmarks, marks)
revs[:] = nparser.context.revs
else:

46
setup.py Normal file
View File

@@ -0,0 +1,46 @@
# git-remote-hg setuptools script
import setuptools
import subprocess
import sys
import os
# strip leading v
version = 'v1.0.1'
# check for released version
assert (len(version) > 0)
assert (version.find('-') < 0)
long_description = \
"""
'git-remote-hg' is a gitremote protocol helper for Mercurial.
It allows you to clone, fetch and push to and from Mercurial repositories as if
they were Git ones using a hg::some-url URL.
See the homepage for much more explanation.
"""
CLASSIFIERS = [
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"License :: OSI Approved",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
]
setuptools.setup(name="git-remote-hg",
version=version,
author="Mark Nauwelaerts",
author_email="mnauw@users.sourceforge.net",
url="http://github.com/mnauw/git-remote-hg",
description="access hg repositories as git remotes",
long_description=long_description,
license="GPLv2",
keywords="git hg mercurial",
scripts=["git-remote-hg", "git-hg-helper"],
classifiers=CLASSIFIERS
)