26 Commits

Author SHA1 Message Date
Carlos Martín Nieto
81104d4df2 pypy3 does not have the AttributeError/TypeError difference 2014-09-06 19:38:16 +02:00
J. David Ibáñez
d7071b88cd Update copyright year 2014-02-04 08:02:12 +01:00
Carlos Martín Nieto
30084e00c4 Add support for pypy
Fortunately pypy provides support for a lot of the CPython API, so the
changes are minimal.

The most important changes are:

- constructors always get a keyword argument dictionary, even if no
  keyword arguments are passed

- trying to assign to a read-only attribute raises TypeError instead of
  AttributeError

Apart from that, pypy does not provide MAXPATHLEN. There is a hack in
place currently, but there is only place that's using that macro, and
there shouldn't be a need for it much longer.

This fixes #209.
2014-01-26 09:52:35 +01:00
Carlos Martín Nieto
500a6793c4 Object: move to use an 'id' attribute instead of 'oid'
This looks like a left-over from the libgit2 misnaming. The current
consensus is that 'oid' is the data type and 'id' is the name of the
attribute.
2014-01-24 11:04:34 +01:00
Brodie Rao
298f941036 tag: add get_object() method
This maps to git_tag_peel().
2013-08-14 20:13:03 -07:00
J. David Ibáñez
406c317572 Return Oid wherever we returned raw oid (bytes) before
Changes:

- Return Oid wherever we returned raw oid (bytes) before
- Now py_str_to_git_oid accepts Oid objects
- Add ability to compare two Oid objects
2013-04-14 12:26:22 +02:00
J. David Ibáñez
29ce23c0d5 Update copyright 2013-03-02 12:16:16 +01:00
J. David Ibáñez
edcd803e7e Remove the __authors__ var from py files 2012-07-18 12:12:04 +02:00
J. David Ibáñez
6195491596 Add/update copyright header of each file
And update my email address.
2012-07-18 12:07:17 +02:00
J. David Ibáñez
d27cf0b687 style: remove trailing white-spaces 2012-06-18 11:22:56 -03:00
J. David Ibáñez
4b0f759cc0 Tag.target now returns the oid (not the object) 2012-02-27 00:13:43 +01:00
J. David Ibáñez
9064b8e038 Introduce the Signature object 2011-11-23 23:48:41 +01:00
Hugh Cole-Baker
160cf64abc Add support for using short hex string prefixes
Allows Repository_getitem, Repository_read(_raw), Repository_create_commit,
Repository_create_tag and Object_read_raw to use short hex strings to
lookup objects.
Also test getting objects from Repository using prefixes, looking up commit
trees and parents by hex prefix, and looking up tag targets by prefix.
Also stop raising TypeError if passing a too-short hex prefix to the
lookup functions, instead use ValueError.
2011-10-22 22:01:16 +01:00
J. David Ibáñez
73af642b8f tags: properly dealloc tags
There were two memory leaks: we were not closing the git_tag object,
and we were not decreasing the refcount on the repo.

This finishes fixing issue #20
2011-10-18 11:27:32 +02:00
J. David Ibáñez
83642a6954 Rename '.sha' to '.hex' 2011-09-02 16:53:17 +02:00
J. David Ibáñez
f09a02a2ee Use UTF-8 encoding in all Python files 2011-08-24 07:42:05 +02:00
J. David Ibáñez
fd5aab4e56 tests: minor coding style fix, use 4 spaces indent 2011-08-24 07:32:21 +02:00
J. David Ibáñez
b84b79acd8 Fix running the tests with Python 3
Now "python3 setup.py test" works.
2011-08-24 00:07:20 +02:00
J. David Ibáñez
7950ee1116 Use Python 3 string literals for the unit tests
Now unit tests are broken.
2011-08-13 22:48:23 +02:00
J. David Ibáñez
b634a19bd4 Update to latest changes in libgit2
Commit.message_short removed, Commit.message_encoding added
2011-08-13 20:36:37 +02:00
J. David Ibáñez
6f2b864619 Change API to create Git objects
Do not allow to create commits, trees, blobs and tags directly from the
constructor. For instance, now calling "Commit(...)" raises an error.
Instead use the create methods of the repository object:

  Before                         Now
  -----------------------------  -----------------------------
  commit = Commit(repo, ...)     sha = repo.create_commit(...)
  tag = Tag(repo, ...)           sha = repo.create_tag(...)

Most often you won't need to get the object just created, but if you
do just call "repo[sha]" afterwards. (Methods to create blobs and trees
are still missing, just like before.)

Similarly the method that creates a tree object from the index file does
not return the tree object anymore, but just its SHA:

  Before                         Now
  -----------------------------  -----------------------------
  tree = index.create_tree()     sha = index.create_tree()
2011-04-11 18:44:49 +02:00
J. David Ibáñez
43ea66b738 Add support for the time offset of the signature 2011-04-08 17:03:41 +02:00
J. David Ibáñez
08d3dcc82e Update unit tests 2011-04-05 12:37:26 +02:00
J. David Ibáñez
c411fd8203 Make pygit2 build against new libgit2 API
There is an small change to the API, the 'tag.target_type' getter has
been removed, just use 'tag.target.type' instead.
2011-03-15 15:29:55 +01:00
J. David Ibañez
fe1540f546 Add index test case for a non-bare repo 2011-02-07 13:28:39 +01:00
Dave Borowitz
e077abe1a6 Add Tag class.
Change-Id: Ia7240e96dd6da69d373f385bde67e8d3aa70f7b1
2010-11-12 13:22:10 -08:00