1000 Commits

Author SHA1 Message Date
Carlos Martín Nieto
73170cc104 walk: make the sorting mode optional
Since the libgit2 has a default sorting method, which we also mention as
default in the documentation, there is no particular need to make the
user choose a sorting method when the order does not matter. We use
sorting NONE in that case.
2014-02-06 10:46:30 +01:00
J. David Ibáñez
140305e410 Get ready to release 0.20.2 v0.20.2 2014-02-04 22:26:46 +01:00
Carlos Martín Nieto
dcd5acc34e index entry: avoid extra copy 2014-02-04 12:53:45 +01:00
Carlos Martín Nieto
824ac672c1 remote: borrow the C string where possible 2014-02-04 12:53:45 +01:00
Carlos Martín Nieto
659749510f refspec: borrow the C string 2014-02-04 12:53:45 +01:00
Carlos Martín Nieto
c8a4027aff signature: borrow the name's C string 2014-02-04 12:53:45 +01:00
Carlos Martín Nieto
b4827ba081 repository: borrow C strings where possible 2014-02-04 12:53:45 +01:00
Carlos Martín Nieto
1c74676ed4 config: borrow the string for lookup and setting
We don't need our own copy of the string, so use the new borrowing
mechanism to use python's underlying string for the key to get/set.
2014-02-04 12:53:45 +01:00
Carlos Martín Nieto
74d091d609 utils: allow borrowing a C string
We don't always need our own copy of a C string; sometimes we just need
to parse it. Create py_str_borrow_c_str() which returns a char pointer
to python's internal value string, with which we can avoid an extra copy.
2014-02-04 12:53:45 +01:00
J. David Ibáñez
d7071b88cd Update copyright year 2014-02-04 08:02:12 +01:00
J. David Ibáñez
7b1310f31b docs: fix warnings 2014-02-04 07:52:58 +01:00
J. David Ibáñez
c04db1f66d Split the Refspec type to its own file 2014-02-04 07:25:00 +01:00
J. David Ibáñez
873b38bbc3 Update README 2014-02-03 22:39:58 +01:00
J. David Ibáñez
b95ee3758c Preparing release 2014-02-02 23:32:21 +01:00
J. David Ibáñez
977c315c21 Preparing for release 2014-02-02 15:07:47 +01:00
Alexander Bayandin
b9bf1175e2 Run tests on travis CI for pypy
Because #209 is done
2014-02-02 12:11:19 +03:00
J. David Ibáñez
6a8e7a97cb Merge remote-tracking branch 'carlos/index-add-entry' 2014-01-29 11:57:44 +01:00
Carlos Martín Nieto
f3f3d28637 Index: allow writing the tree to a particular repository
Take an optional repository in Index.write_tree() to serialize to a tree
into a particular repository's odb.
2014-01-29 11:46:53 +01:00
Carlos Martín Nieto
c43c320c3e Index: accept adding either a path or an IndexEntry
A path is only useful if we have the file on the worktree. Passing an
IndexEntry allows us to add an entry with arbitrary attributes.
2014-01-29 11:46:53 +01:00
Carlos Martín Nieto
f6389ee2c3 IndexEntry: make the attributes writable
When updating entries in an index, it is necessary to modify the
attributes of tree entries. make it possible to do so.
2014-01-29 11:46:53 +01:00
J. David Ibáñez
5a785ba976 Remove left over declaration of Remote_set_callbacks 2014-01-29 11:26:13 +01:00
XTao
f79ae6b421 Drop Remote_init. 2014-01-29 18:09:55 +08:00
Carlos Martín Nieto
d98a701477 IndexEntry: allow creation of this object
They are not required to belong to a particular index, so it should be
possible to create them at runtime in order to insert them.
2014-01-29 10:51:15 +01:00
Carlos Martín Nieto
9c95cb0560 IndexEntry: keep a copy of the underlying git_index_entry
The tree entries exist more or less independently of the index they were
retrieved from. The idea behind them is that they can be kept by a
binding without needing to refer to the original anymore, which may
disappear at any moment if the index is modified.

