pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/py-hg-fastimport hg-fastimport: New upstream, up...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/731a6ecdc725
branches:  trunk
changeset: 447063:731a6ecdc725
user:      roy <roy%pkgsrc.org@localhost>
date:      Mon Feb 15 14:39:15 2021 +0000

description:
hg-fastimport: New upstream, update to version 0.1.1

* Supports Mercurial 5.6+ and Python 3.6+
* Keeps support for Python 2.7
* No external dependencies other than Mercurial and Python
* Optionally uses SQLite database for faster blob imports

diffstat:

 devel/py-hg-fastimport/Makefile                                   |   32 +-
 devel/py-hg-fastimport/PLIST                                      |   43 ++-
 devel/py-hg-fastimport/distinfo                                   |   12 +-
 devel/py-hg-fastimport/patches/patch-hgfastimport_____init____.py |   46 ---
 devel/py-hg-fastimport/patches/patch-hgfastimport_hgimport.py     |  134 ----------
 5 files changed, 49 insertions(+), 218 deletions(-)

diffs (298 lines):

diff -r a8da37383b58 -r 731a6ecdc725 devel/py-hg-fastimport/Makefile
--- a/devel/py-hg-fastimport/Makefile   Mon Feb 15 14:29:41 2021 +0000
+++ b/devel/py-hg-fastimport/Makefile   Mon Feb 15 14:39:15 2021 +0000
@@ -1,33 +1,19 @@
-# $NetBSD: Makefile,v 1.14 2021/02/06 08:01:18 wiz Exp $
+# $NetBSD: Makefile,v 1.15 2021/02/15 14:39:15 roy Exp $
 
-DISTNAME=      danielj7-hg-fastimport-d41a42894dfa
-PKGNAME=       ${PYPKGPREFIX}-hg-fastimport-20170211
-PKGREVISION=   2
+DISTNAME=      hg-fastimport-0.1.1
+PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=    devel
-MASTER_SITES=  -https://bitbucket.org/danielj7/hg-fastimport/get/v20170211.tar.bz2
-EXTRACT_SUFX=  .tar.bz2
+MASTER_SITES=  https://roy.marples.name/downloads/hg-fastimport/
+EXTRACT_SUFX=  .tar.xz
 
-MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
-HOMEPAGE=      https://www.mercurial-scm.org/wiki/FastImportExtension
+MAINTAINER=    roy%NetBSD.org@localhost
+HOMEPAGE=      https://mercurial.selenic.com/wiki/FastImportExtension
 COMMENT=       Mercurial extension for importing from a git fast-import stream
 LICENSE=       gnu-gpl-v2
 
-DEPENDS+=      ${PYPKGPREFIX}-fastimport>=0.9.6nb1:../../devel/py-fastimport
-DEPENDS+=      ${PYPKGPREFIX}-mercurial-[0-9]*:../../devel/py-mercurial
+DEPENDS+=      ${PYPKGPREFIX}-mercurial>=5.1:../../devel/py-mercurial
 
-USE_LANGUAGES= # none
-
-INSTALLATION_DIRS+=    ${PYSITELIB}/hgfastimport share/doc/py-hg-fastimport
-
-PYTHON_VERSIONS_ACCEPTED=      27
 PY_PATCHPLIST=                 yes
 
