396 Commits

Author SHA1 Message Date
J. David Ibáñez
2ac913244d Merge remote-tracking branch 'delanne/memleak' 2012-11-14 17:54:00 +01:00
delanne
b84e8dc9a0 Fix the issue reported by Jdavid 'Here you are freeing the path and then you use it.' 2012-11-12 10:25:55 +01:00
J. David Ibáñez
81078e2cf7 Merge remote-tracking branch 'delanne/diff_opts' 2012-11-11 19:52:56 +01:00
delanne
8216dad986 Fix issue reported by Travis for Python3.1 and Python3.2 2012-11-09 16:23:11 +01:00
delanne
783025d327 Fix: "The opt variable is not used in the loop" 2012-11-09 14:55:20 +01:00
delanne
9ffbe7b2ce Fix memleak + refcount issues 2012-11-09 14:45:07 +01:00
delanne
c6e06d60d1 Fix: uncomment a commented line 2012-11-08 12:44:50 +01:00
delanne
8827ea2312 Fix memory leak reported by valgrind 2012-11-08 12:39:26 +01:00
delanne
1b7e61145e Merge remote-tracking branch 'upstream/master' into diff_opts 2012-11-05 13:38:43 +01:00
Nico von Geyso
e3a71d4f41 removed unused variable in repository.c 2012-11-04 21:49:15 +01:00
Nico von Geyso
2da04cab2d Merge branch 'master' into create_reference_refactoring 2012-11-04 21:45:41 +01:00
J. David Ibáñez
ad7b86d9e6 Merge pull request #145 from cholin/fixed_tests
Fixed tests
2012-11-04 12:28:57 -08:00
Nico von Geyso
3887c8f1c5 fixed api changes: git_tree_create_fromindex to git_index_write_tree 2012-11-04 13:03:05 +01:00
Nico von Geyso
929b775241 added Index_remove 2012-11-04 12:54:10 +01:00
Nico von Geyso
971fc2f101 fixed config test for config.set_multivar
config files have different priorities and only the highest one gets evaluated for set_multivar
2012-11-01 15:18:07 +01:00
Nico von Geyso
b961b9218f fixed warning gcc -Wparentheses warning 2012-11-01 15:17:58 +01:00
Nico von Geyso
f1a72fb2e8 fixed index_add and index_get for current development branch of libgit2 2012-11-01 15:17:52 +01:00
delanne
0b537bf780 - add option flags for tree.diff
- add a testcase test_diff_tree_opts
 - update testrepo.git
 - update existing testcases
2012-10-31 12:11:18 +01:00
J. David Ibáñez
ee2813251b Merge pull request #142 from wking/readme-encoding
setup.py: decode README.rst to unicode.
2012-10-26 07:26:10 -07:00
J. David Ibáñez
86ed251fb7 Merge pull request #141 from wking/libgit2
Fix compilation issues against recent versions of libgit2
2012-10-26 07:10:56 -07:00
W. Trevor King
43a798bbdb setup.py: decode README.rst to unicode.
Signed-off-by: W. Trevor King <wking@tremily.us>
2012-10-25 15:47:02 -04:00
W. Trevor King
c36bbf518c test_config: tell Nose that foreach_test_wrapper() is not a test
Signed-off-by: W. Trevor King <wking@tremily.us>
2012-10-25 14:37:43 -04:00
W. Trevor King
e13a42a6e5 config: fix return conversion in Config_foreach_callback_wrapper()
PyLong_AsLong() returns -1 on error.  The previous implementation
returned -1 when py_result was 0, which killed every .foreach()
iteration after the first callback.

We could skip the if clause and just return the result of
PyLong_AsLong(), but keeping the if clause makes it more obvious that
we *did* think about handling errors from PyLong_AsLong().

Signed-off-by: W. Trevor King <wking@tremily.us>
2012-10-25 14:24:55 -04:00
W. Trevor King
cce9f79905 config: return -1 on error in Config_foreach_callback_wrapper().
Config_foreach_callback_wrapper is supposed to return 0 on success.
From the docstring:

  As soon as one of the callbacks returns an integer other than 0,
  this function returns that value.

If we've already had an exception, we want to bail immediately and
raise the exception.

Signed-off-by: W. Trevor King <wking@tremily.us>
2012-10-25 14:15:15 -04:00
W. Trevor King
cd643a3d70 config: check for Py_BuildValue() errors in Config_foreach_callback_wrapper().
Signed-off-by: W. Trevor King <wking@tremily.us>
2012-10-25 14:14:39 -04:00
W. Trevor King
4660c9c149 config: extend Config.add_file() accept keyword arguments.
This provides backward compatibility with older code that does not
specify `force`.

Signed-off-by: W. Trevor King <wking@tremily.us>
2012-10-25 13:52:15 -04:00
W. Trevor King
ebdb85e754 index: remove read_tree() progress indicator
This brings us into compliance with the libgit2 commit:

  commit 0ae81fc479bf3cf7ed31b3e3b070de7990102f1d
  Author: nulltoken <emeric.fermas@gmail.com>
  Date:   Wed Oct 17 15:30:22 2012 +0200

    index: remove read_tree() progress indicator

Signed-off-by: W. Trevor King <wking@tremily.us>
2012-10-25 13:23:18 -04:00
W. Trevor King
01d2fdc508 diff: add const to shared pointers in the diff API.
This brings us into compliance with the libgit2 commit:

  commit bae957b95d59a840df72a725b06f00635471cfd8
  Author: Russell Belfer <rb@github.com>
  Date:   Tue Sep 25 16:31:46 2012 -0700

    Add const to all shared pointers in diff API

