Carlos Martín Nieto
2a429aae98
config: only return the config key in iteration
...
At its core, the config is a key-value storage with peculiar key
equality rules. Make it behave more like a python dictionary and return
the key on iteration.
2014-07-24 18:43:54 +02:00
Carlos Martín Nieto
1e13a10949
Config: expose config rules parsing
...
Expose Config.parse_bool() and Config.parse_int() to parse text
according to git-config rules.
2014-04-21 14:11:41 +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
Carlos Martín Nieto
73e9e58fa4
Config: make bool and int parsing explicit via functions
...
Passing a tuple to the mapping interface isn't the best of interfaces,
as the key is only the string.
Instead, expose `Config.get_bool()` and `Config.get_int()` methods to
parse the values as per the git-config rules before returning the
appropriate type to the user.
The mapping interface itself returns a string.
2014-04-14 19:37:44 +02:00
Carlos Martín Nieto
687dc5388e
config: make type conversion explicit
...
The type of a config value depends on the tool that interprets
it. Parsing eagerly can lead to a situation where we return a bool
instead of a string or a number.
Let the user specify the type themselves by passing in a (str, type)
tuple into the mapping interface.
2014-03-27 18:04:38 +01:00
J. David Ibáñez
d7071b88cd
Update copyright year
2014-02-04 08:02:12 +01:00
Carlos Martín Nieto
35386cbec2
Config: switch from foreach iterator
...
An iterator is much more natural in python, so let's use that.
2014-01-19 17:57:26 +01:00
Carlos Martín Nieto
179c7db940
Don't forget to remove the temporary directory in the config tests
...
When overriding the tear-down function, we must remember to call the
parent's function or we won't clean up the temporary directory for the
test.
2013-08-29 17:18:01 +02:00
J. David Ibáñez
0c86307eb5
Coding style: Silent pep8
2013-05-26 14:39:12 +02:00
Nico von Geyso
4c782f451d
fixed non working test for config.set_multivar()
2013-03-13 12:48:34 +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
21229cb298
fix error message text
2013-02-01 15:19:54 +01:00
delanne
0406841533
- thanks to Martin R. Hufsky for the patch for git_diff_find_similar
...
- I updated the unittest (they failed with the patch), and added a short unittest which emulates --find-copies-harder
2012-11-26 12:18:57 +01:00
Nico von Geyso
3e0c6f521d
new config file has to exist (change in libgit2 - see 270160b)
2012-11-19 23:14:27 +01:00
Nico von Geyso
971fc2f101
fixed config test for config.set_multivar
...
config files have different priorities and only the highest one gets evaluated for set_multivar
2012-11-01 15:18:07 +01:00
W. Trevor King
c36bbf518c
test_config: tell Nose that foreach_test_wrapper() is not a test
...
Signed-off-by: W. Trevor King <wking@tremily.us>
2012-10-25 14:37:43 -04:00
Carlos Martín Nieto
578054b97b
config test: the loop should return 0
...
Returning anything else makes the loop stop, which stops us from
getting to 'core.bare' which the test is looking for.
2012-08-06 17:54:26 +02: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
J. David Ibáñez
ec8047a8c5
Fix errors detected by pyflakes
2012-06-18 11:36:27 -03:00
J. David Ibáñez
1f354149a3
tests: don't leave test files behind
2012-06-18 11:28:19 -03:00
J. David Ibáñez
9ba2324535
Fix unit tests for Python 2.6
2012-06-18 11:08:46 -03:00
authmillenon
b6b4007ffd
Fixed bug in test_add.
2012-06-15 14:14:22 +02:00
Martin Lenders
3df090c761
Implement getting and setting of multivars
2012-06-08 18:34:54 +02:00
Martin Lenders
1acd488c68
Wrap git_config_foreach in Config
2012-06-08 18:34:54 +02:00
Martin Lenders
e126b09380
Implement dictionary-like behaviour for Config
2012-06-08 18:34:54 +02:00
Martin Lenders
e77d248713
Add back reference from Repository to Config
2012-06-08 18:34:54 +02:00
Martin Lenders
fcacea310b
Implement addition of files to Config
2012-06-08 18:34:54 +02:00
Martin Lenders
068b833c87
Add getter for global and system config
2012-06-08 18:34:54 +02:00
Martin Lenders
c4d17b759b
Create Config type
2012-06-08 18:34:54 +02:00