89 Commits

Author SHA1 Message Date
J. David Ibáñez
a53d8b2213 Merge remote-tracking branch 'djmattyg007/doc_fixes' 2014-08-26 10:31:53 +02:00
djmattyg007
629eea01e9 Allow objects of type Branch to be passed to Repository.checkout()
Branch inherits from Reference, so there's no reason why we shouldn't be
able to pass a Branch object.
2014-08-23 11:23:17 +10:00
djmattyg007
9718fd8c32 Add note about checkout('HEAD') being identical to checkout_head() 2014-08-23 01:08:32 +10:00
djmattyg007
2bd73f3bdf Clear up confusion regarding accepted types for Repository.checkout() refname parameter 2014-08-23 01:06:30 +10:00
J. David Ibáñez
be807a1dfc internal: split code for Python 2/3 compatibility 2014-07-28 17:51:51 +02:00
J. David Ibáñez
7df11bf817 internal: rename "to_str" to "to_bytes" for clarity 2014-07-28 17:30:38 +02:00
J. David Ibáñez
4c375907c5 Make checkout to fail on unexpected options 2014-07-19 12:22:34 +02:00
vtemian
93369b0a7c Cleanup a little bit the code 2014-07-14 20:21:24 +03:00
Carlos Martín Nieto
763b571c84 checkout: add support for overriding the target directory 2014-07-11 14:49:56 +02:00
Carlos Martín Nieto
af38211d0c checkout: move the code to cffi
As part of this, make the strategy part of **kwargs, in preparation for
supporting more options.
2014-07-11 14:42:29 +02:00
Carlos Martín Nieto
97ee7ab179 Move Index to cffi
This commit gives us feature-parity with the version in C.
2014-07-10 09:08:16 +02:00
vtemian
d8864bdf02 Added docs 2014-07-09 16:50:17 +03:00
vtemian
19dd7629d3 Proper naming 2014-07-09 16:46:52 +03:00
vtemian
02fd05baae Added clean_state_files 2014-07-09 16:39:34 +03:00
Carlos Martín Nieto
b1bacdd8d5 Wrap config snapshot functions
These allow complex reads to come from the same version of the config.
2014-05-18 11:03:30 +02:00
Carlos Martín Nieto
9309329b5a Merge pull request #361 from carlosmn/cffi-config
Config: move to cffi
2014-04-26 16:39:50 +02:00
Carlos Martín Nieto
c41c1a1c97 Config: move to cffi
This halves the amount of code we have to take into account for dealing
with the config.

There is a slight change in the API. Config.get_multivar() returns an
iterator instead of a list, which lets us reuse code from the general
iterator and is closer to libgit2's API.
2014-04-21 14:11:41 +02:00
J. David Ibáñez
d8bd6f73ab Merge remote-tracking branch 'kluyver/docstrings-update' 2014-04-19 11:38:21 +02:00
Thomas Kluyver
569d396f0d Use repo.head.target instead of repo.head.get_object().hex 2014-04-18 13:44:25 -07:00
Thomas Kluyver
37c01d79c5 Update some docstrings which had got out of date. 2014-04-17 10:13:26 -07:00
Carlos Martín Nieto
5a20510f8a Safer repository pointer extraction
Casting a pointer to a non-pointer type is something which you should
never do. Instead, do something a bit more convoluted, but which is
guaranteed to give us the right pointer, as well as making sure that the
memory we exchange between python/cffi and the C extension is of the
right pointer size.

While we're touching this code, fix which object we pass to the Remote
constructor to keep alive. We need to pass the Repository object to
stop it from becoming unreferenced (and thus freeing memory the remote
needs) instead of the git_repository pointer.
2014-04-16 22:12:54 +02:00
Carlos Martín Nieto
c76c3f0195 Start implementing remotes with CFFI
This moves enough code into python with CFFI to pass the test_remotes
unit tests. There is no credentials support yet.

There is a small change in the return value of Remote.fetch() in that we
now return a TransferProgress object instead of extracting a few values
into a dictionary.
2014-04-14 11:42:51 +02:00
Thomas Kluyver
af2528418a More informative repr for Repository objects 2014-03-25 15:13:10 -07:00
J. David Ibáñez
d7071b88cd Update copyright year 2014-02-04 08:02:12 +01:00
Daniel Rodríguez Troitiño
1062ab638b Implement Repository.lookup_branch. Constants for local and remote branches. 2013-05-26 17:43:28 +02:00
J. David Ibáñez
0c86307eb5 Coding style: Silent pep8 2013-05-26 14:39:12 +02:00
J. David Ibáñez
5904a8752c docs: fix warning 2013-05-24 23:10:55 +02:00
Nico von Geyso
6dd14d799e Fixed: Use GIT_DIFF_NORMAL as default flag for Diff 2013-05-20 15:38:49 +02:00
Nico von Geyso
86aafebb6d Fixed: remove OrderedDict for compability reasons (python2.6) 2013-05-20 15:13:04 +02:00
Nico von Geyso
77b5cdce5b Refactored: get rid of type check for treeish_to_tree in Diff 2013-05-20 14:58:54 +02:00
Nico von Geyso
6ce71a2799 Added: support for context_lines and interhunk_lines for diffs 2013-05-20 14:49:48 +02:00
Nico von Geyso
0fc7a4fbad Refactored Index.diff() into Index.diff_to_tree()/diff_to_workdir() 2013-05-18 15:29:28 +02:00
Nico von Geyso
196d0595b0 Added: Repository.diff() - porcelain method similiar to 2013-05-18 14:48:05 +02:00
J. David Ibáñez
974f16ca69 Re-work the checkout API
New API:

  Repository.head = refname
  Repository.checkout_head(strategy)
  Repository.checkout_index(strategy)
  Repository.checkout_tree(treeish, strategy)

Changed API:

  # Before
  Repository.checkout(strategy=GIT_CHECKOUT_SAFE_CREATE, reference=None,
                      head=False)

  # Now
  Repository.checkout(refname=None, strategy=GIT_CHECKOUT_SAFE_CREATE)
2013-05-05 21:45:39 +02:00
J. David Ibáñez
3a0bafa12b Rename "low level" reference creation methods
Rename Repository methods:

- git_reference_create          => create_reference_direct
- git_reference_symbolic_create => create_reference_symbolic
2013-05-04 09:30:37 +02:00
J. David Ibáñez
67417c7f56 create_reference, drop the symbolic param (#213)
Now we figure out whether it is a direct or symbolic reference based on
the type and value of the target. This guessing will fail in very very
rare situations, for that we still have the explicit lower level API.
2013-04-27 11:39:37 +02:00
J. David Ibáñez
ad4b4cc4c5 Implement the Repository mapping interface in Python
Add 'Repository.get' and low level 'Repository.git_object_lookup_prefix'
2013-03-09 23:14:17 +01:00
J. David Ibáñez
d8b2514029 Rename low level reference creation methods
The idea is to keep exactly the same name as in libgit2
2013-03-03 23:01:42 +01:00
J. David Ibáñez
9ffc14148e Now we have a Repository class written in Python 2013-03-03 14:44:42 +01:00