364 Commits

Author SHA1 Message Date
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
W. Trevor King
f10d2b7b3f pygit2:version: add 'pygit2.__version__' for easy access from client software.
Moved the hardcoded version from setup.py to pygit2/version.py so
client software can figure out which version of pygit2 it's using.
Having setup.py import pygit2.version.__version__ removes duplication,
and also means that setup.py will always use the local version (and
not the version of a previously installed pygit2).
2012-09-17 10:16:25 -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
cc7f137f7b object: factor wrap_object out of lookup_object_prefix.
Generating an `Object *` from a `git_object *` may be useful in other
functions (e.g. the upcoming `Repository_revparse_single`).
2012-09-13 16:41:56 -04:00
W. Trevor King
b66fa71bae Merge branch 'libgit2-dev' into revparse
`git_revparse_single` only dates back to

  commit ac250c56c7d7bb11691c9dfbcd0dbf580d85e177
  Author: Ben Straub <bstraub@github.com>
  Date:   Wed Apr 25 16:24:22 2012 -0700

    First stab at implementation of rev-parse.

which is not included in libgit2 0.17.0.  We need to pull in these
patches to work with the current `development` branch of libgit2,
which does include the revparse code.
2012-09-13 16:37:30 -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
W. Trevor King
8e19102815 index: Add NULL stats argument to git_index_read_tree call.
This catches up with changes in libgit2:

  commit 4bf5115642b64851f9a32a8157010b588bf44103
  Author: Ben Straub <bstraub@github.com>
  Date:   Mon Jul 30 14:52:46 2012 -0700

    Enable stats on git_index_read_tree.

    Replace with the contents of
    git_index_read_tree_with_stats() and improve
    documentation comments.
2012-09-13 13:53:37 -04:00
W. Trevor King
91e211d4f9 error: replace GIT_REVWALKOVER with GIT_ITEROVER.
This catches up with changes in libgit2:

  commit f335ecd6e126aa9dea28786522c0e6ce71596e91
  Author: Russell Belfer <rb@github.com>
  Date:   Thu Aug 30 14:24:16 2012 -0700
2012-09-13 13:48:00 -04:00
Petr Viktorin
32753a6d17 Add GIT_FILEMODE_* constants
These are useful when putting files in the treebuilder
2012-09-08 15:19:03 +02:00
J. David Ibáñez
8ca19bb723 Merge remote-tracking branch 'encukou/git_signature_now' 2012-09-08 08:38:11 +02: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
Eric Schrijver
32ff474dc1 More obvious diff example
By diffing HEAD~1 with HEAD, we show the effect of the latest commit.

The provided example diffed HEAD with HEAD~1, which shows a diff
that goes back in time.
2012-09-05 03:03:54 +03:00
J. David Ibáñez
dc1cfe80e6 Merge remote-tracking branch 'edavis/fix-diff-example' 2012-08-28 10:30:36 +02:00
Eric Davis
fb49990640 docs: Fix 'Diff' example
t1 should point to a tree, not a commit.
2012-08-25 20:30:52 -07:00
Alex Chamberlain
1a2dd95575 Added unit test for Repository.create_blob_fromfile 2012-08-24 10:47:12 +01:00
Alex Chamberlain
7e3b21ba55 Added Repository.create_blob_fromfile 2012-08-23 12:47:12 +01:00
Ferengee
f60b8a35b5 git_index_read_tree now accepts a stats structure
Indexer stats may be NULL but the method still needs three arguments
2012-08-20 18:26:57 +03:00
Carlos Martín Nieto
6e06863722 diff: expose the filemode through Hunk 2012-08-15 21:05:12 +02: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
1138949a69 diff: make sure malloc succeeds 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
J. David Ibáñez
211e71235c Merge remote-tracking branch 'carlos/less-work' 2012-08-07 10:20:17 +02:00
Carlos Martín Nieto
f94fe00673 travis: do a shallow clone of libgit2 and don't build the tests
This just adds time to the tests. We're not testing the library, but
the bindings, so do a shallow clone and stop cmake from building clar.
2012-08-06 18:13:26 +02: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
0821e7bf00 Release v0.17.2
Now the MANIFEST file is automatically built from Git. This fixes the
source distribution.
v0.17.2
2012-07-24 12:40:26 +02:00