Browse Source

New upstream version 0.19.4

Jelmer Vernooij 6 years ago
parent
commit
976a1a3da4

+ 7 - 0
.coveragerc

@@ -0,0 +1,7 @@
+[run]
+branch = True
+source = dulwich
+
+[report]
+exclude_lines =
+    raise NotImplementedError

+ 23 - 0
.gitignore

@@ -0,0 +1,23 @@
+_trial_temp
+build
+build-pypy
+MANIFEST
+dist
+apidocs
+*,cover
+.testrepository
+*.pyc
+*.pyd
+*.pyo
+*.so
+*~
+*.swp
+*.swh
+*.swn
+*.swo
+docs/tutorial/index.html
+dulwich.egg-info/
+.tox/
+.idea/
+.coverage
+htmlcov/

+ 23 - 0
.mailmap

@@ -0,0 +1,23 @@
+Jelmer Vernooij <jelmer@jelmer.uk>
+Jelmer Vernooij <jelmer@jelmer.uk> <jelmer@jelmer.uk>
+Jelmer Vernooij <jelmer@jelmer.uk> <jelmer@samba.org>
+Jelmer Vernooij <jelmer@jelmer.uk> <jelmer@debian.org>
+Jelmer Vernooij <jelmer@jelmer.uk> <jelmer@canonical.com>
+Jelmer Vernooij <jelmer@jelmer.uk> <jelmer@google.com>
+Martin <gzlist@googlemail.com> <martin.packman@canonical.com>
+Dave Borowitz <dborowitz@google.com> <ddborowitz@gmail.com>
+Dave Borowitz <dborowitz@google.com> <dborowitz@google.com>
+John Carr <john.carr@unrouted.co.uk>
+Mark Mikofski <bwanamarko@yahoo.com> <mark.mikofski@sunpowercorp.com>
+Mark Mikofski <bwanamarko@yahoo.com> <bwana.marko@yahoo.com>
+David Carr <david@carrclan.us>
+Jon Bain <jsbain@yahoo.com> <jsbain@yahoo.com>
+James Westby <jw+debian@jameswestby.net> <jw+debian@jameswestby.net>
+David Keijser <david.keijser@klarna.com> <keijser@gmail.com>
+Benoît HERVIER <khertan@khertan.net> <khertan@khertan.net>
+Ryan Faulkner <rfaulk@yahoo-inc.com> <rfaulkner@wikimedia.org>
+David Bennett <davbennett@google.com> <david@dbinit.com>
+Risto Kankkunen <risto.kankkunen@iki.fi> <risto.kankkunen@f-secure.com>
+Augie Fackler <durin42@gmail.com> <raf@durin42.com>
+Damien Tournoud <damien@commerceguys.com> <damien@platform.sh>
+Marcin Kuźmiński <marcin@python-blog.com> <marcin@python-works.com>

+ 14 - 0
NEWS

@@ -1,3 +1,17 @@
+0.19.4	2018-06-24
+
+ IMPROVEMENTS
+
+  * Add ``porcelain.ls_files``. (Jelmer Vernooij)
+
+  * Add ``Index.items``. (Jelmer Vernooij)
+
+ BUG FIXES
+
+  * Avoid unicode characters (e.g. the digraph ij in my surname) in setup.cfg,
+    since setuptools doesn't deal well with them. See
+    https://github.com/pypa/setuptools/issues/1062. (Jelmer Vernooij, #637)
+
 0.19.3	2018-06-17
 
  IMPROVEMENTS

+ 97 - 3
PKG-INFO

@@ -1,9 +1,103 @@
 Metadata-Version: 2.1
 Name: dulwich
