11 Commits

Author SHA1 Message Date
J. David Ibáñez
70edbf256a Update copyright years 2015-10-11 18:48:59 +02:00
J. David Ibáñez
d7071b88cd Update copyright year 2014-02-04 08:02:12 +01:00
Carlos Martín Nieto
3a83cb44b6 Oid: Deprecate 'hex' in favour of str() or unicode()
Python has built-in functions to get a string representation of an
object id, so let's use that instead of using a custom attribute.
2014-01-24 10:28:53 +01:00
J. David Ibáñez
0c86307eb5 Coding style: Silent pep8 2013-05-26 14:39:12 +02:00
J. David Ibáñez
94f44feb22 Fix unit tests with Python 2.6 2013-04-18 23:59:34 +02:00
J. David Ibáñez
4cf1fc2371 Make Oid hashable 2013-04-18 23:57:19 +02:00
J. David Ibáñez
f74a211f14 oid: now only accept Oid or hex, not raw
Every method that takes an oid has changed what it accepts.

Before it was (in both Python 2 and 3):

- An Oid object
- An hex oid, represented as a unicode string
- A raw oid, represented as a bytes string

Now the behaviour is different between Python 2 and 3.

Now in Python 2 we take:

- An Oid object
- An hex oid, represented as a bytes or unicode string

Now in Python 3 we take:

- An Oid object
- An hex oid, represented as a unicode string

We have dropt direct support for raw strings. To use a raw string first
build an Oid object: oid = Oid(raw=raw)

We have also dropt support for short raw oids. The Oid constructor takes
full oids, if passed short oids the behavior is undefined.
2013-04-18 20:32:30 +02:00
J. David Ibáñez
a9c9f25ce2 oid: support rich comparisons (less than, etc.) 2013-04-14 14:08:46 +02:00
J. David Ibáñez
bd54d28157 Fix for Python3, and add Oid cmp tests 2013-04-14 13:50:09 +02:00
J. David Ibáñez
406c317572 Return Oid wherever we returned raw oid (bytes) before
Changes:

- Return Oid wherever we returned raw oid (bytes) before
- Now py_str_to_git_oid accepts Oid objects
- Add ability to compare two Oid objects
2013-04-14 12:26:22 +02:00
J. David Ibáñez
f8544cc514 Add Oid type 2013-04-13 13:04:52 +02:00