Merge tag '0.24.1' into debian/unstable

This commit is contained in:
Ondřej Nový
2016-06-25 22:44:25 +02:00
11 changed files with 118 additions and 44 deletions

View File

@@ -25,6 +25,29 @@ How to install
Changelog
==============
0.24.1 (2016-06-21)
-------------------------
- New ``Repository.listall_reference_objects()``
`#634 <https://github.com/libgit2/pygit2/pull/634>`_
- Fix ``Repository.write_archive(...)``
`#619 <https://github.com/libgit2/pygit2/pull/619>`_
`#621 <https://github.com/libgit2/pygit2/pull/621>`_
- Reproducible builds
`#636 <https://github.com/libgit2/pygit2/pull/636>`_
- Documentation fixes
`#606 <https://github.com/libgit2/pygit2/pull/606>`_
`#607 <https://github.com/libgit2/pygit2/pull/607>`_
`#609 <https://github.com/libgit2/pygit2/pull/609>`_
`#623 <https://github.com/libgit2/pygit2/pull/623>`_
- Test updates
`#629 <https://github.com/libgit2/pygit2/pull/629>`_
0.24.0 (2016-03-05)
-------------------------
@@ -774,7 +797,7 @@ Other: `#331 <https://github.com/libgit2/pygit2/pull/331>`_
Authors
==============
104 developers have contributed at least 1 commit to pygit2::
108 developers have contributed at least 1 commit to pygit2::
J. David Ibáñez Carlos Martín Nieto Nico von Geyso
W. Trevor King Dave Borowitz Daniel Rodríguez Troitiño
@@ -783,19 +806,20 @@ Authors
Matthew Duggan Matthew Gamble Martin Lenders
Petr Hosek Victor Garcia Xavier Delannoy
Yonggang Luo Patrick Steinhardt Valentin Haenel
Michael Jones Bernardo Heynemann John Szakmeister
Vlad Temian Brodie Rao Nicolas Dandrimont
Michael Jones Bernardo Heynemann Brodie Rao
John Szakmeister Vlad Temian Nicolas Dandrimont
David Versmisse Rémi Duraffort Santiago Perez De Rosso
Sebastian Thiel Thom Wiggers Alok Singhal
Fraser Tweedale Han-Wen Nienhuys Leonardo Rhodes
Petr Viktorin Ron Cohen Thomas Kluyver
Alex Chamberlain Alexander Bayandin Amit Bakshi
Andrey Devyatkin Arno van Lumig Ben Davis
Eric Schrijver Greg Fitzgerald Hervé Cauwelier
Huang Huang Ian P. McCullough Jack O'Connor
Jared Flatow Jiunn Haur Lim Jun Omae
Kaarel Kitsemets Kevin KIN-FOO Masud Rahman
Michael Sondergaard Sarath Lakshman Vicent Marti
Dustin Raimondi Eric Schrijver Greg Fitzgerald
Hervé Cauwelier Huang Huang Ian P. McCullough
Igor Gnatenko Jack O'Connor Jared Flatow
Jiunn Haur Lim Jun Omae Kaarel Kitsemets
Kevin KIN-FOO Masud Rahman Michael Sondergaard
Ondřej Nový Sarath Lakshman Vicent Marti
Zoran Zaric Adam Spiers Andrew Chin
András Veres-Szentkirályi Ash Berlin Benjamin Kircher
Benjamin Pollack Bryan O'Sullivan Cam Cope
@@ -810,7 +834,7 @@ Authors
Óscar San José Peter Dave Hello Philippe Ombredanne
Ridge Kennedy Ross Nicoll Rui Abreu Ferreira
Sheeo Soasme Vladimir Rutsky
chengyuhang earl
Yu Jianjian chengyuhang earl
License

View File

