1000 Commits

Author SHA1 Message Date
Carlos Martín Nieto
db218fae3f Remote: get rid of the C code
This code has been obsoleted by the CFFI-using code. Some credentials
code remains in C due to the clone functionality making use of it.
2014-04-14 11:42:51 +02:00
Carlos Martín Nieto
cf2703998e Remote: add documentation strings
Now that it has the features of the old implementation, let's add
documentation on how to use it.
2014-04-14 11:42:51 +02:00
Carlos Martín Nieto
2d1615dd29 Remote: add support for transfer and update_tips though CFFI 2014-04-14 11:42:51 +02:00
Carlos Martín Nieto
4ef3be18cc Remote: support credentials via CFFI 2014-04-14 11:42:51 +02:00
Carlos Martín Nieto
c76c3f0195 Start implementing remotes with CFFI
This moves enough code into python with CFFI to pass the test_remotes
unit tests. There is no credentials support yet.

There is a small change in the return value of Remote.fetch() in that we
now return a TransferProgress object instead of extracting a few values
into a dictionary.
2014-04-14 11:42:51 +02:00
J. David Ibáñez
d882af8f52 Get ready to release 0.20.3 v0.20.3 2014-04-02 22:28:18 +02:00
Carlos Martín Nieto
114e300b08 Adjust to options changes
We can now use a git_buf to extract the search path.
2014-04-01 19:56:10 +02:00
Carlos Martín Nieto
55037c23a3 Adjust to the merge changes
There is no more MergeResult type. Instead, the user can use
Repository.merge_analysis() to get an overview of their options and call
git_merge() when they mean to merge.

The git_merge() function now also performs a checkout.
2014-04-01 19:48:20 +02:00
Carlos Martín Nieto
a870a59f2a Adjust to option struct naming change 2014-04-01 19:47:48 +02:00
Carlos Martín Nieto
e5f6798f67 Adjust to oid -> id renaming 2014-04-01 19:47:48 +02:00
Carlos Martín Nieto
dd6fc972dd Adjust to the git_buf changes
We no longer need the max-path define, so we can get rid of that and the
pypy checking.
2014-04-01 19:47:48 +02:00
Carlos Martín Nieto
9cec62d2e1 Blame: orig_ is now filled 2014-04-01 19:47:48 +02:00
Carlos Martín Nieto
423b912fae Adjust to reference creation signatures 2014-04-01 19:47:48 +02:00
Carlos Martín Nieto
7a606b9b1c Adjust to libgit2 dup changes 2014-04-01 19:47:47 +02:00
J. David Ibáñez
60b4cb537a Writing changelog for v0.20.3 2014-04-01 18:44:39 +02:00
J. David Ibáñez
f0874cc1ea Always use new-style classes in Python 2 2014-03-27 21:00:09 +01:00
J. David Ibáñez
69a96975a9 Merge remote-tracking branch 'carlos/credentials' 2014-03-27 20:54:02 +01:00
Carlos Martín Nieto
687dc5388e config: make type conversion explicit
The type of a config value depends on the tool that interprets
it. Parsing eagerly can lead to a situation where we return a bool
instead of a string or a number.

Let the user specify the type themselves by passing in a (str, type)
tuple into the mapping interface.
2014-03-27 18:04:38 +01:00
J. David Ibáñez
607d4810f6 Merge remote-tracking branch 'carlos/leaks' 2014-03-27 13:43:36 +01:00
Carlos Martín Nieto
b37d1c9c1f Plug memory leaks
This patch is mostly about making sure that we free the copies of what
we have, as well as making sure that we can free it.

The IndexEntry forgot to free its path, but it also used a pointer to
python-owned memory, which could be freed at any time.

MergeResult completely lacked a deallocator.

Signature needs to make sure we can free the enocoding, and not to set
an owner when we own the memory (in this case for the default
signature).

The repository needs to get rid of its reference to the object list when
returning.

The transfer progress callback needs to decref the stats object.
2014-03-27 13:03:42 +01:00
Carlos Martín Nieto
940a6da929 Make dealloc use tp_free or don't allow inheritance
When a class is a base type, it must use its type's tp_free function to
trigger the real free, instead of PyObjec_Del().

