65 Commits

Author SHA1 Message Date
J. David Ibáñez
08d3dcc82e Update unit tests 2011-04-05 12:37:26 +02:00
J. David Ibáñez
8bbc75148f Add the parents param to the Commit init method
And fix unit tests for the commit object.
2011-04-05 11:22:56 +02:00
J. David Ibáñez
d395a2963e Updating to libgit2 v0.11.0 (work in progress)
"import pygit2" works again, but the tests do not yet pass
2011-04-01 19:07:47 +02:00
J. David Ibáñez
aa2982b687 Updating to libgit2 v0.11.0 (work in progress) 2011-03-31 19:06:10 +02:00
J. David Ibáñez
6c7df765c1 Fix typo: git_object => git_blob 2011-03-18 12:18:17 +01:00
J. David Ibáñez
c411fd8203 Make pygit2 build against new libgit2 API
There is an small change to the API, the 'tag.target_type' getter has
been removed, just use 'tag.target.type' instead.
2011-03-15 15:29:55 +01:00
J. David Ibáñez
8abb9007c9 Start the documentation 2011-03-08 19:02:50 +01:00
J. David Ibáñez
b419bd0550 README: we support Python 2.5 too 2011-03-08 18:39:10 +01:00
J. David Ibáñez
89033ebc76 Merge remote branch 'john/fix-link' 2011-03-08 18:32:23 +01:00
J. David Ibáñez
204c0595f1 Add function 'init_repository' 2011-03-07 19:37:38 +01:00
J. David Ibáñez
2b84b37384 Give access to the path of an index entry 2011-03-07 17:06:42 +01:00
J. David Ibáñez
29a754bf43 Make pygit2 build against new libgit2 API
Now libgit2 uses reference counting for Git objects.
2011-03-04 12:05:53 +01:00
J. David Ibáñez
a1e79ded4e Merge remote branch 'davidv/index' 2011-03-03 19:52:32 +01:00
J. David Ibáñez
8da3f16da7 Merge remote branch 'john/add-commit-attributes' into revwalk
Conflicts:
	pygit2.c
	test/test_commit.py
2011-03-03 16:24:30 +01:00
J. David Ibáñez
3e45a68371 Add missing closure to the Commit.tree getseter 2011-03-03 16:20:35 +01:00
John Szakmeister
5b967f1a9d Turn the link to libgit2 into an actual link. 2011-02-27 08:42:24 -05:00
John Szakmeister
f94028fc4d Fix a stylistic nit. 2011-02-27 07:02:26 -05:00
John Szakmeister
2acf49c6f7 Support adding parents to a commit. 2011-02-27 07:01:33 -05:00
John Szakmeister
fd327d76e0 Uncomment a few tests. 2011-02-27 06:31:53 -05:00
John Szakmeister
3fc9a840a1 Add the parents attribute to commit.
Only support getting the attribute for now.
2011-02-26 16:31:15 -05:00
John Szakmeister
3b403247d1 Add a test for the sha of a commit. 2011-02-26 16:14:14 -05:00
J. David Ibáñez
b050de2b26 Make TreeEntry not to inherit from Object
Tree entries are not Git objects like commits, blobs, etc.

By inheriting from Object it was even possible to produce a segfault
when accessing inherited attributes like 'type'.
2011-02-23 19:01:57 +01:00
J. David Ibáñez
7e8d2bb19d Implement Commit.tree getter
We need this to be able to make an equivalent to "git log -- path"
2011-02-23 17:08:25 +01:00
J. David Ibañez
0032573ca8 Add more unit tests for revision walking
Signed-off-by: J. David Ibañez <jdavid@itaapy.com>
2011-02-21 13:19:25 +01:00
J. David Ibañez
0416276d2f Improve the Repository.walk method a little
Now it is possible to pass None as the commit hash to get a non
initialized walker.  A second and optional parameter allows to set
the sorting mode.