Signed-off-by: W. Trevor King <wking@tremily.us>
2012-10-25 11:03:16 -04:00
W. Trevor King
396fbef698 config: update Config_foreach_callback_wrapper to use git_config_entry *.
This fixes:

  $ python setup.py build_ext --inplace
  src/pygit2/config.c: In function ‘Config_foreach’:
  src/pygit2/config.c:261:13: warning: passing argument 2 of ‘git_config_foreach’ from incompatible pointer type
  ../libgit2/include/git2/config.h:420:17: note: expected ‘int (*)(const struct git_config_entry *, void *)’ but argument is of type ‘int (*)(const char *, const char *, void *)’

Signed-off-by: W. Trevor King <wking@tremily.us>
2012-10-25 10:54:38 -04:00
W. Trevor King
86075d3f50 config: add force argument to Config_add_file.
This fixes:

  src/pygit2/config.c: In function ‘Config_add_file’:
  src/pygit2/config.c:276:5: error: too few arguments to function ‘git_config_add_file_ondisk’

Also convert `int priority` -> `unsigned int level` to match current
libgit2 header.

Signed-off-by: W. Trevor King <wking@tremily.us>
2012-10-25 10:28:45 -04:00
W. Trevor King
53cd040bad config: update Config_get_multivar_fn_wrapper to use git_config_entry *.
This fixes:

  $ python setup.py build_ext --inplace
  ...
  src/pygit2/config.c: In function ‘Config_get_multivar’:
  src/pygit2/config.c:311:13: warning: passing argument 4 of ‘git_config_get_multivar’ from incompatible pointer type
  ../libgit2/include/git2/config.h:339:17: note: expected ‘int (*)(const struct git_config_entry *, void *)’ but argument is of type ‘int (*)(const char *, void *)’
  error: command 'i686-pc-linux-gnu-gcc' failed with exit status 1

reported by wolftankk in issue #140.

Signed-off-by: W. Trevor King <wking@tremily.us>
2012-10-25 10:21:01 -04:00
Nico von Geyso
e1acdb48bc use latest development of libgit2 - changed GitError to ValueError
For already existing references a ValueError is raised (see sry/pygit2/error.c:41)
2012-10-12 11:51:08 +02:00
Nico von Geyso
682fb1fd13 merged create_reference and create_reference_symbolic and added force-Option
To be more pythonic: merged methods create_reference and create_reference_symbolic
and added force-Option. To make a new symbolic reference you have provide symbolic=True
as an additional parameter. If force=True references will although be overridden.
Otherwise an exception is raised if the references exists.

Examples:

  # normal reference
    repo.create_reference('refs/heads/foo', repo.head.hex)

  # override reference with new value
    repo.create_reference('refs/heads/foo', repo.head.hex, force=True)

  # symbolic reference
    repo.create_reference('refs/tags/foo', 'refs/heads/master', symbolic = True)
2012-10-09 13:13:36 +02:00
J. David Ibáñez
87572b2c8c Merge remote-tracking branch 'cholin/master' 2012-10-03 15:06:39 +02:00
J. David Ibáñez
ad8103bc48 Fix reference test case
Now git_reference_lookup says "foo" is an invalid reference name
(returns GITERR_REFERENCE instead of GIT_ENOTFOUND).
2012-10-03 14:08:27 +02:00
Nico von Geyso
63e0c0a3ad added build status image to README 2012-09-26 12:18:11 +02:00
J. David Ibáñez
5251343ee7 Merge remote-tracking branch 'wking/revparse' 2012-09-25 15:10:55 +02:00
J. David Ibáñez
3e9daa4ae3 import pygit2 works again (diff tests still fail) 2012-09-23 15:12:46 +02:00
J. David Ibáñez
a1edbe0b86 Fix compilation warnings 2012-09-23 15:10:05 +02:00
J. David Ibáñez
1be3e8301d Get a useful traceback when importing pygit2 fails 2012-09-22 19:07:15 +02:00
J. David Ibáñez
ded3d91eab Fix compilation 2012-09-21 23:31:43 +02:00
J. David Ibáñez
ce652548dc Merge remote-tracking branch 'encukou/git_filemode' 2012-09-21 17:04:20 +02:00
J. David Ibáñez
2dcd4bcfed Merge remote-tracking branch 'ferengee/patch-1' 2012-09-21 17:00:03 +02:00
J. David Ibáñez
a72fab5a76 Merge remote-tracking branch 'bendavis/git_tree_entry_bypath' 2012-09-21 16:52:38 +02:00
J. David Ibáñez
1c7a18724c Switch to use libgit2's development branch 2012-09-21 16:44:13 +02:00
J. David Ibáñez
1148c5d73b Release v0.17.3
Features:

- New 'Blob.size' getter
- New 'Repository.create_blob_fromfile' method
- Signature, now the time and offset parameters are optional
- Improved diff support

Other:

- Add 'pygit2.__version__'
- Optimize usage of Travis
- Various fixes for the unit tests
- Various documentation improvements

Thanks to Alex Chamberlain, Carlos Martín Nieto, Eric Davis,
Eric Schrijver, Petr Viktorin, Ridge Kennedy and W. Trevor King.
v0.17.3
2012-09-21 16:30:50 +02:00
J. David Ibáñez
6654716eb3 Merge remote-tracking branch 'wking/kwargs-signature' 2012-09-19 20:34:43 +02:00
W. Trevor King
36ae908de2 test: use Signature(encoding=...) in test_commit and test_signature.
Correct tests now that the default name encoding is ASCII.
2012-09-17 14:52:30 -04:00
W. Trevor King
b3b7e98f92 README: Update Signature examples to use the default time arguments. 2012-09-17 14:52:30 -04:00
W. Trevor King
50793b673c signature: Add keyword argument parsing to Signature().
Now you can specify `encoding` without bothering with `time` or
`offset`.
2012-09-17 14:51:41 -04:00