-Version: 0.19.3
-Summary: Python Git Library
+Version: 0.19.4
+Summary: [![Build Status](https://travis-ci.org/dulwich/dulwich.png?branch=master)](https://travis-ci.org/dulwich/dulwich)
+[![Windows Build status](https://ci.appveyor.com/api/projects/status/mob7g4vnrfvvoweb?svg=true)](https://ci.appveyor.com/project/jelmer/dulwich/branch/master)
+
+This is the Dulwich project.
+
+It aims to provide an interface to git repos (both local and remote) that
+doesn't call out to git directly but instead uses pure Python.
+
+**Main website**: [www.dulwich.io](https://www.dulwich.io/)
+
+**License**: Apache License, version 2 or GNU General Public License, version 2 or later.
+
+The project is named after the part of London that Mr. and Mrs. Git live in
+in the particular Monty Python sketch.
+
+Installation
+------------
+
+By default, Dulwich' setup.py will attempt to build and install the optional C
+extensions. The reason for this is that they significantly improve the performance
+since some low-level operations that are executed often are much slower in CPython.
+
+If you don't want to install the C bindings, specify the --pure argument to setup.py::
+
+    $ python setup.py --pure install
+
+or if you are installing from pip::
+
+    $ pip install dulwich --global-option="--pure"
+
+Note that you can also specify --global-option in a
+[requirements.txt](https://pip.pypa.io/en/stable/reference/pip_install/#requirement-specifiers)
+file, e.g. like this::
+
+    dulwich --global-option=--pure
+
+Getting started
+---------------
+
+Dulwich comes with both a lower-level API and higher-level plumbing ("porcelain").
+
+For example, to use the lower level API to access the commit message of the
+last commit:
+
+    >>> from dulwich.repo import Repo
+    >>> r = Repo('.')
+    >>> r.head()
+    '57fbe010446356833a6ad1600059d80b1e731e15'
+    >>> c = r[r.head()]
+    >>> c
+    <Commit 015fc1267258458901a94d228e39f0a378370466>
+    >>> c.message
+    'Add note about encoding.\n'
+
+And to print it using porcelain:
+
+    >>> from dulwich import porcelain
+    >>> porcelain.log('.', max_entries=1)
+    --------------------------------------------------
+    commit: 57fbe010446356833a6ad1600059d80b1e731e15
+    Author: Jelmer Vernooij <jelmer@jelmer.uk>
+    Date:   Sat Apr 29 2017 23:57:34 +0000
+
+    Add note about encoding.
+
+Further documentation
+---------------------
+
+The dulwich documentation can be found in docs/ and
+[on the web](https://www.dulwich.io/docs/).
+
+The API reference can be generated using pydoctor, by running "make pydoctor",
+or [on the web](https://www.dulwich.io/apidocs).
+
+Help
+----
+
+There is a *#dulwich* IRC channel on the [Freenode](https://www.freenode.net/), and
+[dulwich-announce](https://groups.google.com/forum/#!forum/dulwich-announce)
+and [dulwich-discuss](https://groups.google.com/forum/#!forum/dulwich-discuss)
+mailing lists.
+
+Contributing
+------------
+
+For a full list of contributors, see the git logs or [AUTHORS](AUTHORS).
+
+If you'd like to contribute to Dulwich, see the [CONTRIBUTING](CONTRIBUTING.md)
+file and [list of open issues](https://github.com/dulwich/dulwich/issues).
+
+Supported versions of Python
+----------------------------
+
+At the moment, Dulwich supports (and is tested on) CPython 2.7, 3.3, 3.4, 3.5, 3.6 and Pypy.
+
 Home-page: https://www.dulwich.io/
-Author: Jelmer Vernooij
+Author: Jelmer Vernooij
 Author-email: jelmer@jelmer.uk
 License: Apachev2 or later or GPLv2
 Project-URL: Bug Tracker, https://github.com/dulwich/dulwich/issues

+ 10 - 0
bin/dulwich

@@ -605,6 +605,15 @@ class cmd_stash(SuperCommand):
     }
 
 
+class cmd_ls_files(Command):
+
+    def run(self, args):
+        parser = optparse.OptionParser()
+        options, args = parser.parse_args(args)
+        for name in porcelain.ls_files('.'):
+            print(name)
+
+
 class cmd_help(Command):
 
     def run(self, args):
@@ -646,6 +655,7 @@ commands = {
     "help": cmd_help,
     "init": cmd_init,
     "log": cmd_log,
+    "ls-files": cmd_ls_files,
     "ls-remote": cmd_ls_remote,
     "ls-tree": cmd_ls_tree,
     "pack-objects": cmd_pack_objects,

+ 21 - 0
build.cmd

@@ -0,0 +1,21 @@
+@echo off
+:: To build extensions for 64 bit Python 3, we need to configure environment
+:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
+:: MS Windows SDK for Windows 7 and .NET Framework 4
+::
+:: More details at:
+:: https://github.com/cython/cython/wiki/CythonExtensionsOnWindows
+
+IF "%DISTUTILS_USE_SDK%"=="1" (
+    ECHO Configuring environment to build with MSVC on a 64bit architecture
+    ECHO Using Windows SDK 7.1
+    "C:\Program Files\Microsoft SDKs\Windows\v7.1\Setup\WindowsSdkVer.exe" -q -version:v7.1
+    CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release
+    SET MSSdk=1
+    REM Need the following to allow tox to see the SDK compiler
+    SET TOX_TESTENV_PASSENV=DISTUTILS_USE_SDK MSSdk INCLUDE LIB
+) ELSE (
+    ECHO Using default MSVC build environment
+)
+
+CALL %*

+ 15 - 0
devscripts/PREAMBLE.c

@@ -0,0 +1,15 @@
+ * Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
+ * General Public License as public by the Free Software Foundation; version 2.0
+ * or (at your option) any later version. You can redistribute it and/or
+ * modify it under the terms of either of these two licenses.
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * You should have received a copy of the licenses; if not, see
+ * <http://www.gnu.org/licenses/> for a copy of the GNU General Public License
+ * and <http://www.apache.org/licenses/LICENSE-2.0> for a copy of the Apache
+ * License, Version 2.0.

+ 16 - 0
devscripts/PREAMBLE.py

@@ -0,0 +1,16 @@
+# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
+# General Public License as public by the Free Software Foundation; version 2.0
+# or (at your option) any later version. You can redistribute it and/or
+# modify it under the terms of either of these two licenses.
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# You should have received a copy of the licenses; if not, see
+# <http://www.gnu.org/licenses/> for a copy of the GNU General Public License
+# and <http://www.apache.org/licenses/LICENSE-2.0> for a copy of the Apache
+# License, Version 2.0.
+#

+ 3 - 0
devscripts/replace-preamble.sh

@@ -0,0 +1,3 @@
+#!/usr/bin/zsh
+perl -i -p0e "s{\Q$(cat PREAMBLE.py.old)\E}{$(cat devscripts/PREAMBLE.py)}g" dulwich/**/*.py bin/dul*
+perl -i -p0e "s{\Q$(cat PREAMBLE.c.old)\E}{$(cat devscripts/PREAMBLE.c)}g" dulwich/*.c

+ 2 - 0
docs/tutorial/.gitignore

@@ -0,0 +1,2 @@
+*.html
+myrepo

+ 97 - 3
dulwich.egg-info/PKG-INFO

@@ -1,9 +1,103 @@
 Metadata-Version: 2.1
 Name: dulwich
-Version: 0.19.3
-Summary: Python Git Library
+Version: 0.19.4
+Summary: [![Build Status](https://travis-ci.org/dulwich/dulwich.png?branch=master)](https://travis-ci.org/dulwich/dulwich)
+[![Windows Build status](https://ci.appveyor.com/api/projects/status/mob7g4vnrfvvoweb?svg=true)](https://ci.appveyor.com/project/jelmer/dulwich/branch/master)
+
+This is the Dulwich project.
+
+It aims to provide an interface to git repos (both local and remote) that
+doesn't call out to git directly but instead uses pure Python.
+
+**Main website**: [www.dulwich.io](https://www.dulwich.io/)
+
+**License**: Apache License, version 2 or GNU General Public License, version 2 or later.
+
+The project is named after the part of London that Mr. and Mrs. Git live in
+in the particular Monty Python sketch.
+
+Installation
+------------
+
+By default, Dulwich' setup.py will attempt to build and install the optional C
+extensions. The reason for this is that they significantly improve the performance
+since some low-level operations that are executed often are much slower in CPython.
+
+If you don't want to install the C bindings, specify the --pure argument to setup.py::
+
+    $ python setup.py --pure install
+
+or if you are installing from pip::
+
+    $ pip install dulwich --global-option="--pure"
+
+Note that you can also specify --global-option in a
+[requirements.txt](https://pip.pypa.io/en/stable/reference/pip_install/#requirement-specifiers)
+file, e.g. like this::
+
+    dulwich --global-option=--pure
+
+Getting started
+---------------
+
+Dulwich comes with both a lower-level API and higher-level plumbing ("porcelain").
+
+For example, to use the lower level API to access the commit message of the
+last commit:
+
+    >>> from dulwich.repo import Repo
+    >>> r = Repo('.')
+    >>> r.head()
+    '57fbe010446356833a6ad1600059d80b1e731e15'
+    >>> c = r[r.head()]
+    >>> c
+    <Commit 015fc1267258458901a94d228e39f0a378370466>
+    >>> c.message
+    'Add note about encoding.\n'
+
+And to print it using porcelain:
+
+    >>> from dulwich import porcelain
+    >>> porcelain.log('.', max_entries=1)
+    --------------------------------------------------
+    commit: 57fbe010446356833a6ad1600059d80b1e731e15
+    Author: Jelmer Vernooij <jelmer@jelmer.uk>
+    Date:   Sat Apr 29 2017 23:57:34 +0000
+
+    Add note about encoding.
+
+Further documentation
+---------------------
+
+The dulwich documentation can be found in docs/ and
+[on the web](https://www.dulwich.io/docs/).
+
+The API reference can be generated using pydoctor, by running "make pydoctor",
+or [on the web](https://www.dulwich.io/apidocs).
+
+Help
+----
+
+There is a *#dulwich* IRC channel on the [Freenode](https://www.freenode.net/), and
+[dulwich-announce](https://groups.google.com/forum/#!forum/dulwich-announce)
+and [dulwich-discuss](https://groups.google.com/forum/#!forum/dulwich-discuss)
+mailing lists.
+
+Contributing
+------------
+
+For a full list of contributors, see the git logs or [AUTHORS](AUTHORS).
+
+If you'd like to contribute to Dulwich, see the [CONTRIBUTING](CONTRIBUTING.md)
+file and [list of open issues](https://github.com/dulwich/dulwich/issues).
+
+Supported versions of Python
+----------------------------
+
+At the moment, Dulwich supports (and is tested on) CPython 2.7, 3.3, 3.4, 3.5, 3.6 and Pypy.
+
 Home-page: https://www.dulwich.io/
-Author: Jelmer Vernooij
+Author: Jelmer Vernooij
 Author-email: jelmer@jelmer.uk
 License: Apachev2 or later or GPLv2
 Project-URL: Bug Tracker, https://github.com/dulwich/dulwich/issues

+ 10 - 0
dulwich.egg-info/SOURCES.txt

@@ -1,3 +1,6 @@
+.coveragerc
+.gitignore
+.mailmap
 .testr.conf
 .travis.yml
 AUTHORS
@@ -10,19 +13,25 @@ README.md
 README.swift.md
 TODO
 appveyor.yml
+build.cmd
 dulwich.cfg
+requirements.txt
 setup.cfg
 setup.py
 tox.ini
 bin/dul-receive-pack
 bin/dul-upload-pack
 bin/dulwich
+devscripts/PREAMBLE.c
+devscripts/PREAMBLE.py
+devscripts/replace-preamble.sh
 docs/Makefile
 docs/conf.py
 docs/index.txt
 docs/make.bat
 docs/performance.txt
 docs/protocol.txt
+docs/tutorial/.gitignore
 docs/tutorial/Makefile
 docs/tutorial/conclusion.txt
 docs/tutorial/encoding.txt
@@ -72,6 +81,7 @@ dulwich.egg-info/SOURCES.txt
 dulwich.egg-info/dependency_links.txt
 dulwich.egg-info/requires.txt
 dulwich.egg-info/top_level.txt
+dulwich/contrib/README.md
 dulwich/contrib/__init__.py
 dulwich/contrib/paramiko_vendor.py
 dulwich/contrib/release_robot.py

+ 1 - 1
dulwich/__init__.py

@@ -22,4 +22,4 @@
 
 """Python implementation of the Git file formats and protocols."""
 
-__version__ = (0, 19, 3)
+__version__ = (0, 19, 4)

+ 3 - 0
dulwich/contrib/README.md

@@ -0,0 +1,3 @@
+This directory contains code that some may find useful. Code here is not an official
+part of Dulwich, and may no longer work. Unlike the rest of Dulwich, it is not regularly
+tested.

+ 3 - 0
dulwich/index.py

@@ -295,6 +295,9 @@ class Index(object):
     def iteritems(self):
         return self._byname.items()
 
+    def items(self):
+        return self._byname.items()
+
     def update(self, entries):
         for name, value in entries.items():
             self[name] = value

+ 7 - 0
dulwich/porcelain.py

@@ -33,6 +33,7 @@ Currently implemented:
  * diff-tree
  * fetch
  * init
+ * ls-files
  * ls-remote
  * ls-tree
  * pull
@@ -1282,3 +1283,9 @@ def stash_pop(repo):
         from dulwich.stash import Stash
         stash = Stash.from_repo(r)
         stash.pop()
+
+
+def ls_files(repo):
+    """List all files in an index."""
+    with open_repo_closing(repo) as r:
+        return sorted(r.open_index())

+ 15 - 0
dulwich/tests/test_porcelain.py

@@ -1247,6 +1247,21 @@ class LsRemoteTests(PorcelainTestCase):
             porcelain.ls_remote(self.repo.path))
 
 
+class LsFilesTests(PorcelainTestCase):
+
+    def test_empty(self):
+        self.assertEqual([], list(porcelain.ls_files(self.repo)))
+
+    def test_simple(self):
+        # Commit a dummy file then modify it
+        fullpath = os.path.join(self.repo.path, 'foo')
+        with open(fullpath, 'w') as f:
+            f.write('origstuff')
+
+        porcelain.add(repo=self.repo.path, paths=[fullpath])
+        self.assertEqual([b'foo'], list(porcelain.ls_files(self.repo)))
+
+
 class RemoteAddTests(PorcelainTestCase):
 
     def test_new(self):

+ 1 - 0
requirements.txt

@@ -0,0 +1 @@
+urllib3[secure]==1.22

+ 2 - 2
setup.cfg

@@ -1,9 +1,9 @@
 [metadata]
 name = dulwich
-author = Jelmer Vernooij
+author = Jelmer Vernooij
 author_email = jelmer@jelmer.uk
 home-page = https://www.dulwich.io/
-description-file = README.md
+description = file:README.md
 summary = Python Git Library
 classifiers = 
 	Development Status :: 4 - Beta

+ 1 - 1
setup.py

@@ -14,7 +14,7 @@ from distutils.core import Distribution
 import os
 import sys
 
-dulwich_version_string = '0.19.3'
+dulwich_version_string = '0.19.4'
 
 include_dirs = []
 # Windows MSVC support