1338 Commits

Author SHA1 Message Date
Masud Rahman
9cce003efe Implements 'Repository.create_blob_fromiobase'.
This commit allows blobs to be constructed from implementatons of the
'RawIOBase' ABC.  This allows any conformant stream implementation to be added
as a blob.

This is useful in the case where the contents of the blob would be too large to
create from memory (as 'create_blob_fromstring' allows) and avoids having to
write the data to disk (as 'create_blob_fromworkdir' allows).  The latter
operation is especially useful when reading data from a network socket, since
it avoids having to first commit all the data to disk.
2015-02-10 01:28:23 -05:00
Carlos Martín Nieto
d4da228c0e Add documentation for merge_commits() and merge_trees() 2015-02-09 21:25:33 +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
718a2df1d5 Fix building the docs 2015-02-07 08:37:41 +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
Carlos Martín Nieto
1361b2cce9 Add Repository.expand_id()
As we allow users of the library to use short strings, we must expand
them. This is however only available through a function in C. Expose
that function from the repository to allow python code to get a full id
from a short hex string.
2015-02-06 01:17:19 +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
J. David Ibáñez
961d007b02 Patch.line_stats replaces .additions and .deletions
Comes from PR #346
2015-01-30 17:56:46 +01:00
J. David Ibáñez
909e03d8fc New DiffDelta and DiffFile
Comes from PR #346
2015-01-29 18:34:47 +01:00
Alok Singhal
3ee1c798b2 Add an option to specify root path when creating archives 2015-01-29 08:46:50 -08:00
Alok Singhal
9771adf862 Fix handling of symlinks in write_archive(). 2015-01-29 08:35:27 -08:00
J. David Ibáñez
8881b75aaa internal: split patch.c from diff.c
Comes from PR #346
2015-01-26 19:02:28 +01:00
J. David Ibáñez
e7fdaf2510 Fix link to travis image (use master) 2015-01-23 23:19:13 +01:00
J. David Ibáñez
061961f119 Rename pygit2.Hunk to pygit2.DiffHunk
Comes from PR #346
2015-01-23 13:38:13 +01:00
J. David Ibáñez
c62a79cf81 Start changelog for future 0.22.1 release 2015-01-23 13:37:27 +01:00
J. David Ibáñez
8a6e61551c Merge remote-tracking branch 'Sheeo/master' 2015-01-19 13:56:32 +01:00
J. David Ibáñez
126308403b Get ready to release v0.22.0 0.22.0 v0.22.0 2015-01-16 16:35:19 +01:00
J. David Ibáñez
9da91e554d Changelog for upcomming v0.22.0 release 2015-01-16 13:52:15 +01:00
J. David Ibáñez
beaaca7f63 Fix type of RefLogEntry.oid_old and RefLogEntry.oid_new
This was left from PR #449
2015-01-16 12:39:16 +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
J. David Ibáñez
9c9b925da8 Revert "Mentioning libssh2 in remote's pydoc"
This reverts commit e807ad43d725da06bfc34187b387270baea74887.
2015-01-16 10:24:06 +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
Greg Fitzgerald
81bde5d0e7 Fix compiler warnings 2015-01-14 14:25:41 +00:00
Peter Dave Hello
e15c0d828b Use svg instead of png to get better image quality 2015-01-14 02:15:20 +08:00
Matthew Duggan
b2abfdec9e Note that Refspec constructor is internal. Fix typo. 2015-01-12 18:23:03 -08:00
Matthew Duggan
34fb1c00eb Make it explicit that respecs are added as strings. 2015-01-12 18:22:25 -08:00
Matthew Duggan
52ac41a362 Make it explicit that Refspec objects are not for construction 2015-01-12 18:20:11 -08:00
Matthew Duggan
5a06cd2688 Make it explicit what to do when no passphrase is needed 2015-01-12 18:20:07 -08:00
Carlos Martín Nieto
78695aa93a Change required version to 0.22 2015-01-12 20:00:17 +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
f68b266e60 Remote: generalize push()
Move to use git_remote_push() instead of doing the steps ourselves. We
also change to accept a list of refspecs instead of just the one refspec
for the push method.

As part of this, we no longer error out if the server rejected any
updates, as this is a different concern from whether the push itself
failed or not. We do still error out if we attempt to push non-ff
updates.
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
e81d395adf Merge remote-tracking branch 'rmoehn/master' 2015-01-10 21:24:17 +01:00
Richard Möhn
d341cff7d6 Fix documentation for Repository.listall_branches
Add a description of the possible flags and turn the "tuple" into a
"list", as it had already happened in code and part of the documentation
in aa5877e0.
2015-01-09 19:25:50 +01:00
Greg Fitzgerald
4f88840e93 Fix use-after-free when patch outlives diff 2015-01-05 19:20:47 +00:00
Richard Möhn
22d1aef50d Remove obsolete git-branch recipe
The git-branch recipe says: »Note that the next release will probably
allow repo.listall_branches().« Concluding from the README,
Repository.listall_branches() was included in some release prior to
0.20.0, so at least that statement is obsolete.

However, since pygit2.org brings up fairly accurate results for a search
on »list all branches«, I figured that the whole recipe isn't needed
anymore. Therefore delete it.
2015-01-05 10:27:43 +01:00
J. David Ibáñez
ceb40ecc52 Merge remote-tracking branch 'kinfoo/libssh2_docs' 2014-12-30 22:58:48 +01:00
Kevin KIN-FOO
e807ad43d7 Mentioning libssh2 in remote's pydoc 2014-12-30 16:34:15 +01:00
Kevin KIN-FOO
aff3a64e2d Mention libssh2 in installation#requirements
Fixes #456
2014-12-30 16:08:07 +01:00
Michael Sondergaard
df0e11726e Make pygit work in a frozen environment 2014-11-26 06:04:40 +01:00
J. David Ibáñez
beff871923 Minor styling 2014-11-12 10:21:47 +01:00
J. David Ibáñez
93be1f1910 Merge remote-tracking branch 'carlos/remote-collection' 2014-11-11 20:08:56 +01:00
Carlos Martín Nieto
b80103b017 Introduce RemoteCollection
This lets us look up remotes by name, which is not possible by just
returning the list of remotes.

Move remote creation to Repostiory.remotes.create() and keep the old
Repository.create_remote() for compatibility, delegating to this new
way.

Existing code should keep working, but this moves us towards what we'd
need for a better interface in 0.22 which makes remote renaming and
deleting work with a name rather than an instance and would make sense
to exist as part of an Remote.remotes object.
2014-11-11 19:57:22 +01:00
J. David Ibáñez
b6f0bb0800 setup: minor cleanup 2014-11-11 13:03:25 +01:00
Philippe Ombredanne
6484ef1e37 Make the GPL exception explicit in setup.py
I think that is best to have that explicitly set there (and it should possibly be updated in Pypi too).
Thanks for this lib!
Cordially
Philippe
2014-11-11 12:05:08 +01:00