38 Commits

Author SHA1 Message Date
Carlos Martín Nieto
a3e7a115f4 Provide method for deleting a remote
Fixes #418
2014-09-04 15:57:05 +02:00
Matthew Duggan
0813ec7923 Fix use of skipIf. 2014-08-18 21:17:36 +09:00
Matthew Duggan
bedd9ee315 Don't test refcounts in pypy as they don't make sense there 2014-08-18 21:13:03 +09:00
Matthew Duggan
9ce6a26db3 Add some tests for refcounts to check for leaks 2014-08-18 18:23:10 +09:00
Carlos Martín Nieto
bde58d9727 Remote: make renaming take a method call
Renaming a remote in pygit2 has been done via Remote.name= up to now,
but this is inherently unsafe, as it provides no way to pass up the
refspecs that libgit2 was unable to remap.

In fact, if there ever was such problem, we would have segfaulted.

libgit2 now provides a much more direct way of getting back the results,
so expose it as the return value of Remote.rename(). This also removes
the hint that a rename might be something that happens only to the
in-memory structure.
2014-06-08 20:35:21 +02:00
Carlos Martín Nieto
7ed89b0aab Remote: protect against invalid input on rename
The C API expects a non-NULL new name and raises an assertion if we
don't protect against such input, so let's guard against falsy values,
which also takes care of the empty string, which is also not valid
input.
2014-04-17 23:18:31 +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
J. David Ibáñez
d7071b88cd Update copyright year 2014-02-04 08:02:12 +01:00
J. David Ibáñez
977c315c21 Preparing for release 2014-02-02 15:07:47 +01:00
Carlos Martín Nieto
c2b2c5dd16 remote: call user-provided callbacks
The user can set 'progress', 'transfer_progress' and 'update_tips' to be
notified whenever one of those happen.
2014-01-25 10:48:49 +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
0c3a700e30 Remote: harden the resfpec setters
The object passed must be a list of strings, so make sure we fail by
raising an error instead of segfaulting.
2014-01-22 23:30:02 +01:00
Carlos Martín Nieto
1040a6330a Remote: make fetch/push_refspecs attributes
This is a lot more pythonic than two sets of getter-setter
functions. The old ones are left for backwards compatibility but they
should be removed in the next release.
2014-01-22 23:06:52 +01:00
XTao
9ef75d846e Add fetch & push refspec. 2014-01-22 15:25:25 +08:00
J. David Ibáñez
4c28c487db Merge remote-tracking branch 'carlos/push-url' 2014-01-20 10:45:27 +01:00
Carlos Martín Nieto
e28c06fc1d Remote: allow access to the push url 2014-01-20 03:17:34 +01:00
Carlos Martín Nieto
17a49bb417 Refspec: implement transform functions 2014-01-19 23:59:47 +01:00
Carlos Martín Nieto
e681a47245 Refspec: create the type to wrap refspecs 2014-01-19 23:59:26 +01:00
Jose Plana
f69eeae108 Refactor getters to become methods 2013-11-27 19:26:24 +01:00
Jose Plana
336f042e22 Added methods to interact with the remote refspecs 2013-11-25 13:06:04 +01:00
Fraser Tweedale
134d87ab2a implement push support
Implement push support via Remote.push which is called with a single
refspec and raises GitError (with an appropriate message where
possible) if the push fails.

Note that local push to non-bare repository is currently not
supported by libgit2.
2013-08-30 17:42:24 +10:00
J. David Ibáñez
534d98b6b2 Comment the remote test that segfaults
See libgit2/libgit2#1692

To uncomment whenever libgit2 0.20 is released
2013-07-05 23:23:31 +02:00
J. David Ibáñez
e56e8600ac Upgrading to libgit2 0.19 (wip)
Removed:

- Remote.fetchspec

Added:

- Remote.refspec_count
- Remote.get_refspec(n)
2013-06-30 13:35:51 +02:00
Daniel Rodríguez Troitiño
a6567c4eb6 Add Remote.save method. 2013-05-29 00:24:40 +02:00
J. David Ibáñez
0c86307eb5 Coding style: Silent pep8 2013-05-26 14:39:12 +02:00
J. David Ibáñez
74a1fdab60 Fixing coding style with the help of pep8 (wip) 2013-05-26 10:32:05 +02:00
Nico von Geyso
119d0e0344 added missing unittest.main() for tests_remote.py 2013-03-13 12:48:58 +01:00
Nico von Geyso
511b760a56 added tests for notes 2013-03-11 20:48:58 +01:00
Nico von Geyso
da4abb78cb added test data for diff.find_similiar 2013-03-04 18:37:45 +01:00
J. David Ibáñez
29ce23c0d5 Update copyright 2013-03-02 12:16:16 +01:00
J. David Ibáñez
a96d494747 Coding style
Including:

- Lines longer than 79 chars
- Spaces at the end of line
- Wrong indentation
- Comma not followed by an space
- C++ style comments: //
2013-03-02 11:40:42 +01:00
Nico von Geyso
0823621bb4 renamed remote_create() to create_remote() 2013-02-16 21:58:42 +01:00
Nico von Geyso
9c9e0f9755 added tests for remote.fetch() 2013-02-16 21:56:34 +01:00
Nico von Geyso
4873529129 added setter for remote fetchspec 2013-02-16 20:47:45 +01:00
Nico von Geyso
ee32acdf39 added remote fetchspec getter 2013-02-16 19:51:18 +01:00
Nico von Geyso
d150937068 added functionality to set remote urls 2013-02-16 19:47:31 +01:00
Nico von Geyso
ffaf0d5ada added functionality to rename remotes 2013-02-16 19:47:31 +01:00
Nico von Geyso
c1e645ea1a moved remote tests to test_remote.py 2013-02-16 19:47:31 +01:00