git-update: fixes for running on windows

when running git-update as `py git-update` (which is convenient on
windows), SCRIPTDIR is '' instead of '.'. Fix that with normpath.

Printing emdash (U+2014) doesn't work on windows because it isn't in
cp437. Change it to hyphen.

https://bugzilla.gnome.org/show_bug.cgi?id=774636
This commit is contained in:
Scott D Phillips 2016-11-17 10:55:44 -08:00 committed by Thibault Saunier
parent b45052b60e
commit 978f107a0b

View file

@ -9,7 +9,7 @@ from common import Colors
from common import accept_command from common import accept_command
SCRIPTDIR = os.path.dirname(__file__) SCRIPTDIR = os.path.normpath(os.path.dirname(__file__))
def manifest_get_commits(manifest): def manifest_get_commits(manifest):
@ -84,7 +84,7 @@ def update_repo(repo_name, repo_dir, revision, no_interaction, recurse_i=0):
commit_message = git("show", repository_path=repo_dir).split("\n") commit_message = git("show", repository_path=repo_dir).split("\n")
print(u" -> %s%s%s %s" % (Colors.HEADER, commit_message[0][7:14], Colors.ENDC, print(u" -> %s%s%s - %s" % (Colors.HEADER, commit_message[0][7:14], Colors.ENDC,
commit_message[4].strip())) commit_message[4].strip()))
return True return True