89 Commits

Author SHA1 Message Date
J. David Ibáñez
7035598c73 Fix warning in 'Commit_get_message_encoding' 2011-08-13 21:50:51 +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
7b8ae0e10c Python 3, now pygit2 builds
Tests do not yet pass.
2011-08-10 22:52:42 +02:00
J. David Ibáñez
7f7a512e66 Fix issue #39, add missing Py_INCREF 2011-08-05 12:52:43 +02:00
J. David Ibáñez
7545cdf9f3 Updato use new 'git_signature_new' prototype 2011-08-04 10:29:45 +02:00
J. David Ibáñez
61124f42db Merge remote branch 'julien/status3' 2011-07-29 10:52:54 +02:00
Julien Miotte
1c9602e58e Following PEP7 recommendations on function definition style. 2011-07-28 11:26:02 +02:00
Julien Miotte
f4e75e5b6f New Repository method: status().
Using git2's status methods to be able to read the status of a
repository. The returned status is a dictionnary with file paths as keys
and status flags as values.
2011-07-27 18:39:12 +02:00
Julien Miotte
d6a3014208 According to PEP7, restricting lines to 79 chars, fixing code structure. 2011-07-21 12:15:50 +02:00
Julien Miotte
b62fcc8877 Purely cosmetic, alining all PyTypeObjects comments. 2011-07-21 12:15:17 +02:00
J. David Ibáñez
d55ea4c102 Reuse the function 'git_oid_to_py_str' 2011-07-20 15:29:58 +02:00
J. David Ibáñez
dafe4b11b2 Fix coding style
- do not use tabs
- remove trailing white spaces
- lines are 79 chars max.
2011-07-20 15:05:17 +02:00
J. David Ibáñez
cd83372230 Merge remote branch 'byron/repo_write_improved' into repo_write 2011-07-18 22:45:46 +02:00
Sebastian Thiel
d0bc776121 Repository.write implemented
Implemented Repository write function, using odb write streams
Added simple test
2011-07-18 17:02:26 +02:00
J. David Ibáñez
a139335098 Fix memory leak in 'wrap_index_entry' (issue #18) 2011-07-14 22:01:40 +02:00
J. David Ibáñez
7b6c6a7a4c Update to libgit2 v0.14.0 2011-07-14 12:05:09 +02:00
Julien Miotte
d484edb293 Adding a new 'mode' attribute to IndexEntry objects.
This new attribute gives use read access on IndexEntry's mode.
2011-07-12 18:53:29 +02:00
J. David Ibáñez
9740fc44cd Merge remote branch 'julien/tree_iter' 2011-07-12 17:13:15 +02:00
Julien Miotte
0eb75de425 Making the Tree object iterable.
By copying IndexIter functions, this gives us the ability to iterate of
TreeEntries of a Tree object.
2011-07-11 22:27:03 +02:00
Sebastian Thiel
a0975f78d5 Fixed memory leaks
Repository_read would not free the odb object after using it.
Object_read_raw didn't close the odb object after usage
2011-07-08 17:11:56 +02:00
Sebastian Thiel
cf37c15059 allow 20 byte sha strings
Adjusted py_str_to_git_oid to allow 20 byte binary strings. This improves usability to other clients which already store their shas as binary strings, increasing overall performance as they won't have to convert them into hex beforehand, which would have to be converted back to binary form by libgit2 in turn.
Adjusted tests to accept binary shas.
2011-07-08 17:05:33 +02:00
J. David Ibáñez
eedd975bc8 Fix compilation warnings, remove unused variables 2011-06-25 18:53:22 +02:00
J. David Ibáñez
215893328c Fix issue #22, pygit2 compiles again with Python 2.5 2011-06-25 18:46:07 +02:00
J. David Ibáñez
7e8da54569 Update to libgit2 v0.13.0 2011-06-20 16:04:52 +02:00
Carlos Martín Nieto
64b20305e6 Use newer API 2011-06-16 22:48:42 +02:00
J. David Ibáñez
f8e61de973 Optimize index iterator, refactor code 2011-05-11 18:03:50 +02:00
J. David Ibáñez
fafeace94a Merge remote branch 'jflatow/dev' into development 2011-05-10 18:47:53 +02:00
Jared Flatow
9dfc40e3f3 added iterator to index objects 2011-05-10 08:18:35 -07:00
J. David Ibáñez
22b6d44749 Update to libgit2's changes: strerror -> lasterror 2011-05-10 15:45:52 +02:00
J. David Ibáñez
51e6cdfd5d Replace internal function wrap_object by lookup_object
The new function does a little more, saving some lines from the callers.

This change will allow to implement a cache, now all object lookups are
centralized in a single function.
2011-05-05 19:33:05 +02:00
David Versmisse
bed8c13757 Add the "getters" Repository.path and Repository.workdir 2011-04-29 09:21:01 +02:00
David Versmisse
858adab759 Implement the References (part II) 2011-04-28 10:25:37 +02:00
David Versmisse
aac4cf1b86 Implement the References (part I) 2011-04-15 11:09:20 +02:00
J. David Ibáñez
713b14d2ee Support updating reference in create_commit 2011-04-11 19:23:48 +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
32acbc0f71 Set Python error when Commit_init fails 2011-04-08 18:37:32 +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
c7ea728ca5 Merge remote branch 't3/master' into development 2011-04-07 16:36:13 +02:00
J. David Ibáñez
8491568dd0 Fix compilation warnings 2011-04-07 16:31:21 +02:00
Sarath Lakshman
e7fe537626 Add create_tree method for Index class
Invoke tree = index.create_tree() to create a tree from index file and return Tree object.
2011-04-07 14:02:57 +05:30
J. David Ibáñez
fca3a4753b Fix Tree_contains, forward Python errors 2011-04-06 13:03:38 +02:00
J. David Ibáñez
08d3dcc82e Update unit tests 2011-04-05 12:37:26 +02:00
J. David Ibáñez
8bbc75148f Add the parents param to the Commit init method
And fix unit tests for the commit object.
2011-04-05 11:22:56 +02:00
J. David Ibáñez
d395a2963e Updating to libgit2 v0.11.0 (work in progress)
"import pygit2" works again, but the tests do not yet pass
2011-04-01 19:07:47 +02:00
J. David Ibáñez
aa2982b687 Updating to libgit2 v0.11.0 (work in progress) 2011-03-31 19:06:10 +02:00
J. David Ibáñez
6c7df765c1 Fix typo: git_object => git_blob 2011-03-18 12:18:17 +01: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 Ibáñez
204c0595f1 Add function 'init_repository' 2011-03-07 19:37:38 +01:00
J. David Ibáñez
2b84b37384 Give access to the path of an index entry 2011-03-07 17:06:42 +01:00
J. David Ibáñez
29a754bf43 Make pygit2 build against new libgit2 API
Now libgit2 uses reference counting for Git objects.
2011-03-04 12:05:53 +01:00