Mon Dec 21 13:19:17 2015 UTC ()
>From upstream https://bz.mercurial-scm.org/show_bug.cgi?id=4943

# Files opened in a+ mode have inconsistent behavior on various
# platforms. Windows requires that a file positioning call be made
# when the file handle transitions between reads and writes. See
# 3686fa2b8eee and the mixedfilemodewrapper in windows.py. On other
# platforms, Python or the platform itself can be buggy. Some versions
# of Solaris have been observed to not append at the end of the file
# if the file was seeked to before the end. See issue4943 for more.
#
# We work around this issue by inserting a seek() before writing.
# Note: This is likely not necessary on Python 3.

bump PKGREVISION
okay'd by wiz@


(richard)
diff -r1.7 -r1.8 pkgsrc/devel/py-mercurial/Makefile
diff -r1.27 -r1.28 pkgsrc/devel/py-mercurial/distinfo
diff -r0 -r1.1 pkgsrc/devel/py-mercurial/patches/patch-mercurial_revlog.py

cvs diff -r1.7 -r1.8 pkgsrc/devel/py-mercurial/Makefile (switch to unified diff)

--- pkgsrc/devel/py-mercurial/Makefile 2015/09/02 16:52:37 1.7
+++ pkgsrc/devel/py-mercurial/Makefile 2015/12/21 13:19:17 1.8
@@ -1,36 +1,37 @@ @@ -1,36 +1,37 @@
1# $NetBSD: Makefile,v 1.7 2015/09/02 16:52:37 wiz Exp $ 1# $NetBSD: Makefile,v 1.8 2015/12/21 13:19:17 richard Exp $
2 2
3DISTNAME= mercurial-${VERSION} 3DISTNAME= mercurial-${VERSION}
4PKGNAME= ${PYPKGPREFIX}-${DISTNAME} 4PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
 5PKGREVISION= 1
