33 Commits

Author SHA1 Message Date
J. David Ibáñez
70edbf256a Update copyright years 2015-10-11 18:48:59 +02:00
Nicolas Dandrimont
2b083a1509 Add _name attribute to TreeEntry
This mirrors the _message attribute for Tag, which gives you the raw
bytes from the entry name. Useful to parse repos where some filenames
aren't encoded as utf-8, such as https://github.com/wuts/earthquake.
2015-09-28 18:24:48 +02:00
J. David Ibáñez
ade211de60 tests: fix warning 2015-09-10 11:30:37 +02:00
Nicolas Dandrimont
ac7738bbb3 Add type attribute to TreeEntry
This allows complete iteration and rebuilding of a tree without hitting
the object store for every entry.
2015-09-09 21:41:00 +02:00
Carlos Martín Nieto
c099655fc0 TreeEntry: compare ids when two entrie sort equally
The function we were using `git_tree_entry_cmp()` is only meant for
git-compatible sorting in a tree and thus does not take the id into
account. This is however important in order to keep value equality. In
order to avoid issues with assymetry, we compare the id any time when
two entries are equal according to their position in a tree.
2015-03-15 00:15:15 +01:00
J. David Ibáñez
d7071b88cd Update copyright year 2014-02-04 08:02:12 +01:00
Carlos Martín Nieto
5410128187 TreeEntry: move to use 'id' attribute for the object's id
Similar to the Object change, we should be using 'id' when referring to
the target's id.x
2014-01-24 11:25:39 +01:00
Carlos Martín Nieto
500a6793c4 Object: move to use an 'id' attribute instead of 'oid'
This looks like a left-over from the libgit2 misnaming. The current
consensus is that 'oid' is the data type and 'id' is the name of the
attribute.
2014-01-24 11:04:34 +01:00
Carlos Martín Nieto
5baaf287d2 Tree: let contains look in subtrees
Allow looking in subtrees as a convenience in the 'contains'
function. As slashes are not allowed to be part of the name of an entry,
there is no ambiguity in what they mean.
2014-01-20 03:37:59 +01:00
Carlos Martín Nieto
4dc90f78a9 TreeEntry: add rich comparison function
Allow direct comparisons between TreeEntry objects, which also allows us
to use assertEqual in the sanity check test.

This fixes #305.
2014-01-19 17:10:40 +01:00
J. David Ibáñez
42aed417d4 Add TreeBuilder.get and remove TreeEntry.to_object
Also, check errors from git_tree_entry_dup
2013-05-04 00:31:03 +02:00
Nico von Geyso
e99573dfb8 reactivated TreeBuilder test 2013-03-12 23:52:42 +01:00
J. David Ibáñez
29ce23c0d5 Update copyright 2013-03-02 12:16:16 +01:00
J. David Ibáñez
5251343ee7 Merge remote-tracking branch 'wking/revparse' 2012-09-25 15:10:55 +02: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
Ben Davis
689412d0a2 Added error checking when calling git_tree_entry_bypath 2012-08-11 16:24:30 -05: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
Han-Wen Nienhuys
21a366e049 Change signature of TreeBuilder.insert to take (name, oid, attribute).
This is analogous to git_treebuilder_insert(); update tests.
2012-03-30 00:11:30 -03:00
J. David Ibáñez
a6a36ad803 Now TreeEntry points back to the repo
Instead of pointing back to the tree.
2012-03-11 22:50:55 +01:00
J. David Ibáñez
f11533a65a Revert "(issue #56) Remove TreeEntry.to_object"
This reverts commit 4cdb1a83b430fa27e2b0800ce17751631b036a78.
2012-03-11 22:40:37 +01:00
J. David Ibáñez
4cdb1a83b4 (issue #56) Remove TreeEntry.to_object
This is one way to enable implementing 'TreeBuilder.get'. It also makes
pygit2 a little lower-level. And makes TreeEntry consistent with IndexEntry,
which lacks such a function.
2012-02-26 19:41:17 +01:00
J. David Ibáñez
83642a6954 Rename '.sha' to '.hex' 2011-09-02 16:53:17 +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
500a148398 tests: fix syntax error on octal literals for Py 3 2011-08-19 00:44:48 +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
Julien Miotte
30078270bb Adding a test on Tree objects iteration. 2011-07-11 22:27:03 +02:00
J. David Ibáñez
08d3dcc82e Update unit tests 2011-04-05 12:37:26 +02:00
J. David Ibañez
fe1540f546 Add index test case for a non-bare repo 2011-02-07 13:28:39 +01:00
Dave Borowitz
520556e552 Add assertRaisesWithArg for better KeyError/IndexError testing.
Change-Id: Iadc9075e8e705579e4c0daf49fe7110db55e87c0
2010-11-12 13:28:48 -08:00
Dave Borowitz
35f094b57b Add Tree and TreeEntry classes, with tests.
Change-Id: Idadd5fc59b85506260a1f57b5e7488aed590bfa1
2010-11-12 13:22:08 -08:00