3 Commits
v0.4 ... v1.0.0

Author SHA1 Message Date
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
3 changed files with 70 additions and 4 deletions

View File

@@ -26,4 +26,14 @@ 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:
-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

@@ -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
@@ -629,7 +629,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 +1121,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:

53
setup.py Normal file
View File

@@ -0,0 +1,53 @@
# git-remote-hg setuptools script
import setuptools
import subprocess
import sys
import os
# derive version from git repo
cmd = ["git", "describe", "--tags"]
commit = os.environ.get('REV', None)
if commit:
cmd.append(commit)
process = subprocess.Popen(cmd, stdout=subprocess.PIPE)
version = process.communicate()[0].strip()
# strip leading v
version = version[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
)