5 Commits

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
4 changed files with 23 additions and 10 deletions

View File

@@ -27,6 +27,8 @@ install-doc: doc
install -m 644 doc/git-remote-hg.1 $(D)$(mandir)/git-remote-hg.1
pypi:
version=`git describe --tags ${REV}` && \
sed -i "s/version = .*/version = '$$version'/" setup.py
-rm -rf dist build
python setup.py sdist bdist_wheel

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

@@ -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 = []
@@ -1483,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:

View File

@@ -5,15 +5,8 @@ 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:]
version = 'v1.0.1'
# check for released version
assert (len(version) > 0)