219 Commits

Author SHA1 Message Date
Carlos Martín Nieto
487fb5913e Keep the describe dirty suffix string alive 2016-02-25 08:04:27 +01:00
J. David Ibáñez
fa60e2233d Release 0.23.3 2016-01-01 19:18:34 +01:00
Noah Fontes
99dfce9ab8 Add support for Repository.describe(...). 2015-12-05 23:22:37 -08:00
J. David Ibáñez
70edbf256a Update copyright years 2015-10-11 18:48:59 +02:00
J. David Ibáñez
203335bd63 Trying to fix install with pip 2015-10-11 18:42:30 +02:00
J. David Ibáñez
64150d3535 Release 0.23.2 2015-10-11 17:49:17 +02:00
J. David Ibáñez
d25a0d61de Fix error introduced accidentally in previous commit 2015-10-11 12:08:53 +02:00
J. David Ibáñez
f5aa1829ac Do not use hasattr, not robust
In Python versions older than 3.2 hasattr is not robust as it masks real
errors. And usually is not efficient as a call to hasattr is often
followed by another call to getattr. It is best to avoid using it
completely.

See https://docs.python.org/3/whatsnew/3.2.html#other-language-changes
2015-10-11 11:58:07 +02:00
J. David Ibáñez
9db8737364 Update changelog 2015-10-11 11:06:22 +02:00
Carlos Martín Nieto
563cb9018e Bring back the certificate check callback
This was implemented for clone, but not for fetch or push, so it was
deleted during the conversion, which shows why we need to unify these
callback structures.
2015-09-27 02:43:50 +02:00
Carlos Martín Nieto
ac2e363d04 Allow setting credentials and certificate in callback ctor
This allows for a less verbose way of setting one-liners as these
callbacks.
2015-09-27 02:43:50 +02:00
Carlos Martín Nieto
ab97c08f72 Make clone take the callbacks object
This lets use the same callbacks for fetch and clone; it also fills in
the callbacks which the clone function did not support.
2015-09-27 02:43:50 +02:00
Carlos Martín Nieto
7b97ade6ce Move remote callbacks to use a class for callbacks
This represents what's going on much better than the remnants from the
older methods. What we do is pass a list of callbacks to libgit2 for it
to call, and they are valid for a single operation, not for the remote
itself.

This should also make it easier to re-use callbacks which have already
been set up.
2015-09-27 02:43:50 +02:00
J. David Ibáñez
e4ef8ea5c2 Release 0.23.1 2015-09-26 20:49:13 +02:00
Nicolas Dandrimont
ec23762c09 Add support for cffi-pre-1.0 2015-09-09 23:20:08 +02:00
Michael Sondergaard
becc265c78 Don't use the deprecated cffi.verify by default
Instead this does what is recommend in the CFFI docs here: https://cffi.readthedocs.org/en/latest/cdef.html?highlight=verify#out-of-line-api

This also means building the cffi extension is neatly handled by cffi's setuptools integration itself, so we can delete the code in setup.py that used to do this.
2015-08-28 19:36:58 +02:00
David Six
25d02259df Fix: pass push_opts to git_remote_push 2015-08-26 11:15:47 -04:00
J. David Ibáñez
27e3450232 Get ready to release v0.23.0 2015-08-14 16:56:30 +02:00
J. David Ibáñez
c5eae8942d Merge remote-tracking branch 'carlos/development' 2015-07-12 12:20:27 +02:00
J. David Ibáñez
2fdfdcdc4b Get ready to release v0.22.1 2015-07-12 12:04:58 +02:00
Carlos Martín Nieto
81520c9c62 Update to libgit2 v0.23 2015-07-06 18:49:20 +02:00
Justin Clift
cc898d29e5 Typo fix 2015-06-16 17:13:50 +01:00
vtemian
5469f0c891 Remove items from index, based on stage 2015-06-03 17:31:59 +03:00
Carlos Martín Nieto
74b81bf180 Add support for querying attributes
Expose a method in the repository which allows querying an attribute for
a file and converts the result to the python equivalent.
2015-05-20 20:56:40 +02:00
J. David Ibáñez
8a196f656b Merge remote-tracking branch 'cjwatson/merge-index-path-refs' 2015-05-03 11:33:28 +02:00
J. David Ibáñez
deb50536f0 docs: remove manual singatures from py files
These are only needed in C code. With Python files the signatures are
automatically generated. The only drawback is the return value is not
included in the signature, so document it in the body of the docstring.
2015-05-03 11:16:17 +02:00
J. David Ibáñez
6da3d8f8a8 Fix a couple of warnings shown by pyflakes 2015-05-03 11:15:51 +02:00
J. David Ibáñez
52dd956896 Merge remote-tracking branch 'rmoehn/optional-args' 2015-05-03 10:13:55 +02:00
J. David Ibáñez
1f98ba6495 docs: fix build errors 2015-05-03 10:07:00 +02:00
Carlos Martín Nieto
0ce4d3b9a8 Allow creating a remote with a particular fetch refspec
This makes it a lot more convenient to create a remote and override the
fetch refspec it gets created with.
2015-04-28 13:39:15 +02:00
Colin Watson
efb49f8418 Keep path references in merge_file_from_index
IndexEntry._to_c requires its caller to hold a reference to the path it
returns until it no longer needs the C structure.
Repository.merge_file_from_index was not doing so, causing the merge
text to contain garbage from freed memory in some cases.
2015-04-23 04:29:13 +01:00
Richard Möhn
7a6465833b remote.py: Denote optional parameters as such
In the online documentation to Pygit2 it was not visible that (some of)
the parameters to Remote.fetch() and Remote.push() were optional. Fix
this. (I'm not sure if the way I did it is the idiomatic way of marking
a parameter optional in Python docstrings.)
2015-04-22 17:46:44 +09:00
Patrick Steinhardt
f923e20f2d submodule: reimplement with Python CFFI.
The submodule type has been implemented as a C type. When opening
a submodule's repository this leads to the bug that instead of an
actual pygit2.Repository being instantiated we only create an
object of the C Repository type.