We do not always follow this convention, so let's give it a once-over
and make sure we do that or that it's not a base type. Many of the types
have the flag set in the struct, but do not pass the allocator function
at init time, which makes them not really be a base. Remove the flag for
those types.
2014-03-27 09:55:11 +01:00
Carlos Martín Nieto
82d88191bb credentials: use more ducks
Instead of making everyone inherit from our credential types, use an
interface with two attributes, which makes the C code much shorter and
simpler.
2014-03-26 20:23:04 +01:00
Carlos Martín Nieto
77acb11cd0 credentials: memory safety
The docs say to use tp_free() to free the memory, and even though we use
PyObject_Del() everywhere else, using this in the credentials does cause
issues.
2014-03-26 19:14:57 +01:00
J. David Ibáñez
e4d45118e6 Merge remote-tracking branch 'carlos/uninitialsed' 2014-03-26 17:52:08 +01:00
Carlos Martín Nieto
b3ce1b5da6 Add credentials support to clone_repository() 2014-03-26 14:50:25 +01:00
Carlos Martín Nieto
75f9f88335 Update clone_repository's docs
It claims you need to checkout a branch after clone, which is not the
case currently (the clone function will do it for you).

While here, format the docstring for sphinx to make it pretty.
2014-03-26 14:48:34 +01:00
Carlos Martín Nieto
fc0cdaebd6 Remote: add documentation for credentials 2014-03-26 14:03:29 +01:00
Carlos Martín Nieto
4c3c706cb9 Repository: don't jump to cleanup unecessarily
Until we have successfully borrowed the message, we have not used up any
resources, we can skip jumping to 'out' and we can return NULL
directly. This also avoid dereferencing an uninitialised 'tmessage'.
2014-03-26 12:37:28 +01:00
Carlos Martín Nieto
b49da53962 Introduce credentials 2014-03-26 12:10:24 +01:00
Thomas Kluyver
af2528418a More informative repr for Repository objects 2014-03-25 15:13:10 -07:00
Carlos Martín Nieto
87c8aef7d9 Settings: add documentation
The search_path attribute is now inside __init__() so it shows properly
in the generated documentation.
2014-03-24 01:44:36 +01:00
Carlos Martín Nieto
6bdb013592 settings: python 3.3 compat
Python 3.3 doesn't like us overriding properties in __slots__, so set it
to an empty list.
2014-03-24 01:43:40 +01:00
Carlos Martín Nieto
48ff3a8983 Create proxy object for libgit2 options
pygit2.settings proxies though the lower-level varargs option() via
getters and setters which provide a more natural abstraction.
2014-03-23 15:53:32 +01:00
Carlos Martín Nieto
ab44196730 Introduce libgit2 options
Allow setting and getting the mwindow size and search paths.
2014-03-23 15:23:42 +01:00
earl
0e4a27284f diff: Fix for memory leak in git_patch 2014-02-21 10:24:38 +01:00
J. David Ibáñez
0984c7fdba Merge remote-tracking branch 'rhodes/master' 2014-02-16 12:26:24 +01:00
Leonardo Rhodes
1a17256ee3 added unit test 2014-02-13 23:09:40 +01:00
J. David Ibáñez
e322a3a678 Silence a couple of valgrind warnings 2014-02-12 23:05:51 +01:00
Leonardo Rhodes
9223d75bb0 fixed wrong return value 2014-02-12 22:20:09 +01:00
J. David Ibáñez
7fd633239f Some coding-style fixes, like not using tabs 2014-02-12 22:11:10 +01:00
Leonardo Rhodes
1e6062932c Added git_add_all
Moved git strarray conversion to utils
2014-02-12 21:47:41 +01:00
J. David Ibáñez
9e6d33855c Merge remote-tracking branch 'ahren/fixup_v0.20.2' 2014-02-12 09:24:47 +01:00
Erik Meusel
db940931fa make remote.c build with VS compiler 2008 2014-02-12 07:46:53 +01:00
J. David Ibáñez
a794d66558 docs: document TreeBuilder.get
Fixes #302
2014-02-11 22:48:34 +01:00
J. David Ibáñez
92547db18d docs: clarify git-init recipe
Fixes #336
2014-02-11 22:07:05 +01:00
J. David Ibáñez
56a2f0f9a8 Merge remote-tracking branch 'carlos/object-peel' 2014-02-11 19:07:40 +01:00
Carlos Martín Nieto
b2cd25cf00 object: allow passing a type object to peel()
Allow usage of a python type instead of having to use the libgit2
constants.
2014-02-11 18:30:47 +01:00
Carlos Martín Nieto
de3dba668a object: implement peel()
This simplifies getting one type of object from a higher-level one as
well as accepting a commit-ish or tree-ish.
2014-02-11 18:30:47 +01:00
Carlos Martín Nieto
1f3c0170aa test: clean up
Remove the temporary files and directories we create as part of running
the test suite.
2014-02-11 17:53:31 +01:00
Devaev Maxim
fa7d24005b Fixed undefined symbol: PyLong_AsSize_t on PyPy 2014-02-07 17:11:06 +04:00