Keep a copy of the data in TreeEntry instead of pointing to the one
retrieved from the index, which is not safe to keep around.
2014-01-29 10:51:15 +01:00
XTao
5b4b7f39d5 Add wrap remote. 2014-01-29 15:14:57 +08:00
Carlos Martín Nieto
94e841bfb2 Remove useless constructors
The Reference, Branch, ConfigIter and Walker types were allowed to be created by the
user, but no constructor was set, and the default values are either
meaningless (in the case of Reference/Branch) or would cause a segfault
as soon as one tried to use them (ConfigIter and Walker).

Remove the constructor from these types, as they don't serve a purpose
and can only be used by mistake.
2014-01-28 18:35:56 +01:00
J. David Ibáñez
3026798add Merge remote-tracking branch 'carlos/pypy' 2014-01-27 22:58:47 +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
9a428f985c Refspec: fix copy-paste error 2014-01-25 10:48:49 +01:00
Carlos Martín Nieto
0bbd15b4f1 TransferProgress: create this type for transfer progress reporting
This gets passed to the transfer progress callback, instead of the
stripped-down version which Remote.fetch() returns.
2014-01-25 10:48:49 +01:00
Carlos Martín Nieto
c2b2c5dd16 remote: call user-provided callbacks
The user can set 'progress', 'transfer_progress' and 'update_tips' to be
notified whenever one of those happen.
2014-01-25 10:48:49 +01:00
Carlos Martín Nieto
1cc112c32f docs: adjust to recent changes
It seems I have been forgetting to update the documentation with the
last few  changes, so adjust to the oid -> id renaming and add missing
attributes to the listings.
2014-01-25 04:25:42 +01:00
Carlos Martín Nieto
5410128187 TreeEntry: move to use 'id' attribute for the object's id
Similar to the Object change, we should be using 'id' when referring to
the target's id.x
2014-01-24 11:25:39 +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
Carlos Martín Nieto
3a83cb44b6 Oid: Deprecate 'hex' in favour of str() or unicode()
Python has built-in functions to get a string representation of an
object id, so let's use that instead of using a custom attribute.
2014-01-24 10:28:53 +01:00
Carlos Martín Nieto
0c3a700e30 Remote: harden the resfpec setters
The object passed must be a list of strings, so make sure we fail by
raising an error instead of segfaulting.
2014-01-22 23:30:02 +01:00
Carlos Martín Nieto
1040a6330a Remote: make fetch/push_refspecs attributes
This is a lot more pythonic than two sets of getter-setter
functions. The old ones are left for backwards compatibility but they
should be removed in the next release.
2014-01-22 23:06:52 +01:00
XTao
9ef75d846e Add fetch & push refspec. 2014-01-22 15:25:25 +08:00
J. David Ibáñez
b27b10eb56 Merge remote-tracking branch 'carlos/tree-deep-search' 2014-01-20 10:48:23 +01:00
J. David Ibáñez
4c28c487db Merge remote-tracking branch 'carlos/push-url' 2014-01-20 10:45:27 +01:00
Carlos Martín Nieto
5baaf287d2 Tree: let contains look in subtrees
Allow looking in subtrees as a convenience in the 'contains'
function. As slashes are not allowed to be part of the name of an entry,
there is no ambiguity in what they mean.
2014-01-20 03:37:59 +01:00
Carlos Martín Nieto
e28c06fc1d Remote: allow access to the push url 2014-01-20 03:17:34 +01:00
Carlos Martín Nieto
7ef23780cd Remote: handle the case of a missing url 2014-01-20 03:15:56 +01:00
Carlos Martín Nieto
de5244d7c7 Refspec: add documentation 2014-01-19 23:59:49 +01:00
Carlos Martín Nieto
17a49bb417 Refspec: implement transform functions 2014-01-19 23:59:47 +01:00
Carlos Martín Nieto
e681a47245 Refspec: create the type to wrap refspecs 2014-01-19 23:59:26 +01:00
J. David Ibáñez
73518fd804 Merge remote-tracking branch 'carlos/treeentry-cmp' 2014-01-19 20:09:22 +01:00
J. David Ibáñez
5bca48ee57 Merge remote-tracking branch 'carlos/config-iterator' 2014-01-19 20:00:46 +01:00
J. David Ibáñez
8090a11530 Merge remote-tracking branch 'carlos/commit-attr-id' 2014-01-19 19:51:33 +01:00
Carlos Martín Nieto
35386cbec2 Config: switch from foreach iterator
An iterator is much more natural in python, so let's use that.
2014-01-19 17:57:26 +01:00