Commit Graph

11 Commits

Author SHA1 Message Date
Thomas Waldmann 6df21df3f4 Merge branch 'master' into multithreading
Note: although I hopefully fixed all the conflicts,
some tests are quite broken.

Conflicts:
	borg/_chunker.c
	borg/archive.py
	borg/archiver.py
	borg/cache.py
	borg/helpers.py
	borg/testsuite/archiver.py
2016-02-04 20:34:18 +01:00
Thomas Waldmann 4b339f5d69 cosmetic source cleanup (flake8) 2016-01-30 21:32:45 +01:00
Thomas Waldmann 2f9b643edb migrate-to-repokey command, dispatch passphrase type to repokey handler
every chunk has the encryption key type as first byte and we do not want to rewrite the whole repo
to change the passphrase type to repokey type. thus we simply dispatch this type to repokey
handler.
if there is a repokey that contains the same secrets as they were derived from the passphrase, it will just work.
if there is none yet, one needs to run migrate-to-repokey command to create it.
2016-01-24 16:04:00 +01:00
Thomas Waldmann b2dedee3c8 refactor yes(), cleanup env var semantics, fixes #355
refactorings:

- introduced concept of default answer:

if the answer string is in the defaultish sequence, the return value of yes() will be the default.
e.g. if just pressing <enter> when asked on the console or if an empty string or "default" is
in the environment variable for overriding.

if an environment var has an invalid value and no retries are enabled: return default
if retries are enabled, next retry won't use the env var again, but either ask via input().

- simplify:

only one default - this should be a SAFE default as it is used in some special conditions
like EOF or invalid input with retries disallowed.

no isatty() magic, the "yes" shell command exists, so we could receive input even if it is not from a tty.

- clean:

separate retry flag from retry_msg
2016-01-24 16:04:00 +01:00
Thomas Waldmann 5607e5aefe use os.urandom instead of own cython openssl RAND_bytes wrapper, fixes #493 2016-01-24 15:40:04 +01:00
Thomas Waldmann 57b913bc88 fix badly named environment variable, fixes #503
added: BORG_DELETE_I_KNOW_WHAT_I_AM_DOING for the check in "borg delete"
2015-12-20 02:03:33 +01:00
Thomas Waldmann ad4594a39c Fix some breakage from the merge 2015-10-31 19:39:20 +01:00
Thomas Waldmann 1a248116db move cmd fixture to archiver test module 2015-10-16 00:18:46 +02:00
Thomas Waldmann 4b7c02775e benchmarks: test with both the binary and the python code
we use forking mode always and either execute python with the archiver module or the "borg.exe" binary.
the cmd fixture alternates between 'python' and 'binary' mode and calls exec_cmd accordingly.
2015-10-16 00:12:02 +02: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