As this is not trivially fixed within the C code, reimplement the
submodule type as a Python interface with CFFI. As submodules
provide no functionality that is usually accessed repeatedly the
code paths should not prove performance critical. In addition,
maintainability is improved by this reimplementation.
2015-04-16 11:36:41 +02:00
Santiago Perez De Rosso
cd7e2b21be make pygit2 work with pyinstaller 2015-04-03 11:35:54 -04:00
J. David Ibáñez
1f755c601c Fix indentation style 2015-04-03 09:19:29 +02:00
Santiago Perez De Rosso
08f2956e97 diff of blob to blob in repository.diff 2015-03-31 19:30:15 -04:00
Santiago Perez De Rosso
99e1cad393 bug fix in repository.diff 2015-03-31 13:49:39 -04:00
Patrick Steinhardt
cf56a695f9 Fix error when merging files with unicode content.
When merging index entries where the corresponding files contain Unicode
codepoints an error is thrown. Decode the C string using UTF-8 to fix the issue
and adjust the test case for merging files to contain umlauts to catch such
errors.
2015-03-19 07:48:18 +01:00
Patrick Steinhardt
367084e3c1 Implement merging of index entries.
This allows us to generate a textual diff of conflicting files in
bare repositories by performing a merge on the index followed by
repo.merge_file_from_index on the resulting index entries.
2015-03-11 16:08:13 +01:00
J. David Ibáñez
adb351f7b3 Show at least git error code when no git error message is available
Should help resolving issue #494
2015-02-20 11:35:10 +01:00
J. David Ibáñez
7130df3a5e Get back iter(Blame)
Was lost in commit cd0842592
2015-02-12 13:02:04 +01:00
J. David Ibáñez
d64dd15bd2 Merge remote-tracking branch 'carlos/merge-trees' 2015-02-10 09:34:49 +01:00
Carlos Martín Nieto
fcd4b9446b Introduce Repository.merge_trees()
This is the function which does the work for Repository.merge_commits()
and allows us more direct control over which trees we want to merge,
including trees which do not belong to commits.
2015-02-09 21:21:28 +01:00
J. David Ibáñez
fa380c0adb Merge remote-tracking branch 'gandalf/archive_enh'
Conflicts:
	pygit2/repository.py
2015-02-07 20:35:45 +01:00
J. David Ibáñez
30e57e13e3 Merge remote-tracking branch 'carlos/ahead-behind' 2015-02-07 08:27:26 +01:00
Carlos Martín Nieto
0ba17a5b46 Safer handling of string arrays
We need to keep hold of the strings which we create. We must also hold
on to the array of strings which we assing to our git_strarray.

We were not doing the latter, which meant that our strings may have been
freed too early, leaving us with with memory access errors (though often
not leading to a crash due to the custom allocator in python).

As we need to keep hold of two/three pieces of information, this looks
like a good place to introduce a context manager. This allows us to
keep these pointers alive without burdening the call sites with a return
of multiple objects they have no use for.
2015-02-06 03:51:05 +01:00
Carlos Martín Nieto
4709cae1a1 Add Repository.ahead_behind()
This lets us ask how many diverging commits each side of two histories
have.
2015-02-06 01:26:26 +01:00
J. David Ibáñez
7f21f6eb63 Expose the pygit2.GIT_REPOSITORY_INIT_* constants
Fixes #483
2015-02-01 10:53:19 +01:00
Alok Singhal
f5a5dfc18a Use "prefix" instead of "root_path" in write_archive 2015-01-30 10:15:08 -08:00
Alok Singhal
3ee1c798b2 Add an option to specify root path when creating archives 2015-01-29 08:46:50 -08:00