Signed-off-by: J. David Ibañez <jdavid@itaapy.com>
2011-02-14 16:05:45 +01:00
J. David Ibañez
fc4f82cc68 Complete support for revision walk
Signed-off-by: J. David Ibañez <jdavid@itaapy.com>
2011-02-14 13:18:12 +01:00
J. David Ibañez
296f521496 Start support for revision walking 2011-02-11 18:03:33 +01:00
David Versmisse
cde5b8b614 Add a default value for "stage" (0) in Index.add 2011-02-11 12:12:49 +01:00
J. David Ibañez
70bdb12cb1 Fix url & license in the setup file 2011-02-10 11:40:20 +01:00
J. David Ibañez
83a78dac5f Fix unit tests for Python 2.5 2011-02-09 16:30:15 +01:00
J. David Ibañez
f287cea350 Fix compilation warning on unused variable 2011-02-09 15:22:38 +01:00
J. David Ibañez
f643037b79 Add unit tests for the index file 2011-02-08 18:22:09 +01:00
J. David Ibañez
54d944d0b6 Implement mapping protocol for the index file
It is possible to:

  len(index)      # get the number of entries in the index
  '...' in index  # check whether there is an entry with the given path
  index[1]        # get entry by position
  index['...']    # get entry by path
  del index[...]  # remove entry by position or path
2011-02-08 15:48:24 +01:00
J. David Ibañez
bc1e00ae05 Initial support for index entries
Now we can do this:

repo = Repository('.git')
index = repo.index
index.read()
n = index.find('readme.txt')
entry = index.get(n)
blob = repo[entry.sha]
2011-02-08 14:08:24 +01:00
J. David Ibañez
117ab092f5 Partial support for index operations
For every function not involving index entries this commit adds a
method to the Index type.
2011-02-07 21:38:02 +01:00
J. David Ibañez
fe1540f546 Add index test case for a non-bare repo 2011-02-07 13:28:39 +01:00
J. David Ibañez
8c08923309 Start support for the index file 2011-02-07 12:39:57 +01:00
J. David Ibañez
f615190371 Complete .gitignore
Ignore files produced when running the tests, and vim swap files.
2011-02-07 12:37:47 +01:00
J. David Ibañez
7d91d44567 Make pygit2 build against new libgit2 API
Now Tree.add_entry returns the created entry.
2011-02-02 17:49:37 +01:00
Rui Abreu Ferreira
9e919c3966 Make pygit2 build against new libgit2 API
- Replace git_person with git_signature
- Replace include directives with git2
2011-01-07 15:24:03 +00:00
Vicent Marti
58a439467f Update README.md
Clone URL was wrong; installation instructions were outdated.

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-11-30 21:28:16 +02:00
Vicent Marti
a8b163aa67 Update README file
Add installation instructions, dependencies, authors, etc

Signed-off-by: Vicent Marti <tanoku@gmail.com>
2010-11-13 19:31:56 +02:00
Dave Borowitz
db1e4ace37 Fix some Tree error messages.
Change-Id: Ic72c307436d2e1abb610ac8a3dab26f1c4995255
2010-11-12 13:28:48 -08:00
Dave Borowitz
673a045a30 Add KeyError assert to test_repository.
Change-Id: Ifd29be456c61fdd476a3298b1ead110283d2424e
2010-11-12 13:28:48 -08:00
Dave Borowitz
520556e552 Add assertRaisesWithArg for better KeyError/IndexError testing.
Change-Id: Iadc9075e8e705579e4c0daf49fe7110db55e87c0
2010-11-12 13:28:48 -08:00
Dave Borowitz
8ad31c1db4 Update various calls to new error-code-returning interface.
Change-Id: I56d60a99e5eb251825b1225b06dadb7848d5b2dd
2010-11-12 13:28:48 -08:00
Dave Borowitz
b59536cd06 Reorganize error helper functions.
-Factor out a function for mapping libgit2 error numbers to Python
 exception types.
-Rename Error_set_py_str -> Error_set_py_obj.
-Simplify formatting of Error_set_py_obj to just prefix the git_strerror
 with the offending object.
-Add Error_set_str, like py_str but with C strings.

Change-Id: I51fe47c96a0c57aaeafd2c98418c0c548b93147d
2010-11-12 13:28:48 -08:00
Dave Borowitz
a2370dfa3e Factor out functions to build and parse person tuples.
This also gives us more flexibility if we decide to change the person
object representation to something other than a tuple.

Also fix a format string to correctly cast to long long.

Change-Id: I0ed496c6807328084a26a956c77871c3cb76eedf
2010-11-12 13:22:10 -08:00
Dave Borowitz
38ba0054c0 Correctly return Py_None.
Change-Id: Id41325a71a9433dbee3746fb4c7bd3d834a7d64c
2010-11-12 13:22:10 -08:00
Dave Borowitz
e077abe1a6 Add Tag class.
Change-Id: Ia7240e96dd6da69d373f385bde67e8d3aa70f7b1
2010-11-12 13:22:10 -08:00