21 Commits

Author SHA1 Message Date
Nico von Geyso
a511f299bb fixex api changes of libgit2 in 64c5112 2012-11-28 18:10:07 +01:00
J. David Ibáñez
40751b62b3 style: remove tabs and trailing white-space 2012-11-14 18:08:08 +01: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
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
Nico von Geyso
e402d0e9eb added head-getter for Repository
You do not have to lookup and resolve the HEAD reference anymore if you simply want
the last commit. Repository has now a head-getter which combines all these steps.

example:
  repo = Repository('.')
  head = repo.head
  print(head.message)
2012-05-28 12:41:43 +02:00
Carlos Martín Nieto
7137f8217e Add tests for the short OID support 2012-03-15 05:33:13 +01:00
J. David Ibáñez
4a33c7f806 refs: implement reference reload 2011-12-25 10:46:38 +01:00
J. David Ibáñez
73a4a3a649 refs: resolving a direct ref returns the same object
When resolving a direct reference the same Python object is returned,
with the refcount incremented by one. The reference is reloaded.
2011-12-24 17:04:24 +01:00
J. David Ibáñez
5986688197 refs: fix segfault when using a deleted reference
Before this patch the code below produced a segfault:

  >>> reference.delete()
  >>> reference.name

Now an exception is raised.
2011-12-19 23:40:27 +01:00
J. David Ibáñez
83642a6954 Rename '.sha' to '.hex' 2011-09-02 16:53:17 +02:00
J. David Ibáñez
9f2e61cd8f Add TreeEntry.oid, IndexEntry.oid, Reference.oid 2011-09-02 16:48:35 +02:00
J. David Ibáñez
f09a02a2ee Use UTF-8 encoding in all Python files 2011-08-24 07:42:05 +02:00
J. David Ibáñez
b84b79acd8 Fix running the tests with Python 3
Now "python3 setup.py test" works.
2011-08-24 00:07:20 +02:00
J. David Ibáñez
7950ee1116 Use Python 3 string literals for the unit tests
Now unit tests are broken.
2011-08-13 22:48:23 +02:00
Sebastian Thiel
84cb4616b7 Fixed reference tests, they were dependent on the order of the file-system, which in fact is undetermined. Sorting them to assure order 2011-07-08 11:04:28 +02:00
David Versmisse
858adab759 Implement the References (part II) 2011-04-28 10:25:37 +02:00
David Versmisse
aac4cf1b86 Implement the References (part I) 2011-04-15 11:09:20 +02:00