-do-build:
-
-do-install:
-       ${INSTALL_SCRIPT} ${WRKSRC}/hgfastimport/*.py ${DESTDIR}${PREFIX}/${PYSITELIB}/hgfastimport
-       ${INSTALL_DATA} ${WRKSRC}/README.txt ${DESTDIR}${PREFIX}/share/doc/py-hg-fastimport
-       ${PY_COMPILE_ALL} ${DESTDIR}${PREFIX}/${PYSITELIB}/hgfastimport
-
-.include "../../lang/python/extension.mk"
+.include "../../lang/python/distutils.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r a8da37383b58 -r 731a6ecdc725 devel/py-hg-fastimport/PLIST
--- a/devel/py-hg-fastimport/PLIST      Mon Feb 15 14:29:41 2021 +0000
+++ b/devel/py-hg-fastimport/PLIST      Mon Feb 15 14:39:15 2021 +0000
@@ -1,8 +1,35 @@
-@comment $NetBSD: PLIST,v 1.2 2017/07/22 16:16:25 joerg Exp $
-${PYSITELIB}/hgfastimport/__init__.py
-${PYSITELIB}/hgfastimport/__init__.pyc
-${PYSITELIB}/hgfastimport/hgechoprocessor.py
-${PYSITELIB}/hgfastimport/hgechoprocessor.pyc
-${PYSITELIB}/hgfastimport/hgimport.py
-${PYSITELIB}/hgfastimport/hgimport.pyc
-share/doc/py-hg-fastimport/README.txt
+@comment $NetBSD: PLIST,v 1.3 2021/02/15 14:39:15 roy Exp $
+${PYSITELIB}/${EGG_FILE}
+${PYSITELIB}/hgext3rd/fastimport/__init__.py
+${PYSITELIB}/hgext3rd/fastimport/__init__.pyc
+${PYSITELIB}/hgext3rd/fastimport/__init__.pyo
+${PYSITELIB}/hgext3rd/fastimport/hgechoprocessor.py
+${PYSITELIB}/hgext3rd/fastimport/hgechoprocessor.pyc
+${PYSITELIB}/hgext3rd/fastimport/hgechoprocessor.pyo
+${PYSITELIB}/hgext3rd/fastimport/hgimport.py
+${PYSITELIB}/hgext3rd/fastimport/hgimport.pyc
+${PYSITELIB}/hgext3rd/fastimport/hgimport.pyo
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/__init__.py
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/__init__.pyc
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/__init__.pyo
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/commands.py
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/commands.pyc
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/commands.pyo
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/dates.py
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/dates.pyc
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/dates.pyo
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/errors.py
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/errors.pyc
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/errors.pyo
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/helpers.py
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/helpers.pyc
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/helpers.pyo
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/parser.py
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/parser.pyc
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/parser.pyo
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/processor.py
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/processor.pyc
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/processor.pyo
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/reftracker.py
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/reftracker.pyc
+${PYSITELIB}/hgext3rd/fastimport/vendor/python_fastimport/reftracker.pyo
diff -r a8da37383b58 -r 731a6ecdc725 devel/py-hg-fastimport/distinfo
--- a/devel/py-hg-fastimport/distinfo   Mon Feb 15 14:29:41 2021 +0000
+++ b/devel/py-hg-fastimport/distinfo   Mon Feb 15 14:39:15 2021 +0000
@@ -1,8 +1,6 @@
-$NetBSD: distinfo,v 1.5 2021/01/09 15:30:03 roy Exp $
+$NetBSD: distinfo,v 1.6 2021/02/15 14:39:15 roy Exp $
 
-SHA1 (danielj7-hg-fastimport-d41a42894dfa.tar.bz2) = 8820358107c9de776d6250052a3f15ecccfbcd44
-RMD160 (danielj7-hg-fastimport-d41a42894dfa.tar.bz2) = c6d0f6654509632f3b8266f7a4da519ff6789542
-SHA512 (danielj7-hg-fastimport-d41a42894dfa.tar.bz2) = fc207c90721dc5f32d477bfbd5c4d7634f9a16c28d6e21254bbd942cd4ad7053dbcfd3f0fed91ee797759203f4196985d5bc3132618c58331c06a8fa764124b3
-Size (danielj7-hg-fastimport-d41a42894dfa.tar.bz2) = 30701 bytes
-SHA1 (patch-hgfastimport_____init____.py) = c3d9b92a1c609f1ee979b836c79a3759038c987b
-SHA1 (patch-hgfastimport_hgimport.py) = cb630c9a8e19ea37fcbf8bae0beae485bfa96b0b
+SHA1 (hg-fastimport-0.1.1.tar.xz) = f4d9cb4dfe47458314a3b449fdb824439430f727
+RMD160 (hg-fastimport-0.1.1.tar.xz) = 3b6b112023342374a1fd848c8d5df048eddcea26
+SHA512 (hg-fastimport-0.1.1.tar.xz) = 98d03f30630fcbbd607d34ef817433578315096c32ce7a6328e0e3d16107df2e01d622cff21aef0bd31e791a1e7fb806300ec347f94d9b2722b4aaede1a4a26d
+Size (hg-fastimport-0.1.1.tar.xz) = 44836 bytes
diff -r a8da37383b58 -r 731a6ecdc725 devel/py-hg-fastimport/patches/patch-hgfastimport_____init____.py
--- a/devel/py-hg-fastimport/patches/patch-hgfastimport_____init____.py Mon Feb 15 14:29:41 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-$NetBSD: patch-hgfastimport_____init____.py,v 1.2 2021/01/09 15:30:03 roy Exp $
-
---- hgfastimport/__init__.py.orig      2017-02-12 01:21:40.000000000 +0000
-+++ hgfastimport/__init__.py
-@@ -4,7 +4,7 @@ from __future__ import absolute_import
- from mercurial import (
-     encoding,
-     util,
--    cmdutil,
-+    commands,
- )
- 
- from mercurial.i18n import _
-@@ -19,7 +19,7 @@ from .hgimport import fastimport_source
- 
- # XXX sort options copied straight from hgext/convert/__init__.py
- cmdtable = {}
--command = cmdutil.command(cmdtable)
-+command = commands.command
- 
- testedwith = '4.1'
- 
-@@ -27,7 +27,11 @@ testedwith = '4.1'
- @command("fastimport",
-          [('', 'branchsort', None, _('try to sort changesets by branches')),
-           ('', 'datesort', None, _('try to sort changesets by date')),
--          ('', 'sourcesort', None, _('preserve source changesets order'))],
-+          ('', 'sourcesort', None, _('preserve source changesets order')),
-+          ('', 'compress', False, _('compress temporary blob files')),
-+          ('', 'blob-tree', '', _('path for the blob file tree, defaults to .hg/blobs')),
-+          ('', 'blob-tree-depth', 2, _('depth of the blob file tree')),
-+          ('', 'fallback-message-encoding', '', _('encoding to try for non-UTF-8 messages'))],
-          _('hg fastimport SOURCE ...'),
-          norepo=False)
- def fastimport(ui, repo, *sources, **opts):
-@@ -55,8 +59,8 @@ def fastimport(ui, repo, *sources, **opt
-     encoding.encoding = 'UTF-8'
- 
-     # sink is the current repo, src is the list of fastimport streams
--    destc = hg.mercurial_sink(ui, repo.root)
--    srcc = fastimport_source(ui, repo, sources)
-+    destc = hg.mercurial_sink(ui, 'hg', repo.root)
-+    srcc = fastimport_source(ui, repo, sources, opts['fallback_message_encoding'], opts['compress'], opts['blob_tree_depth'], opts['blob_tree'])
- 
-     # XXX figuring out sortmode copied straight from hgext/convert/convcmd.py
-     defaultsort = 'branchsort'          # for efficiency and consistency
diff -r a8da37383b58 -r 731a6ecdc725 devel/py-hg-fastimport/patches/patch-hgfastimport_hgimport.py
--- a/devel/py-hg-fastimport/patches/patch-hgfastimport_hgimport.py     Mon Feb 15 14:29:41 2021 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-$NetBSD: patch-hgfastimport_hgimport.py,v 1.2 2017/07/25 16:12:56 joerg Exp $
-
---- hgfastimport/hgimport.py.orig      2017-02-12 01:21:40.000000000 +0000
-+++ hgfastimport/hgimport.py
-@@ -24,6 +24,12 @@ import os
- import shutil
- import stat
- import sys
-+import gzip
-+import itertools
-+
-+def grouper(iterable, n, fillvalue=None):
-+    args = [iter(iterable)] * n
-+    return itertools.izip_longest(fillvalue=fillvalue, *args)
- 
- from hgext.convert import common, hg as converthg
- from mercurial import util
-@@ -31,6 +37,8 @@ from mercurial.i18n import _
- 
- from fastimport import processor, parser
- 
-+from hashlib import sha256
-+
- # convertor source objects had a getmode() method up to Mercurial 1.5,
- # but in 1.6 it was merged with getfile()
- HAVE_GETMODE = hasattr(converthg.mercurial_source, 'getmode')
-@@ -39,11 +47,12 @@ class fastimport_source(common.converter
-     """Interface between the fastimport processor below and Mercurial's
-     normal conversion infrastructure.
-     """
--    def __init__(self, ui, repo, sources):
-+    def __init__(self, ui, repo, sources, fallback_message_encoding, compress, blob_tree_depth, blob_tree):
-         self.ui = ui
-         self.sources = sources
--        self.processor = HgImportProcessor(ui, repo)
-+        self.processor = HgImportProcessor(ui, repo, compress, blob_tree_depth, blob_tree)
-         self.parsed = False
-+        self.fallback_message_encoding = fallback_message_encoding
- 
-     # converter_source methods
- 
-@@ -138,7 +147,7 @@ class fastimport_source(common.converter
-             else:
-                 infile = open(source, 'rb')
-             try:
--                p = parser.ImportParser(infile)
-+                p = parser.ImportParser(infile, message_fallback_encoding = self.fallback_message_encoding)
-                 self.processor.process(p.iter_commands)
-             finally:
-                 if infile is not sys.stdin:
-@@ -150,7 +159,7 @@ class HgImportProcessor(processor.Import
-     
-     tagprefix = "refs/tags/"
- 
--    def __init__(self, ui, repo):
-+    def __init__(self, ui, repo, compress, blob_tree_depth, blob_tree):
-         super(HgImportProcessor, self).__init__()
-         self.ui = ui
-         self.repo = repo
-@@ -168,6 +177,10 @@ class HgImportProcessor(processor.Import
-         self.numblobs = 0               # for progress reporting
-         self.blobdir = None
- 
-+        self.compress = compress
-+        self.blob_tree = blob_tree
-+        self.blob_tree_depth = blob_tree_depth
-+
-     def setup(self):
-         """Setup before processing any streams."""
-         pass
-@@ -187,12 +200,24 @@ class HgImportProcessor(processor.Import
-     def _getblobfilename(self, blobid):
-         if self.blobdir is None:
-             raise RuntimeError("no blobs seen, so no blob directory created")
--        # XXX should escape ":" for windows
--        return os.path.join(self.blobdir, "blob-" + blobid)
-+        h = sha256(blobid).hexdigest()
-+        h_comp = list(grouper(h, 3, ''))
-+        if len(h_comp) > self.blob_tree_depth:
-+            h_comp = h_comp[:self.blob_tree_depth] + [''.join(list(itertools.chain(*h_comp[self.blob_tree_depth:])))]
-+        #self.ui.status("mapping blobid %s to %s\n" % (blobid, h))
-+        return os.path.join(self.blobdir, *[''.join(x) for x in h_comp])
- 
-     def getblob(self, fileid):
-         (commitid, blobid) = fileid
--        f = open(self._getblobfilename(blobid), "rb")
-+        fn = self._getblobfilename(blobid)
-+        try:
-+            if self.compress:
-+                f = gzip.open(fn, "rb")
-+            else:
-+                f = open(fn, "rb")
-+        except:
-+            self.ui.status("missing blob %s for fileid %s\n" % (fn, fileid))
-+            raise
-         try:
-             return f.read()
-         finally:
-@@ -200,13 +225,23 @@ class HgImportProcessor(processor.Import
- 
-     def writeblob(self, blobid, data):
-         if self.blobdir is None:        # no blobs seen yet
--            self.blobdir = os.path.join(self.repo.root, ".hg", "blobs")
--            os.mkdir(self.blobdir)
-+            if self.blob_tree:
-+                self.blobdir = self.blob_tree
-+            else:
-+                self.blobdir = os.path.join(self.repo.root, ".hg", "blobs")
- 
-         fn = self._getblobfilename(blobid)
--        blobfile = open(fn, "wb")
--        #self.ui.debug("writing blob %s to %s (%d bytes)\n"
-+        try:
-+            os.makedirs(os.path.dirname(fn))
-+        except OSError:
-+            pass
-+
-+        #self.ui.status("writing blob %s to %s (%d bytes)\n"
-         #              % (blobid, fn, len(data)))
-+        if self.compress:
-+            blobfile = gzip.open(fn, "wb", 3)
-+        else:
-+            blobfile = open(fn, "wb")
-         blobfile.write(data)
-         blobfile.close()
- 
-@@ -449,3 +484,7 @@ class HgImportCommitHandler(processor.Co
-         # copy oldname to newname and delete oldname
-         self.copies[filecmd.new_path] = filecmd.old_path
-         self.modified.append((filecmd.old_path, None))
-+
-+    def deleteall_handler(self, filecmd):
-+        # Ignore for now.
-+        pass



Home | Main Index | Thread Index | Old Index