Date: Tue, 28 May 2019 20:01:03 +0000 (UTC) From: "Carlos J. Puga Medina" <cpm@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r502909 - in head/devel/py-gitless: . files Message-ID: <201905282001.x4SK13dH052081@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cpm Date: Tue May 28 20:01:03 2019 New Revision: 502909 URL: https://svnweb.freebsd.org/changeset/ports/502909 Log: - Fix gl crash after upgrade pygit2 to 0.27.4 While here, pet portlint. Added: head/devel/py-gitless/files/ head/devel/py-gitless/files/patch-gitless_core.py (contents, props changed) Modified: head/devel/py-gitless/Makefile Modified: head/devel/py-gitless/Makefile ============================================================================== --- head/devel/py-gitless/Makefile Tue May 28 19:52:07 2019 (r502908) +++ head/devel/py-gitless/Makefile Tue May 28 20:01:03 2019 (r502909) @@ -3,8 +3,8 @@ PORTNAME= gitless PORTVERSION= 0.8.6 -PORTREVISION= 1 DISTVERSIONPREFIX= v +PORTREVISION= 2 CATEGORIES= devel python PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} Added: head/devel/py-gitless/files/patch-gitless_core.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/py-gitless/files/patch-gitless_core.py Tue May 28 20:01:03 2019 (r502909) @@ -0,0 +1,55 @@ +--- gitless/core.py.orig 2019-05-28 19:39:17 UTC ++++ gitless/core.py +@@ -58,6 +58,13 @@ GL_STATUS_TRACKED = 2 + GL_STATUS_IGNORED = 3 + + ++def error_on_none(path): ++ """Raise a KeyError if the ```path``` argument is None.""" ++ if path is None: ++ raise KeyError('path') ++ return path ++ ++ + def init_repository(url=None): + """Creates a new Gitless's repository in the cwd. + +@@ -67,7 +74,7 @@ def init_repository(url=None): + """ + cwd = os.getcwd() + try: +- pygit2.discover_repository(cwd) ++ error_on_none(pygit2.discover_repository(cwd)) + raise GlError('You are already in a Gitless repository') + except KeyError: # Expected + if not url: +@@ -108,7 +115,7 @@ class Repository(object): + def __init__(self): + """Create a Repository out of the current working repository.""" + try: +- path = pygit2.discover_repository(os.getcwd()) ++ path = error_on_none(pygit2.discover_repository(os.getcwd())) + except KeyError: + raise NotInRepoError('You are not in a Gitless\'s repository') + +@@ -1333,10 +1340,18 @@ OpCb = collections.namedtuple( + 'OpCb', ['apply_ok', 'apply_err', 'save', 'restore_ok']) + + def stdout(p): +- return p.stdout.decode(ENCODING) ++ try: ++ pstdout = p.stdout.decode(ENCODING) ++ except AttributeError: ++ pstdout = p.stdout ++ return pstdout + + def stderr(p): +- return p.stderr.decode(ENCODING) ++ try: ++ pstderr = p.stderr.decode(ENCODING) ++ except AttributeError: ++ pstderr = p.stderr ++ return pstderr + + def walker(git_repo, target, reverse): + flags = pygit2.GIT_SORT_TOPOLOGICAL | pygit2.GIT_SORT_TIME
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905282001.x4SK13dH052081>