Commit graph

261 commits

Author SHA1 Message Date
Antoine Beaupré
07e7f2dcad fixup warning message 2015-10-17 21:50:14 -04:00
Antoine Beaupré
fb68c6ff70 always convert the chunks cache we find
it seems it is possible that the chunks files are copied but *not*
converted. this may have happened here because the conversion was
interrupted, although the specific scenario is still unclear (but it
did happen during manual tests here). therefore reproducing this
problem seems to be difficult, hence the lack of tests for this
specific issue.

since we consider the header replacement code to be safe, that we
always convert shouldn't pose any additional threat to the existing
borg chunk cache.
2015-10-17 21:44:50 -04:00
Antoine Beaupré
c4599d8ea4 fix cascading failure with the index conversion code
this resolves bug #something where the index file could not be
converted, completely breaking conversion.

it seems that, during some refactoring, the index conversion code was
completely dropped. this was missed by the unit tests because the repo
can still be opened by the constructor even though the index is
invalid, so tests need improvements there.
2015-10-17 21:44:50 -04:00
TW
2dda41dc2a Merge pull request #294 from anarcat/x-option
add -x flag, common to GNU utilities
2015-10-17 20:06:02 +02:00
Antoine Beaupré
eacb0b9e83 Merge branch 'logging-refactor' into upstream 2015-10-17 12:29:52 -04:00
Antoine Beaupré
4fd06e2634 add -x flag, common to GNU utilities
it should also probably be --one-file-system for coherence with du(1)
2015-10-17 12:23:45 -04:00
Thomas Waldmann
7efab2f254 benchmark tests: improve comments 2015-10-14 01:00:25 +02:00
Thomas Waldmann
a5a6ba0d77 integrate pytest-benchmark, test create, extract, list, delete, info, check, help, fixes #146
Instead of "realistic data", I chose the test data to be either all-zero (all-ascii-zero to be precise)
or all-random and benchmark them separately.
So we can better determine the cause (deduplication or storage) in case we see some performance regression.

"help" is benchmarked to see the minimum runtime when it basically does nothing.

also:
- refactor archiver execution core functionality into exec_cmd() so it can be used more flexibly
- tox: usually we want to skip benchmarks, only run them if requested manually
- install pytest-benchmark - run tox with "-r" to have it installed into your .tox envs
2015-10-11 16:07:11 +02:00
Antoine Beaupré
dbc183f87f drop support for Python 2 2015-10-09 14:13:58 -04:00
Antoine Beaupré
bdbdbdde90 Merge remote-tracking branch 'origin/master' into logging-refactor
Conflicts:
	borg/archive.py
	borg/archiver.py
	borg/cache.py
	borg/key.py
2015-10-09 12:58:27 -04:00
Antoine Beaupré
fd41408de2 move progress information out of tests and back in converter
this was a remnant of when i was writing the converter/upgrader code,
and was destined to be a general progress message in the migration
process. i removed a more technical, internal debugging message in
exchange
2015-10-09 12:34:05 -04:00
Antoine Beaupré
efa88ef6c6 fix tests: they expect check to spew output
our default verbosity shows only warnings, we'd have to tweak tests to be verbose for this to work

This reverts commit 27be46a5ba.
2015-10-09 12:28:29 -04:00
Antoine Beaupré
1c61f87da3 remove debugging code and fix all have_cython calls 2015-10-08 17:20:52 -04:00
Antoine Beaupré
80e53fb66d it's a function, call it as such 2015-10-08 17:16:11 -04:00
Antoine Beaupré
a1dad8c9da try to mock msgpack altogether to fix RTD again
it seems that msgpack is a hard depends in archive...
2015-10-08 17:06:48 -04:00
Antoine Beaupré
a869ab0702 try to fix RTD build *again* *again* 2015-10-08 17:03:35 -04:00
Antoine Beaupré
e8ae96b54e try to fix RTD build *again* 2015-10-08 17:01:42 -04:00
Antoine Beaupré
f2c56fb890 try to fix build on RTD *again* 2015-10-08 16:57:36 -04:00
Antoine Beaupré
3f68399463 style: wrap multiline strings elegantly 2015-10-08 16:52:49 -04:00
Antoine Beaupré
a42a5e3e2d fix all logger pep8 warnings except long lines 2015-10-08 16:50:44 -04:00
Antoine Beaupré
8075a139b3 fix typo 2015-10-08 16:44:30 -04:00
Antoine Beaupré
b1eafe7833 remove status that is best reflected in VCS 2015-10-08 16:44:30 -04:00
Antoine Beaupré
2d4b735fed remove unintended changes 2015-10-08 16:38:53 -04:00
Antoine Beaupré
27be46a5ba tweak some levels 2015-10-08 16:31:22 -04:00
Antoine Beaupré
423ff45d81 rename cython detection function
"have" has clearer semantics than "detect"
2015-10-08 15:34:44 -04:00
Antoine Beaupré
ff483fe485 fix logical inversion in the semantics of detect_cython() 2015-10-08 15:31:46 -04:00
Antoine Beaupré
f98998f042 fix logical inversion in the semantics of detect_cython() 2015-10-08 15:26:40 -04:00
Antoine Beaupré
6f9e04bc21 generalise the cython check hack
instead of applying this only to usage generation, use it as a generic
mechanism to disable loading of Cython code.