@@ -18,7 +18,7 @@ library that has been built against. The version number has a
.. py:data:: LIBGIT2_VER_MAJOR
Integer value of the major version number. For example, for the version
``0.24.0``::
``0.24.1``::
>>> print LIBGIT2_VER_MAJOR
0
@@ -26,7 +26,7 @@ library that has been built against. The version number has a
.. py:data:: LIBGIT2_VER_MINOR
Integer value of the minor version number. For example, for the version
``0.24.0``::
``0.24.1``::
>>> print LIBGIT2_VER_MINOR
24
@@ -34,17 +34,17 @@ library that has been built against. The version number has a
.. py:data:: LIBGIT2_VER_REVISION
Integer value of the revision version number. For example, for the version
``0.24.0``::
``0.24.1``::
>>> print LIBGIT2_VER_REVISION
0
1
.. py:data:: LIBGIT2_VERSION
The libgit2 version number as a string::
>>> print LIBGIT2_VERSION
'0.24.0'
'0.24.1'
Errors
======

View File

@@ -43,11 +43,11 @@ while the last number |lq| *.micro* |rq| auto-increments independently.
As illustration see this table of compatible releases:
+-----------+--------+----------------------------------------+
|**libgit2**| 0.24.0 | 0.23.0, 0.23.1, 0.23.2, 0.23.3, 0.23.4 |
+-----------+--------+----------------------------------------+
|**pygit2** | 0.24.0 | 0.23.0, 0.23.1, 0.23.2, 0.23.3 |
+-----------+--------+----------------------------------------+
+-----------+----------------+----------------------------------------+
|**libgit2**| 0.24.0, 0.24.1 | 0.23.0, 0.23.1, 0.23.2, 0.23.3, 0.23.4 |
+-----------+----------------+----------------------------------------+
|**pygit2** | 0.24.0, 0.24.1 | 0.23.0, 0.23.1, 0.23.2, 0.23.3 |
+-----------+----------------+----------------------------------------+
.. warning::
@@ -64,9 +64,9 @@ directory, do:
.. code-block:: sh
$ wget https://github.com/libgit2/libgit2/archive/v0.23.4.tar.gz
$ tar xzf v0.23.4.tar.gz
$ cd libgit2-0.23.4/
$ wget https://github.com/libgit2/libgit2/archive/v0.24.1.tar.gz
$ tar xzf v0.24.1.tar.gz
$ cd libgit2-0.24.1/
$ cmake .
$ make
$ sudo make install

View File

@@ -4,6 +4,7 @@ References
.. contents::
.. automethod:: pygit2.Repository.listall_reference_objects
.. automethod:: pygit2.Repository.listall_references
.. automethod:: pygit2.Repository.lookup_reference

View File

@@ -37,7 +37,7 @@ from os import getenv
#
# The version number of pygit2
#
__version__ = '0.24.0'
__version__ = '0.24.1'
#

View File

