417 Commits

Author SHA1 Message Date
Nico von Geyso
a511f299bb fixex api changes of libgit2 in 64c5112 2012-11-28 18:10:07 +01:00
delanne
0406841533 - thanks to Martin R. Hufsky for the patch for git_diff_find_similar
- I updated the unittest (they failed with the patch), and added a short unittest which emulates --find-copies-harder
2012-11-26 12:18:57 +01:00
Nico von Geyso
20fb789e11 fixed typo 2012-11-22 16:33:40 +01:00
Nico von Geyso
6b3607cf95 only use error message if giterr_last() is not null
exptected errors in libgit2 must not set a git_error.
2012-11-22 15:47:53 +01:00
Nico von Geyso
dbf468b2ec correct error handling for errors other than GIT_ENOTFOUND 2012-11-20 21:02:08 +01:00
Nico von Geyso
3e0c6f521d new config file has to exist (change in libgit2 - see 270160b) 2012-11-19 23:14:27 +01:00
Nico von Geyso
5496028150 throw an IOError instead of KeyError, if git_config_open_ondisk() fails 2012-11-19 23:13:02 +01:00
Nico von Geyso
64bb6efc2b added Error_set_exc() for throwing individual Exceptions 2012-11-19 23:12:12 +01:00
Nico von Geyso
b2359200bb revlog iteration will start with last commit, not the first one 2012-11-19 23:11:18 +01:00
J. David Ibáñez
af1c6ca10d Merge remote-tracking branch 'cholin/repo_state' 2012-11-16 16:55:34 +01:00
Nico von Geyso
af0424e75d Merge branch 'master' into parameter_order 2012-11-16 13:07:21 +01:00
Nico von Geyso
5262c9e23b fixed parameter order for diff functions (libgit2) 2012-11-16 13:04:47 +01:00
Nico von Geyso
88de08288c coding style - use 4 spaces for intendation and a space before keywords 2012-11-15 19:34:52 +01:00
Nico von Geyso
c615ca29cd fixed refcount error
use Py_RETURN_TRUE instead of return Py_True and Py_RETURN_FALSE instead of return Py_False.
Otherwise there will be refcount errors.
2012-11-15 19:32:25 +01:00
J. David Ibáñez
c55881f9ce Fix compile warnings 2012-11-14 18:55:28 +01:00
J. David Ibáñez
40751b62b3 style: remove tabs and trailing white-space 2012-11-14 18:08:08 +01:00
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
Nico von Geyso
36fb7215c7 Merge branch 'master' into head_is_detached 2012-11-04 21:32:59 +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
225f7bd175 added Index_remove 2012-11-04 12:53:32 +01:00
Nico von Geyso
7dbd08edc2 added in Repository: is_empty, is_bare, head_is_orphaned and head_is_detached 2012-11-01 16:17:51 +01:00
Nico von Geyso
1bbb7b549f Added empty test repository 2012-11-01 16:17:29 +01:00
Nico von Geyso
0d2a3a6123 added Repository.is_detached
A repository's HEAD is detached when it points directly to a commit instead of branch.
You can use repo.is_detached to check this.
2012-11-01 15:35:53 +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