it may be incomplete: there may be other places where Cython code is
loaded that is not checked, but that is sufficient to build the usage
docs. the environment variable used is documented as such in the
docs/usage.rst.

we also move the check to a helper function and document it
better. this has the unfortunate side effect of moving includes
around, but I can't think of a better way.
2015-10-08 08:56:02 -04:00
Antoine Beaupré
9cbc868764 make tests and build work again in usage using environment
this is such a crude hack it is totally embarrassing....

the proper solution would probably be to move the `build_parser()`
function out of `Archiver` completely, but this is such an undertaking
that i doubt it is worth doing since we're looking at switching to
click anyways.

the main problem in moving build_parser() out is that it references
`self` all the time, so it *needs* an archiver context that it can
reuse. we could make the function static and pass self in there by
hand, but it seems like almost a worse hack... and besides, we would
need to load the archiver in order to do that, which would break usage
all over again...
2015-10-07 22:26:59 -04:00
Antoine Beaupré
13d3568548 move usage generation to setup.py
this is an unfortunate rewrite of the manpage creation code mentionned
in #208. ideally, this would be rewritten into a class that can
generate both man pages and .rst files.
2015-10-07 21:07:15 -04:00
Thomas Waldmann
a4967ec582 ssh_cmd: fix wrong caller, fixes #255 2015-10-07 03:32:55 +02:00
Thomas Waldmann
8ddc448f41 make sure to always give segment and offset in repo IntegrityError exception messages
this was only handled correctly at one place, by adding the segment number afterwards.
now the segment number is always included.
2015-10-06 20:35:22 +02:00
Antoine Beaupré
d9e05946ac document logger module 2015-10-06 13:03:49 -04:00
Antoine Beaupré
42cc17caed use new logger object initialisation code 2015-10-06 12:57:27 -04:00
Antoine Beaupré
26561a7766 factor out logger object initialisation 2015-10-06 12:57:27 -04:00
Antoine Beaupré
2d0dae4e8b move logging setup to logger module 2015-10-06 12:57:26 -04:00
anarcat
7908c29180 Merge pull request #249 from anarcat/ssh-env
complete test coverage for SSH args parsing
2015-10-05 19:53:17 -04:00
Antoine Beaupré
a7b70d87cd complete test coverage for SSH args parsing 2015-10-05 19:22:33 -04:00
TW
745f9b89f8 Merge pull request #247 from anarcat/xdg
respect XDG_CACHE_HOME
2015-10-06 01:20:48 +02:00
TW
974dd58c23 Merge pull request #248 from anarcat/ssh-env
add support for arbitrary SSH commands
2015-10-06 01:20:23 +02:00
Antoine Beaupré
8f0de2cab7 fix tests on travis, which seem to set BORG_CACHE_DIR 2015-10-05 19:05:27 -04:00
Antoine Beaupré
a0ef4e25dd add support for arbitrary SSH commands (attic#99)
while SSH options can be specified through `~/.ssh/config`, some users
may want to use a completely different SSH command for their backups,
without overriding their $PATH variable. it may also be easier to do
ad-hoc configuration and tests that way.

plus, the POLA tells us that users expects something like this to be
supported by commands that talk to ssh. it is supported by rsync, git
and so on.
2015-10-05 18:54:00 -04:00
Antoine Beaupré
43a65933f7 move ssh generation code to a stub, add unit test 2015-10-05 18:51:20 -04:00
Antoine Beaupré
de2a811606 move RemoteRepository defaults to the class
the reasoning behind this is that we may need to test a
RemoteRepository setup outside of the main archiver routines, which
the current default location makes impossible

by moving the umask and remote_path remotes into the RemoteRepository
the (reasonable) defaults are available regardless of the (currently
obscure) initialisation routine, and make unit tests easier to develop
and support
2015-10-05 18:45:57 -04:00
Antoine Beaupré
427ddd64a6 respect XDG_CACHE_HOME
fixes attic#181
2015-10-05 17:50:46 -04:00
Thomas Waldmann
c50f32426b do not crash on empty lock.roster, fixes #232 2015-10-05 23:23:59 +02:00
Thomas Waldmann
6f637bed2f LoggedIO: deduplicated code, improved checks and error handling in read()
Code shared by read() and iter_objects() was moved into _read().

Compared to read()'s previous state, this improved:
- fixed size check to avoid read with negative size
- exception handler for struct unpack
- checking for short read
- more precise exception messages
2015-10-05 02:27:24 +02:00
Antoine Beaupré
97189dd25b add missing sys import, fixing build 2015-10-03 15:08:55 -04:00
Antoine Beaupré
e414203ce2 convert upgrade code to logger as well 2015-10-03 14:24:48 -04:00
Antoine Beaupré
24413136ee Merge remote-tracking branch 'origin/master' into logging-refactor
Conflicts:
	borg/archiver.py
2015-10-03 14:23:53 -04:00