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 (expand / switch to context 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,7 +1,8 @@
-# $NetBSD: Makefile,v 1.7 2015/09/02 16:52:37 wiz Exp $
+# $NetBSD: Makefile,v 1.8 2015/12/21 13:19:17 richard Exp $
 
 DISTNAME=	mercurial-${VERSION}
 PKGNAME=	${PYPKGPREFIX}-${DISTNAME}
+PKGREVISION=	1
 CATEGORIES=	devel scm
 MASTER_SITES=	https://mercurial.selenic.com/release/
 

cvs diff -r1.27 -r1.28 pkgsrc/devel/py-mercurial/distinfo (expand / switch to context 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 @@
-$NetBSD: distinfo,v 1.27 2015/12/05 11:22:32 wiz Exp $
+$NetBSD: distinfo,v 1.28 2015/12/21 13:19:17 richard Exp $
 
 SHA1 (mercurial-3.6.2.tar.gz) = 1dbf5d9d42f70f1fb0b26f8e659a1b7879bc1533
 RMD160 (mercurial-3.6.2.tar.gz) = 0671aa8429befbc9b049cb640a54d4c810103f56
 SHA512 (mercurial-3.6.2.tar.gz) = 2ad780174a30c39a1482d597466523a133b8c62a3a0eb9ac3b183082e279fc624998a9ffa520abafe5f7afc7d9f4600f443ad4dfa1003bd7fdc6b713040091ed
 Size (mercurial-3.6.2.tar.gz) = 4518349 bytes
+SHA1 (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)