5CATEGORIES= devel scm 6CATEGORIES= devel scm
6MASTER_SITES= https://mercurial.selenic.com/release/ 7MASTER_SITES= https://mercurial.selenic.com/release/
7 8
8MAINTAINER= wiz@NetBSD.org 9MAINTAINER= wiz@NetBSD.org
9HOMEPAGE= http://mercurial.selenic.com/ 10HOMEPAGE= http://mercurial.selenic.com/
10COMMENT= Fast, lightweight source control management system 11COMMENT= Fast, lightweight source control management system
11LICENSE= gnu-gpl-v2 OR gnu-gpl-v3 # OR newer 12LICENSE= gnu-gpl-v2 OR gnu-gpl-v3 # OR newer
12 13
13# with this dependency, two zip test cases start working 14# with this dependency, two zip test cases start working
14# http://bz.selenic.com/show_bug.cgi?id=4483 15# http://bz.selenic.com/show_bug.cgi?id=4483
15# http://bz.selenic.com/show_bug.cgi?id=4485 16# http://bz.selenic.com/show_bug.cgi?id=4485
16#BUILD_DEPENDS+= unzip-[0-9]*:../../archivers/unzip 17#BUILD_DEPENDS+= unzip-[0-9]*:../../archivers/unzip
17DEPENDS+= ${PYPKGPREFIX}-curses-[0-9]*:../../devel/py-curses 18DEPENDS+= ${PYPKGPREFIX}-curses-[0-9]*:../../devel/py-curses
18 19
19USE_TOOLS+= gmake msgfmt 20USE_TOOLS+= gmake msgfmt
20 21
21INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 22INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man5
22INSTALLATION_DIRS+= share/doc/mercurial 23INSTALLATION_DIRS+= share/doc/mercurial
23 24
24.include "Makefile.version" 25.include "Makefile.version"
25 26
26do-test: 27do-test:
27 cd ${WRKSRC} && make tests PYTHON=${PYTHONBIN} 28 cd ${WRKSRC} && make tests PYTHON=${PYTHONBIN}
28 29
29post-install: 30post-install:
30 ${INSTALL_DATA} ${WRKSRC}/doc/*.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1 31 ${INSTALL_DATA} ${WRKSRC}/doc/*.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
31 ${INSTALL_DATA} ${WRKSRC}/doc/*.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5 32 ${INSTALL_DATA} ${WRKSRC}/doc/*.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5
32 ${INSTALL_DATA} ${WRKSRC}/README \ 33 ${INSTALL_DATA} ${WRKSRC}/README \
33 ${DESTDIR}${PREFIX}/share/doc/mercurial 34 ${DESTDIR}${PREFIX}/share/doc/mercurial
34 35
35.include "../../lang/python/distutils.mk" 36.include "../../lang/python/distutils.mk"
36.include "../../mk/bsd.pkg.mk" 37.include "../../mk/bsd.pkg.mk"

cvs diff -r1.27 -r1.28 pkgsrc/devel/py-mercurial/distinfo (switch to unified diff)

--- pkgsrc/devel/py-mercurial/distinfo 2015/12/05 11:22:32 1.27
+++ pkgsrc/devel/py-mercurial/distinfo 2015/12/21 13:19:17 1.28
@@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
1$NetBSD: distinfo,v 1.27 2015/12/05 11:22:32 wiz Exp $ 1$NetBSD: distinfo,v 1.28 2015/12/21 13:19:17 richard Exp $
2 2
3SHA1 (mercurial-3.6.2.tar.gz) = 1dbf5d9d42f70f1fb0b26f8e659a1b7879bc1533 3SHA1 (mercurial-3.6.2.tar.gz) = 1dbf5d9d42f70f1fb0b26f8e659a1b7879bc1533
4RMD160 (mercurial-3.6.2.tar.gz) = 0671aa8429befbc9b049cb640a54d4c810103f56 4RMD160 (mercurial-3.6.2.tar.gz) = 0671aa8429befbc9b049cb640a54d4c810103f56
5SHA512 (mercurial-3.6.2.tar.gz) = 2ad780174a30c39a1482d597466523a133b8c62a3a0eb9ac3b183082e279fc624998a9ffa520abafe5f7afc7d9f4600f443ad4dfa1003bd7fdc6b713040091ed 5SHA512 (mercurial-3.6.2.tar.gz) = 2ad780174a30c39a1482d597466523a133b8c62a3a0eb9ac3b183082e279fc624998a9ffa520abafe5f7afc7d9f4600f443ad4dfa1003bd7fdc6b713040091ed
6Size (mercurial-3.6.2.tar.gz) = 4518349 bytes 6Size (mercurial-3.6.2.tar.gz) = 4518349 bytes
 7SHA1 (patch-mercurial_revlog.py) = 2c6ba5325480d6a6c025e00fe7903eb007069e1f

File Added: pkgsrc/devel/py-mercurial/patches/Attic/patch-mercurial_revlog.py
$NetBSD: patch-mercurial_revlog.py,v 1.1 2015/12/21 13:19:17 richard Exp $
https://bz.mercurial-scm.org/show_bug.cgi?id=4943
--- mercurial/revlog.py.orig	2015-12-02 02:18:26.000000000 +0000
+++ mercurial/revlog.py
@@ -13,6 +13,7 @@ and O(changes) merge between branches.
 
 # import stuff from node for others to import from revlog
 import collections
+import os
 from node import bin, hex, nullid, nullrev
 from i18n import _
 import ancestor, mdiff, parsers, error, util, templatefilters
@@ -1426,6 +1427,20 @@ class revlog(object):
         return node
 
     def _writeentry(self, transaction, ifh, dfh, entry, data, link, offset):
+        # Files opened in a+ mode have inconsistent behavior on various
+        # platforms. Windows requires that a file positioning call be made
+        # when the file handle transitions between reads and writes. See
+        # 3686fa2b8eee and the mixedfilemodewrapper in windows.py. On other
+        # platforms, Python or the platform itself can be buggy. Some versions
+        # of Solaris have been observed to not append at the end of the file
+        # if the file was seeked to before the end. See issue4943 for more.
+        #
+        # We work around this issue by inserting a seek() before writing.
+        # Note: This is likely not necessary on Python 3.
+        ifh.seek(0, os.SEEK_END)
+        if dfh:
+            dfh.seek(0, os.SEEK_END)
+
         curr = len(self) - 1
         if not self._inline:
             transaction.add(self.datafile, offset)