217 Commits

Author SHA1 Message Date
J. David Ibáñez
4cdb1a83b4 (issue #56) Remove TreeEntry.to_object
This is one way to enable implementing 'TreeBuilder.get'. It also makes
pygit2 a little lower-level. And makes TreeEntry consistent with IndexEntry,
which lacks such a function.
2012-02-26 19:41:17 +01:00
Amit Bakshi
b1cb51c9d1 Test for pygit2.discover_repository 2012-02-25 18:15:45 -08:00
Amit Bakshi
7ad8f0a8f0 Add discover_repository.
pygit2.discover_repository(path, across_fs = False,
                           ceiling_paths = None)

Add support for git_discover_repository which
searches the given path for the git repository.
2012-02-25 17:33:59 -08:00
Carlos Martín Nieto
cf380cea2a Add tests for TreeBuilder 2012-02-21 12:36:51 +01:00
Carlos Martín Nieto
8b71a8045b Allow a 'source' arg to TreeBuilder() 2012-02-21 12:36:51 +01:00
Carlos Martín Nieto
2044699a53 Add TreeBuilder_write 2012-02-21 12:36:51 +01:00
Carlos Martín Nieto
5d327c7205 Add TreeBuilder_insert 2012-02-21 12:36:51 +01:00
Carlos Martín Nieto
d43577a464 Create the TreeBuilder type 2012-02-21 12:36:38 +01:00
J. David Ibáñez
7e1e8435aa todo: add note about surrogateescape 2012-02-19 17:13:33 +01:00
J. David Ibáñez
b143c0ccde Fix compilation warnings 2012-02-19 09:20:58 +01:00
Yonggang Luo
5da739270a Arrange Tree and Index definition. 2012-02-18 17:10:08 +08:00
Yonggang Luo
5ece88300a Repository_create_tag return error when necessary. 2012-02-18 16:28:35 +08:00
Yonggang Luo
8394dfb814 Remove extra print. 2012-02-16 01:02:55 +08:00
Yonggang Luo
2b4e5504af Get pygit2 can be build under Windows. 2012-02-16 01:00:49 +08:00
J. David Ibáñez
3bf5b4c794 status: new method 'Repository.status_file'
Exposes libgit2 function 'git_status_file'.
2012-02-10 19:38:25 +01:00
J. David Ibáñez
f11a05b610 docs: fix for the previous commit 2012-02-08 23:29:27 +01:00
J. David Ibáñez
a11f3c52a9 docs: use readme file for both github and pypi
The readme file is now written in reStructuredText (instead of
markdown). This is because reST is the only thing pypi understands.

So now the same readme file will be used for pygit2's homepage at github
and pypi:

- https://github.com/libgit2/pygit2
- http://pypi.python.org/pypi/pygit2
2012-02-08 23:21:37 +01:00
J. David Ibáñez
0fa8503f91 Release v0.16.0
Changes since v0.15.1:

- Update to libgit2 v0.16.0
- Improve support for references
- New method Index.read_tree
- Rename Index.create_tree to Index.write_tree
- Fix compilation error with MSVC (issue #53)
- Fix a few segfaults (including issue #55)
v0.16.0
2012-02-06 23:30:00 +01:00
J. David Ibáñez
42006d7153 docs: update talk about signatures 2012-02-06 23:05:19 +01:00
Carlos Martín Nieto
bc7db4ba8a errors: don't segfault if the library didn't set an error
git_lasterror() can return NULL. Passing that to the error formatting
functions leads to a segmentation fault.

Add a wrapper with a generic "no more information" string for the
cases when the library didn't set one.
2012-02-03 18:33:48 +01:00
J. David Ibáñez
39bb5de7c5 Fixing compilation with MSVC (issue #53) 2012-01-25 19:04:16 +01:00
J. David Ibáñez
9d8d2ace64 index: implement Index.read_tree 2012-01-02 23:11:30 +01:00
J. David Ibáñez
550c966111 Rename Index.create_tree to Index.write_tree
Like Git command "git write-tree"
2012-01-02 20:10:28 +01:00
J. David Ibáñez
35ed84cf44 Update to latest changes in libgit2
Now Repository.index also works on bare repositories. Unit tests pass
again.

And fix a memory leak (add a call to git_index_free).
2012-01-02 19:42:49 +01:00
J. David Ibáñez
4a33c7f806 refs: implement reference reload 2011-12-25 10:46:38 +01:00
J. David Ibáñez
73a4a3a649 refs: resolving a direct ref returns the same object
When resolving a direct reference the same Python object is returned,
with the refcount incremented by one. The reference is reloaded.
2011-12-24 17:04:24 +01:00
J. David Ibáñez
584a8b1473 refs: implement reference dealloc 2011-12-20 22:19:15 +01:00
J. David Ibáñez
5986688197 refs: fix segfault when using a deleted reference
Before this patch the code below produced a segfault:

  >>> reference.delete()
  >>> reference.name

Now an exception is raised.
2011-12-19 23:40:27 +01:00
J. David Ibáñez
01cb80b4c8 errors: pass through git_lasterror in several places
And clean up related code a little bit.
2011-12-06 23:36:20 +01:00
J. David Ibáñez
2dee35d1be Update to latest changes in libgit2 2011-12-04 23:38:15 +01:00
J. David Ibáñez
3073a7c3da Return bytes for paths (and encodings) on Python 2 v0.15.1 2011-11-28 23:33:16 +01:00
J. David Ibáñez
1a34bc3b60 Update .gitignore, add test/__pycache__
The __pycache__ folder is genarated by Python 3.2
2011-11-28 22:47:35 +01:00
J. David Ibáñez
3037d26c9d Fix unit tests with Python 3.2 2011-11-27 10:05:58 +01:00
J. David Ibáñez
ee9429217b Start using inline functions
Actually, the Py_LOCAL_INLINE macro only works with Python 3.2, we
should fix this.
2011-11-26 23:57:22 +01:00
J. David Ibáñez
dd33369fba signature: minor test addition 2011-11-26 13:21:40 +01:00
J. David Ibáñez
a50c886cbb signature: add bytes accessors for name/email
Now Signature.email returns unicode. The name and email are available as
byte strings through the Signature._name and Signature._email accessors
respectively. Signature._encoding returns the encoding used in the
signature.
2011-11-25 00:08:39 +01:00
J. David Ibáñez
eafcef38f6 Do not pretend Python 2.5 is supported 2011-11-24 22:26:29 +01:00
J. David Ibáñez
9064b8e038 Introduce the Signature object 2011-11-23 23:48:41 +01:00
J. David Ibáñez
63ab0f3b26 Minor coding style fixes 2011-11-23 23:13:19 +01:00
J. David Ibáñez
cb00e7a6b9 Break reference cycle with repositoy/index 2011-11-22 00:23:54 +01:00
J. David Ibáñez
46ab810636 Use PyObject_New/PyObject_Del 2011-11-20 12:43:28 +01:00
J. David Ibáñez
38f1884b29 tp_alloc already sets no memory error 2011-11-19 19:04:31 +01:00
J. David Ibáñez
fb1ca247f8 Commit.tree, check for no memory error 2011-11-19 17:43:52 +01:00
J. David Ibáñez
ce41de9417 Repository.create_commit, make encoding optional 2011-11-19 09:37:45 +01:00
J. David Ibáñez
1eb0c6a9f0 Fix memory leak in 'Repository.create_tag'
Free the signature.
2011-11-15 23:18:04 +01:00
J. David Ibáñez
3851f725f9 Fix memory leak in 'Repository.create_commit'
Free the signatures.
2011-11-15 00:45:20 +01:00
J. David Ibáñez
8d4c8415da Use file system encoding to decode/encode paths
Instead of UTF-8. This is done for better interoperability with Git.
2011-11-13 12:47:08 +01:00
J. David Ibáñez
4f5298d6b7 Repository.create_commit supports message encoding
Now the 'Repository.create_commit' method expects one more argument,
the message encoding. If 'None', it defaults to UTF-8.
2011-11-12 20:13:28 +01:00
J. David Ibáñez
9fadd57445 Fix typo in error string 2011-11-12 00:13:31 +01:00
J. David Ibáñez
81c0ed3281 Python 3: fix 'Error_set_py_obj' 2011-10-23 15:09:55 +02:00