pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/devel/py-fastimport



Module Name:    pkgsrc
Committed By:   joerg
Date:           Tue Jul 25 16:10:53 UTC 2017

Modified Files:
        pkgsrc/devel/py-fastimport: Makefile distinfo
Added Files:
        pkgsrc/devel/py-fastimport/patches: patch-fastimport_parser.py

Log Message:
Add an option for patching up the encoding of commit messages.
Bump revision.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 pkgsrc/devel/py-fastimport/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/devel/py-fastimport/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/devel/py-fastimport/patches/patch-fastimport_parser.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/devel/py-fastimport/Makefile
diff -u pkgsrc/devel/py-fastimport/Makefile:1.5 pkgsrc/devel/py-fastimport/Makefile:1.6
--- pkgsrc/devel/py-fastimport/Makefile:1.5     Fri Jul 14 10:26:50 2017
+++ pkgsrc/devel/py-fastimport/Makefile Tue Jul 25 16:10:53 2017
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.5 2017/07/14 10:26:50 adam Exp $
+# $NetBSD: Makefile,v 1.6 2017/07/25 16:10:53 joerg Exp $
 
 DISTNAME=      fastimport-0.9.6
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
+PKGREVISION=   1
 CATEGORIES=    devel scm
 MASTER_SITES=  ${MASTER_SITE_PYPI:=f/fastimport/}
 

Index: pkgsrc/devel/py-fastimport/distinfo
diff -u pkgsrc/devel/py-fastimport/distinfo:1.3 pkgsrc/devel/py-fastimport/distinfo:1.4
--- pkgsrc/devel/py-fastimport/distinfo:1.3     Fri Jul 14 10:26:50 2017
+++ pkgsrc/devel/py-fastimport/distinfo Tue Jul 25 16:10:53 2017
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.3 2017/07/14 10:26:50 adam Exp $
+$NetBSD: distinfo,v 1.4 2017/07/25 16:10:53 joerg Exp $
 
 SHA1 (fastimport-0.9.6.tar.gz) = b6d52ae8cc1d76c1db8d4f416fc4b334ad5fe568
 RMD160 (fastimport-0.9.6.tar.gz) = 1ca2b8486c5b6b7a76bbeca6b967c78dd4211aca
 SHA512 (fastimport-0.9.6.tar.gz) = cc38c1218d65ef4a9e3a68d8af3fadf98c7cc0dcd8075b338b8f492d25765bc2fe2247000868fd3c95e1f7f4c2b9a05964ef7b4f9196c2777f6a7941f127f416
 Size (fastimport-0.9.6.tar.gz) = 33333 bytes
+SHA1 (patch-fastimport_parser.py) = 830a12da3ef6939cfd37624eb7765f40a0d0ee8a

Added files:

Index: pkgsrc/devel/py-fastimport/patches/patch-fastimport_parser.py
diff -u /dev/null pkgsrc/devel/py-fastimport/patches/patch-fastimport_parser.py:1.1
--- /dev/null   Tue Jul 25 16:10:53 2017
+++ pkgsrc/devel/py-fastimport/patches/patch-fastimport_parser.py       Tue Jul 25 16:10:53 2017
@@ -0,0 +1,45 @@
+$NetBSD: patch-fastimport_parser.py,v 1.1 2017/07/25 16:10:53 joerg Exp $
+
+--- fastimport/parser.py.orig  2016-04-18 18:09:28.000000000 +0000
++++ fastimport/parser.py
+@@ -265,7 +265,7 @@ _WHO_RE = re.compile(br'([^<]*)<(.*)>')
+ class ImportParser(LineBasedParser):
+ 
+     def __init__(self, input_stream, verbose=False, output=sys.stdout,
+-        user_mapper=None, strict=True):
++        user_mapper=None, strict=True, message_fallback_encoding = None):
+         """A Parser of import commands.
+ 
+         :param input_stream: the file-like object to read from
+@@ -283,6 +283,7 @@ class ImportParser(LineBasedParser):
+         # We auto-detect the date format when a date is first encountered
+         self.date_parser = None
+         self.features = {}
++        self.message_fallback_encoding = message_fallback_encoding
+ 
+     def warning(self, msg):
+         sys.stderr.write("warning line %d: %s\n" % (self.lineno, msg))
+@@ -368,6 +369,11 @@ class ImportParser(LineBasedParser):
+                 break
+         committer = self._get_user_info(b'commit', b'committer')
+         message = self._get_data(b'commit', b'message')
++        if self.message_fallback_encoding:
++            try:
++                message.decode('UTF-8')
++            except:
++                message = message.decode(self.message_fallback_encoding).encode('UTF-8')
+         from_ = self._get_from()
+         merges = []
+         while True:
+@@ -432,6 +438,11 @@ class ImportParser(LineBasedParser):
+         tagger = self._get_user_info(b'tag', b'tagger',
+                 accept_just_who=True)
+         message = self._get_data(b'tag', b'message')
++        if self.message_fallback_encoding:
++            try:
++                message.decode('UTF-8')
++            except:
++                message = message.decode(self.message_fallback_encoding).encode('UTF-8')
+         return commands.TagCommand(name, from_, tagger, message)
+ 
+     def _get_mark_if_any(self):



Home | Main Index | Thread Index | Old Index