@@ -765,7 +765,7 @@ class Repository(_Repository):
>>> import tarfile, pygit2
>>>> with tarfile.open('foo.tar', 'w') as archive:
>>>> repo = pygit2.Repsitory('.')
>>>> repo.write_archive(archive, repo.head.target)
>>>> repo.write_archive(repo.head.target, archive)
"""
# Try to get a tree form whatever we got
@@ -799,8 +799,8 @@ class Repository(_Repository):
info.mtime = timestamp
info.uname = info.gname = 'root' # just because git does this
if entry.mode == GIT_FILEMODE_LINK:
info.type = archive.SYMTYPE
info.linkname = content
info.type = tarfile.SYMTYPE
info.linkname = content.decode("utf-8")
info.mode = 0o777 # symlinks get placeholder
info.size = 0
archive.addfile(info)

View File

@@ -72,7 +72,7 @@ else:
libgit2_bin, libgit2_include, libgit2_lib = get_libgit2_paths()
pygit2_exts = [os.path.join('src', name) for name in listdir('src')
pygit2_exts = [os.path.join('src', name) for name in sorted(listdir('src'))
if name.endswith('.c')]

View File

@@ -1123,6 +1123,56 @@ out:
}
PyDoc_STRVAR(Repository_listall_reference_objects__doc__,
"listall_reference_objects() -> [Reference, ...]\n"
"\n"
"Return a list with all the reference objects in the repository.");
PyObject *
Repository_listall_reference_objects(Repository *self, PyObject *args)
{
git_reference_iterator *iter;
git_reference *ref = NULL;
int err;
PyObject *list;
list = PyList_New(0);
if (list == NULL)
return NULL;
if ((err = git_reference_iterator_new(&iter, self->repo)) < 0)
return Error_set(err);
while ((err = git_reference_next(&ref, iter)) == 0) {
PyObject *py_ref = wrap_reference(ref, self);
if (py_ref == NULL)
goto error;
err = PyList_Append(list, py_ref);
Py_DECREF(py_ref);
if (err < 0)
goto error;
}
git_reference_iterator_free(iter);
if (err == GIT_ITEROVER)
err = 0;
if (err < 0) {
Py_CLEAR(list);
return Error_set(err);
}
return list;
error:
git_reference_iterator_free(iter);
Py_CLEAR(list);
return NULL;
}
PyDoc_STRVAR(Repository_listall_branches__doc__,
"listall_branches([flag]) -> [str, ...]\n"
"\n"
@@ -1575,8 +1625,8 @@ PyDoc_STRVAR(Repository_reset__doc__,
"\n"
"Resets current head to the provided oid.\n"
"reset_type:\n"
"GIT_RESET_SOFT: resets head to point to oid, but does not modfy working copy, and leaves the changes in the index.\n"
"GIT_RESET_MIXED: resets head to point to oid, but does not modfy working copy. It empties the index too.\n"
"GIT_RESET_SOFT: resets head to point to oid, but does not modify working copy, and leaves the changes in the index.\n"
"GIT_RESET_MIXED: resets head to point to oid, but does not modify working copy. It empties the index too.\n"
"GIT_RESET_HARD: resets head to point to oid, and resets too the working copy and the content of the index.\n");
PyObject *
@@ -1643,6 +1693,7 @@ PyMethodDef Repository_methods[] = {
METHOD(Repository, create_reference_direct, METH_VARARGS),
METHOD(Repository, create_reference_symbolic, METH_VARARGS),
METHOD(Repository, listall_references, METH_NOARGS),
METHOD(Repository, listall_reference_objects, METH_NOARGS),
METHOD(Repository, listall_submodules, METH_NOARGS),
METHOD(Repository, lookup_reference, METH_O),
METHOD(Repository, revparse_single, METH_O),

View File

@@ -58,6 +58,8 @@ PyObject* Repository_create_commit(Repository *self, PyObject *args);
PyObject* Repository_create_tag(Repository *self, PyObject *args);
PyObject* Repository_create_branch(Repository *self, PyObject *args);
PyObject* Repository_listall_references(Repository *self, PyObject *args);
PyObject* Repository_listall_reference_objects(Repository *self,
PyObject *args);
PyObject* Repository_listall_branches(Repository *self, PyObject *args);
PyObject* Repository_lookup_reference(Repository *self, PyObject *py_name);

View File

@@ -42,6 +42,17 @@ LAST_COMMIT = '2be5719152d4f82c7302b1c0932d8e5f0a4a0e98'
class ReferencesTest(utils.RepoTestCase):
def test_list_all_reference_objects(self):
repo = self.repo
refs = [(ref.name, ref.target.hex)
for ref in repo.listall_reference_objects()]
self.assertEqual(sorted(refs),
[('refs/heads/i18n',
'5470a671a80ac3789f1a6a8cefbcf43ce7af0563'),
('refs/heads/master',
'2be5719152d4f82c7302b1c0932d8e5f0a4a0e98')])
def test_list_all_references(self):
repo = self.repo

View File

@@ -188,21 +188,6 @@ class RepositoryTest(utils.RepoTestCase):
end = sys.getrefcount(self.repo)
self.assertEqual(start, end)
def test_remote_callback_typecheck(self):
remote = self.repo.remotes[0]
remote.progress = 5
self.assertRaises(TypeError, remote, 'fetch')
remote = self.repo.remotes[0]
remote.transfer_progress = 5
self.assertRaises(TypeError, remote, 'fetch')
remote = self.repo.remotes[0]
remote.update_tips = 5
self.assertRaises(TypeError, remote, 'fetch')
class EmptyRepositoryTest(utils.EmptyRepoTestCase):
def test_fetch(self):
remote = self.repo.remotes[0]