47 Commits

Author SHA1 Message Date
J. David Ibáñez
1f98ba6495 docs: fix build errors 2015-05-03 10:07:00 +02:00
J. David Ibáñez
7f21f6eb63 Expose the pygit2.GIT_REPOSITORY_INIT_* constants
Fixes #483
2015-02-01 10:53:19 +01:00
J. David Ibáñez
b538163536 Merge remote-tracking branch 'carlos/development'
Conflicts:
	pygit2/remote.py
2015-01-16 11:16:02 +01:00
Carlos Martín Nieto
d0b00e3124 Add support for libgit2 feature detection
This lets us ask the library whether it supports threading, https and
ssh.
2015-01-14 20:47:47 +01:00
Carlos Martín Nieto
66d55aee7e Add certificate callback for clone
We do not pass anything as the certificate, as there doesn't seem to be
anything sensible for checking it.
2015-01-12 18:39:21 +01:00
Carlos Martín Nieto
1dbf94011a Migrate to 0.22
Apart from the usual API changes, we now need to introduce the concept
of whether we still own the C object underneath our Repository and
Remote objects.

When using the custom callbacks for repository and remote creation
during clone, we pass the pointer and thus ownership of the object back
to the library. We will then get the repository back at the end.

We return the object which was handed to us rather than opening the
repository again with the local path as there is now a much higher
chance that the cloned repository does not use the standard backends.
2015-01-12 18:39:21 +01:00
Lukas Fleischer
4cbfade973 Fix data type of options in init_repository()
Initializers for the char * fields of the git_repository_init_options
structure must be cdata pointers.

Signed-off-by: Lukas Fleischer <info@cryptocrack.de>
2015-01-10 21:30:26 +01:00
J. David Ibáñez
cb310316bf docs: fix build errors in the blame chapter 2014-11-03 18:53:38 +01:00
J. David Ibáñez
94f650a41d Fix (again) the chicken-and-egg problem with cffi
Broken with previous commits :)
2014-10-30 17:59:38 +01:00
Carlos Martín Nieto
7d34d2bb27 Use the initializer for repository init options 2014-09-13 18:58:36 +02:00
Carlos Martín Nieto
63377aad78 Properly initialize the clone options
libgit2 provides an initialization function to set sane defaults. Use
that instead of setting the version by hand, as that's not the only
thing it does.

Using C.git_clone_init_options() sets the checkout strategy to SAFE,
which will checkout the files after the clone, instead of the implicit
NONE which we're setting by hand.

This fixes #425,
2014-09-13 18:58:36 +02:00
Carlos Martín Nieto
b550027234 Fix cloning a repository with a particular branch to checkout
We were missing a cast to bytes. Add a test for this option as well and
remove the old commented-out test for checkout_branch, which is
superseded by this one and whose last bit seemed confused about what the
option means.

This fixes #399
2014-08-25 13:58:41 +02:00
J. David Ibáñez
be807a1dfc internal: split code for Python 2/3 compatibility 2014-07-28 17:51:51 +02:00
J. David Ibáñez
7df11bf817 internal: rename "to_str" to "to_bytes" for clarity 2014-07-28 17:30:38 +02:00
vtemian
93369b0a7c Cleanup a little bit the code 2014-07-14 20:21:24 +03:00
Carlos Martín Nieto
97ee7ab179 Move Index to cffi
This commit gives us feature-parity with the version in C.
2014-07-10 09:08:16 +02:00
Carlos Martín Nieto
d3af09e86d Adjust to clone_into signature change 2014-06-07 21:45:10 +02:00
J. David Ibáñez
95e6593625 init_repository now wraps git_repository_init_ext
Fixes #347
2014-06-03 12:52:46 +02:00
J. David Ibáñez
6cf06ba9fe Rewrite init_repository using cffi 2014-06-02 18:50:55 +02:00
Carlos Martín Nieto
19be4b6aa4 clone: wrap clone_into()
This allows the user to prepare the repository and remote with whichever
custom settings they want before performing the "clone" proper.
2014-05-20 03:23:25 +02:00
Carlos Martín Nieto
c41c1a1c97 Config: move to cffi
This halves the amount of code we have to take into account for dealing
with the config.

There is a slight change in the API. Config.get_multivar() returns an
iterator instead of a list, which lets us reuse code from the general
iterator and is closer to libgit2's API.
2014-04-21 14:11:41 +02:00
Carlos Martín Nieto
674546bbb5 Some python3 fixes 2014-04-16 22:12:09 +02:00
Carlos Martín Nieto
072b038210 Implement clone via CFFI as well
This lets us get rid of the last piece of C for anything related to
remotes and credentials.
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
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
b49da53962 Introduce credentials 2014-03-26 12:10:24 +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
J. David Ibáñez
d7071b88cd Update copyright year 2014-02-04 08:02:12 +01:00
Carlos Martín Nieto
b7e906eee9 Adjust to libgit2 development branch
This wraps the previous functionality, though there are some iterator
changes we might still want to bring over.
2013-11-20 12:20:26 +01:00
J. David Ibáñez
f075aa3665 Fix some "errors" found by pyflakes 2013-05-24 21:34:10 +02:00
Bernardo Heynemann
032faf7017 Fixing 80-column width for both the python and C code. 2013-05-16 16:09:39 -03:00
Bernardo Heynemann
a377b32b60 Documentation for the new clone method.
Even though I am aware that the comment lines in pygit2/__init__.py are longer than 79 characters, there's a reason for that.
If I break them, they'll show poorly in the documentation, and in my opinion better docs trump the 80 char requirement. If you think it's still better to have less than 80 characters in the comments, I'll gladly resubmit the changes at the expense of the documentation.
2013-05-16 10:25:47 -03:00
Bernardo Heynemann
57ea19e905 Now __init__ is pep8-compliant 2013-05-16 10:06:46 -03:00
Bernardo Heynemann
3dd998c061 Supporting clone in pygit2 2013-05-15 18:15:00 -03:00
J. David Ibáñez
101715bf37 docs: review, in progress 2013-05-09 14:21:04 +02:00
J. David Ibáñez
32e460fe16 docs: complete and improve organization 2013-04-03 19:09:48 +02: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
J. David Ibáñez
9ffc14148e Now we have a Repository class written in Python 2013-03-03 14:44:42 +01:00
J. David Ibáñez
29ce23c0d5 Update copyright 2013-03-02 12:16:16 +01:00
J. David Ibáñez
ed66578029 Remove __libgit2_version__ because it is a dup
We already have LIBGIT2_VERSION
2013-02-17 22:46:11 +01:00
Christian Boos
64ae9e19f4 Use libgit2 LIBGIT2_VER* constants directly instead of git_libgit2_version() call. 2013-02-17 12:52:36 +01:00
Christian Boos
8f843beecf Add pygit2.__libgit2_version__ to retrieve git_libgit2_version() info. 2013-02-17 12:21:15 +01:00
W. Trevor King
f10d2b7b3f pygit2:version: add 'pygit2.__version__' for easy access from client software.
Moved the hardcoded version from setup.py to pygit2/version.py so
client software can figure out which version of pygit2 it's using.
Having setup.py import pygit2.version.__version__ removes duplication,
and also means that setup.py will always use the local version (and
not the version of a previously installed pygit2).
2012-09-17 10:16:25 -04: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
Nico von Geyso
ad4edf1b85 added pygit2.utils module
refactored package integration to be able to have pygit2.utils module
2012-05-25 14:23:25 +02:00