168 Commits

Author SHA1 Message Date
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
3e0c6f521d new config file has to exist (change in libgit2 - see 270160b) 2012-11-19 23:14:27 +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
J. David Ibáñez
40751b62b3 style: remove tabs and trailing white-space 2012-11-14 18:08:08 +01:00
J. David Ibáñez
81078e2cf7 Merge remote-tracking branch 'delanne/diff_opts' 2012-11-11 19:52:56 +01:00
delanne
783025d327 Fix: "The opt variable is not used in the loop" 2012-11-09 14:55:20 +01:00
delanne
1b7e61145e Merge remote-tracking branch 'upstream/master' into diff_opts 2012-11-05 13:38:43 +01:00
Nico von Geyso
2da04cab2d Merge branch 'master' into create_reference_refactoring 2012-11-04 21:45:41 +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
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
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
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
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
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
J. David Ibáñez
5251343ee7 Merge remote-tracking branch 'wking/revparse' 2012-09-25 15:10:55 +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
a72fab5a76 Merge remote-tracking branch 'bendavis/git_tree_entry_bypath' 2012-09-21 16:52:38 +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
Ridge Kennedy
bc0c0e17a8 Add Blob.size 2012-09-16 22:56:36 +12:00
J. David Ibáñez
430f4dc343 Fix typo in repository test 2012-09-14 14:04:02 +02:00
W. Trevor King
0238fb72df repository: add Repository.revparse_single().
This provides access to libgit2's 'git_revparse_single'.
2012-09-13 17:09:12 -04:00
W. Trevor King
5464eaaf50 Merge branch 'test_repository' into revparse
Get the correct HEAD_SHA for the upcoming revparse_single test.
2012-09-13 17:00:35 -04:00
W. Trevor King
437c1af33f test_repository: fix HEAD_SHA -> 2cdae2 and use assertEqual when testing.
The previous test always passed, because bool(HEAD_SHA) is True.

The update to HEAD_SHA should have happened in:

  commit c06e10e67e746099b8d454212acc56391199eb31
  Author: Petr Hosek <p.hosek@imperial.ac.uk>
  Date:   Tue May 29 17:41:07 2012 +0100

    Support for diff merge operation added
2012-09-13 16:54:07 -04:00
W. Trevor King
477e48ef6c test_diff: hunk.old_lines should be 1 in test_diff_tree and test_diff_merge.
In both cases, the file contents change from 'X contents\n' to 'X
contents 2\n' (where 'X' is 'a' or 'b').  This means were removing one
line and adding another.

I'm not sure how this test was passing against libgit2 v0.17.0, so I
may be missing something important.
2012-09-13 16:30:21 -04:00
W. Trevor King
651aa6a830 tree: rename Tree.attributes to Tree.filemode.
This catches up with changes in libgit2:

  commit 9d7ac675d06dab2e000ad32f9248631af0191f85
  Author: nulltoken <emeric.fermas@gmail.com>
  Date:   Tue Aug 21 11:45:16 2012 +0200

    tree entry: rename git_tree_entry_attributes() into git_tree_entry_filemode()
2012-09-13 16:14:24 -04:00
Petr Viktorin
97aba6b14b Make time and offset arguments to Signature optional
If these are left blank, use git_signature_now to insert the current time.
Specifying one but not the other causes a TypeError.
Test inlcluded.
2012-09-07 23:51:36 +02:00
Alex Chamberlain
1a2dd95575 Added unit test for Repository.create_blob_fromfile 2012-08-24 10:47:12 +01:00
Carlos Martín Nieto
f3dab28082 diff: add old and new OID values to Hunk
These can be important, and are necessary to create a patch from this
data.
2012-08-15 20:37:43 +02:00
Carlos Martín Nieto
11d0c9a30f diff: expose the hunk header
We can rebuild it from the data we already have, but this will allow
us to get the function headers in it once the library supports it.
2012-08-15 20:07:49 +02:00
Carlos Martín Nieto
db35bda219 Run the diff tests 2012-08-15 19:54:59 +02:00
Ben Davis
689412d0a2 Added error checking when calling git_tree_entry_bypath 2012-08-11 16:24:30 -05:00
Carlos Martín Nieto
578054b97b config test: the loop should return 0
Returning anything else makes the loop stop, which stops us from
getting to 'core.bare' which the test is looking for.
2012-08-06 17:54:26 +02:00
Ben Davis
398e717ec6 Implemented git_tree_entry_bypath within Tree.__getitem__ 2012-08-03 01:09:45 -05:00
J. David Ibáñez
edcd803e7e Remove the __authors__ var from py files 2012-07-18 12:12:04 +02: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
J. David Ibáñez
ec8047a8c5 Fix errors detected by pyflakes 2012-06-18 11:36:27 -03:00
J. David Ibáñez
1f354149a3 tests: don't leave test files behind 2012-06-18 11:28:19 -03:00
J. David Ibáñez
d27cf0b687 style: remove trailing white-spaces 2012-06-18 11:22:56 -03:00
J. David Ibáñez
9ba2324535 Fix unit tests for Python 2.6 2012-06-18 11:08:46 -03:00
authmillenon
b6b4007ffd Fixed bug in test_add. 2012-06-15 14:14:22 +02:00
Martin Lenders
3df090c761 Implement getting and setting of multivars 2012-06-08 18:34:54 +02:00
Martin Lenders
1acd488c68 Wrap git_config_foreach in Config 2012-06-08 18:34:54 +02:00
Martin Lenders
e126b09380 Implement dictionary-like behaviour for Config 2012-06-08 18:34:54 +02:00