583 Commits

Author SHA1 Message Date
J. David Ibáñez
94f44feb22 Fix unit tests with Python 2.6 2013-04-18 23:59:34 +02:00
J. David Ibáñez
4cf1fc2371 Make Oid hashable 2013-04-18 23:57:19 +02:00
J. David Ibáñez
f74a211f14 oid: now only accept Oid or hex, not raw
Every method that takes an oid has changed what it accepts.

Before it was (in both Python 2 and 3):

- An Oid object
- An hex oid, represented as a unicode string
- A raw oid, represented as a bytes string

Now the behaviour is different between Python 2 and 3.

Now in Python 2 we take:

- An Oid object
- An hex oid, represented as a bytes or unicode string

Now in Python 3 we take:

- An Oid object
- An hex oid, represented as a unicode string

We have dropt direct support for raw strings. To use a raw string first
build an Oid object: oid = Oid(raw=raw)

We have also dropt support for short raw oids. The Oid constructor takes
full oids, if passed short oids the behavior is undefined.
2013-04-18 20:32:30 +02:00
J. David Ibáñez
571fe8ac44 Merge branch 'master' into oid
Conflicts:
	test/test_repository.py
2013-04-18 18:30:50 +02:00
J. David Ibáñez
611e979113 Now Repository.head returns a reference (#203)
Now Repository.head behaves like libgit2's git_repository_head, it
returns the resolved reference. These two lines are equivalent:

  ref = repo.head
  ref = repo.lookup_reference('HEAD').resolve()

Before it returned a commit.
2013-04-17 08:16:43 +02:00
J. David Ibáñez
072cc38607 Release v0.18.0 v0.18.0 2013-04-16 22:46:53 +02:00
J. David Ibáñez
70fdabc433 revparse_single: add support for non ascii paths (#207) 2013-04-15 11:21:17 +02:00
J. David Ibáñez
a9c9f25ce2 oid: support rich comparisons (less than, etc.) 2013-04-14 14:08:46 +02:00
J. David Ibáñez
bd54d28157 Fix for Python3, and add Oid cmp tests 2013-04-14 13:50:09 +02: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
f8544cc514 Add Oid type 2013-04-13 13:04:52 +02:00
J. David Ibáñez
c7785e591b py_str_to_git_oid: check length of raw oid (#205) 2013-04-13 12:00:18 +02:00
Benjamin Pollack
41bae9150d Fix docstring for Commit.init 2013-04-10 15:26:13 +00:00
J. David Ibáñez
5c0dee16b8 Merge remote-tracking branch 'cboos/THREADSAFE-compatibility' 2013-04-05 15:12:09 +02:00
Christian Boos
c5b6bce886 pygit2 should work with libgit2 built with THREADSAFE=ON 2013-04-05 14:40:25 +02:00
Nico von Geyso
69c5e21b8d fixed typo for GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH
thanks to cboos for reporting.
2013-04-05 14:27:49 +02:00
J. David Ibáñez
32e460fe16 docs: complete and improve organization 2013-04-03 19:09:48 +02:00
J. David Ibáñez
30e4367e91 Move header files to src/
This is not a C library, so we don't have a public C API to expose.
2013-03-29 20:23:28 +01:00
J. David Ibáñez
83874bd2d1 Fix py_str_to_git_oid for raw oids 2013-03-27 19:11:10 +01:00
J. David Ibáñez
1654f7ee45 Merge branch 'master' into next 2013-03-27 16:17:07 +01:00
J. David Ibáñez
ad56ac6353 Fix compile with MSVC (issue #199)
And use a macro to make type initialization shorter.
2013-03-27 11:20:53 +01:00
J. David Ibáñez
734db55f58 Fix iterators (issue #198) 2013-03-26 10:58:02 +01:00
J. David Ibáñez
ffc6069a34 Fix for Python 3 2013-03-24 14:04:53 +01:00
J. David Ibáñez
c3ca27fa72 Merge branch 'master' into next
Conflicts:
	include/pygit2/types.h
	src/oid.c
2013-03-23 15:54:12 +01:00
J. David Ibáñez
8588c20943 Fix import (#196) using relative imports 2013-03-13 14:43:44 +01:00
J. David Ibáñez
4abd370ea8 Make bug #196 to show up with Python 2 2013-03-13 14:36:40 +01:00
Nico von Geyso
119d0e0344 added missing unittest.main() for tests_remote.py 2013-03-13 12:48:58 +01:00
Nico von Geyso
4c782f451d fixed non working test for config.set_multivar() 2013-03-13 12:48:34 +01:00
Nico von Geyso
e99573dfb8 reactivated TreeBuilder test 2013-03-12 23:52:42 +01:00
Nico von Geyso
fa8ef0d6d4 Repository_read().data should be binary data 2013-03-12 23:50:44 +01:00
Nico von Geyso
b60f24c127 use utils helper macros/functions through the whole lib
* use to_unicode()/to_unicode_n() for creation of unicode strings
* main support switch to python3 instead of python2 (provide defines for python2)
2013-03-12 16:41:06 +01:00
Nico von Geyso
78cddb6c91 Use basic types for objects and grouped types into groups 2013-03-12 15:31:26 +01:00
Nico von Geyso
f97f58ec56 use PyObject_New() for object instanziation 2013-03-12 15:31:04 +01:00
Nico von Geyso
cd07b9edac remove needless tp_getattro entries 2013-03-12 15:30:18 +01:00
J. David Ibáñez
7bfc37bf34 Merge branch 'master' into next
Conflicts:
	src/repository.c
2013-03-12 08:24:56 +01:00
Nico von Geyso
511b760a56 added tests for notes 2013-03-11 20:48:58 +01:00
Nico von Geyso
a89d55a0f3 added notes in testreop 2013-03-11 20:48:57 +01:00
Nico von Geyso
2328cdef69 added note support
* Repository.create_note()
* Repository.lookup_note()
* Repository.notes() - generator
2013-03-11 20:48:52 +01:00
J. David Ibáñez
4a82a80982 Merge remote-tracking branch 'cholin/features/memory_leaks' 2013-03-11 18:30:29 +01:00
Nico von Geyso
d8bb184a31 diff refactorization 2013-03-11 18:10:29 +01:00
Nico von Geyso
8cb0539858 fixing several memory leaks in pygit2
* fixed several ref counter issues
* us Py_CLEAR through the whole lib
* refactorization
  * Config does not need Repository pointer
    -> No need for cyclic garbage collecter support
2013-03-11 18:10:24 +01:00
Nico von Geyso
8b2abc1ca7 added missing remote header file and fixed instance creation 2013-03-11 18:05:31 +01:00
Nico von Geyso
59680a2b02 added valgrind python suppression file
To start a valgrind memory check use the following command:
  valgrind -v --leak-check=full --suppressions=misc/valgrind-python.supp python -E -tt ./setup.py test

If your python installation is not compiled with valgrind option, you get as well tons of false-positive leaks
in valgrind. Just check for git_* function the the output. Have in my that circular memory dependencies can
 not easily be found with this approach.
2013-03-11 18:05:31 +01:00
Nico von Geyso
00d0f09f43 fixed compiler warnings 2013-03-11 18:05:31 +01:00
Nico von Geyso
4e2fe5b84d added missing remote header file and fixed instance creation 2013-03-10 18:58:42 +01:00
Nico von Geyso
9d0015f096 added valgrind python suppression file
To start a valgrind memory check use the following command:
  valgrind -v --leak-check=full --suppressions=misc/valgrind-python.supp python -E -tt ./setup.py test

If your python installation is not compiled with valgrind option, you get as well tons of false-positive leaks
in valgrind. Just check for git_* function the the output. Have in my that circular memory dependencies can
 not easily be found with this approach.
2013-03-10 18:58:42 +01:00
Nico von Geyso
5ed77671b2 fixed compiler warnings 2013-03-10 18:58:42 +01:00
J. David Ibáñez
98013eb44d Support short (raw) oids 2013-03-10 12:26:32 +01:00
J. David Ibáñez
ad4b4cc4c5 Implement the Repository mapping interface in Python
Add 'Repository.get' and low level 'Repository.git_object_lookup_prefix'
2013-03-09 23:14:17 +01:00
J. David Ibáñez
79b98d8176 Merge branch 'master' into next 2013-03-09 21:17:09 +01:00