1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-23 22:51:35 +00:00
Commit graph

1334 commits

Author SHA1 Message Date
Antoine Beaupré
35aaeef8bd remove spurious output 2015-10-02 16:00:42 -04:00
Antoine Beaupré
8193c414a9 add and use string representation of archive for stats 2015-10-02 15:56:21 -04:00
Antoine Beaupré
e5a0936a05 add formatters for Cache and Statistics objects
this greatly simplifies the display of those objects, as the
__format__() parameter allows for arbitrary display of the internal
fields of both objects

this will allow us to display those summaries without having to pass a
label to the string representation. we can also print the objects
directly without formatting at all.
2015-10-02 15:55:14 -04:00
Thomas Waldmann
893242ead4 fix multiple issues with the cache config version check, fixes #234
- issue #234: handle exception when config file is empty is really not a borg cache config
- there was a unused %s in the Exception string
- error msg was wrong when version check failed - this IS a borg cache, but not of expected version
2015-10-02 18:11:10 +02:00
Antoine Beaupré
b09cdb4a63 don't add module name on standard messages
too much clutter
2015-10-02 11:22:38 -04:00
Antoine Beaupré
2f78b8ad41 remove stray comment 2015-10-02 11:16:28 -04:00
Antoine Beaupré
1819adaf59 log level tweaking: stats should not be a warning
we should find other ways of forcing that to be shown, it seems
2015-10-02 11:16:21 -04:00
Antoine Beaupré
ca6c52610f restore some print statements
the heuristics i used are the following:

 1. if we are prompting the use, use print on stderr (input() may
    produce some stuff on stdout, but it's outside the scope of this
    patch). we do not want those prompts to end up on the standard
    output in case we are piping stuff around

 2. if the command is primarily producing output for the user on the
    console (`list`, `info`, `help`), we simply print on the default
    file descriptor.

 3. everywhere else, we use the logging module with varying levels of
    verbosity, as appropriate.
2015-10-02 11:13:01 -04:00
Antoine Beaupré
c9b11316ab use a module-specific logger instead of global one
that way we have one logger per module, and we can pick and choose
which module we want verbose, for example
2015-10-02 11:05:44 -04:00
Thomas Waldmann
8978515991 temporary hack to avoid using lots of disk space for chunks.archive.d 2015-10-02 16:56:31 +02:00
Thomas Waldmann
aef71ac640 Merge branch 'master' of github.com:borgbackup/borg 2015-10-02 16:25:57 +02:00
Antoine Beaupré
ea5d00436c also document the cache locations 2015-10-02 10:12:13 -04:00
Antoine Beaupré
ad85f64842 whitespace 2015-10-02 10:10:50 -04:00
Antoine Beaupré
69040588cd update docs to reflect that cache is converted 2015-10-02 10:10:43 -04:00
Antoine Beaupré
d4d1b414b5 remove needless autouse 2015-10-02 09:44:53 -04:00
Antoine Beaupré
41e9942efe follow naming of tested module 2015-10-02 09:43:51 -04:00
Antoine Beaupré
081b91bea0 remove needless paren 2015-10-02 09:43:10 -04:00
Antoine Beaupré
3e7fa0d633 also copy the cache config file to workaround #234 2015-10-01 16:41:17 -04:00
Antoine Beaupré
8022e563a9 don't clobber existing borg cache 2015-10-01 16:27:19 -04:00
Antoine Beaupré
55f79b4999 complete cache conversion code
we need to create the borg cache directory

dry run was ignored, fixed.

process cache before segment, because we want to do the faster stuff first
2015-10-01 16:24:28 -04:00
Antoine Beaupré
28a033d1d3 remove debug output that clobbers segment spinner 2015-10-01 16:03:52 -04:00
Antoine Beaupré
4f9a411ad8 remove unneeded fixture decorator 2015-10-01 16:01:17 -04:00
Antoine Beaupré
022de5be47 untested file/chunks cache conversion
i couldn't figure out how to generate a cache set directly, Archiver is a pain...
2015-10-01 16:01:01 -04:00
Antoine Beaupré
7c32f555ac repository index conversion 2015-10-01 15:43:16 -04:00
Antoine Beaupré
a7902e5657 cosmetic: show 100% when done, not n-1/n% 2015-10-01 14:29:09 -04:00
Antoine Beaupré
35b219597f only write magic num if necessary
this could allow speeding up conversions resumed after interruption
2015-10-01 14:28:49 -04:00
Antoine Beaupré
180dfcb18f remove needless indentation 2015-10-01 14:23:43 -04:00
Antoine Beaupré
6a72252b69 release lock properly if segment conversion crashes 2015-10-01 14:22:29 -04:00
Antoine Beaupré
1b540d91a0 convert more print() statements to logging
we use logging.warning in info and list, but print() more usage bits.

we also now support logging.debug() and by default are more silent
2015-10-01 14:20:29 -04:00
TW
d27da99208 Merge pull request #230 from anarcat/api
add automatically generated API
2015-10-01 19:52:15 +02:00
Antoine Beaupré
09ffbb1d9d convert most print() calls to logging
the logging level varies: most is logging.info(), in some place
logging.warning() or logging.error() are used when the condition is
clearly an error or warning. in other cases, we keep using print, but
force writing to sys.stderr, unless we interact with the user.

there were 77 calls to print before this commit, now there are 7, most
of which in the archiver module, which interacts directly with the
user. in one case there, we still use print() only because logging is
not setup properly yet during argument parsing.

it could be argued that commands like info or list should use print
directly, but we have converted them anyways, without ill effects on
the unit tests

unit tests still use print() in some places

this switches all informational output to stderr, which should help
with, if not fix jborg/attic#312 directly
2015-10-01 13:41:45 -04:00
Antoine Beaupré
c996fd8366 just call print() once in the odd print_() function
this will help when we want to refactor output functions

this function should definitely be replaced by a __repr__() or
__str__() however
2015-10-01 12:39:13 -04:00
Antoine Beaupré
3bb3bd45fc add percentage progress 2015-10-01 12:36:53 -04:00
Thomas Waldmann
5c649a0154 Merge branch 'master' of github.com:borgbackup/borg 2015-10-01 18:21:45 +02:00
Antoine Beaupré
0d457bc846 clarify what to do about the cache warning 2015-10-01 11:25:12 -04:00
Antoine Beaupré
946aca97a1 avoid flooding the console
instead we add progress information
2015-10-01 11:25:02 -04:00
Antoine Beaupré
6c318a0f27 re-pep8 2015-10-01 11:12:23 -04:00
Antoine Beaupré
7f6fd1f306 add docs for all converter test code 2015-10-01 11:11:30 -04:00
Antoine Beaupré
a08bcb21ae refactor common code
we get rid of repo_open() which doesn't same much typing, and add a validator for keys
2015-10-01 11:10:56 -04:00
Antoine Beaupré
f5cb0f4e73 rewrite convert tests with pytest fixtures 2015-10-01 10:41:31 -04:00
Antoine Beaupré
98e4e6bc25 lock repository when converting segments 2015-10-01 09:35:17 -04:00
Antoine Beaupré
58815bc28a fix commandline dispatch for converter 2015-10-01 09:23:17 -04:00
Antoine Beaupré
57801a288d keep tests simple by always adding attic depends
note that we do not depend on attic to build borg, just to do those
tests. if attic goes away, we could eventually do this another way or
just stop testing this altogether.
2015-10-01 09:03:41 -04:00
Antoine Beaupré
79d9aebaf2 use permanently instead of irrevocably, which is less common 2015-10-01 09:00:49 -04:00
Antoine Beaupré
b9c474d187 pep8: put pytest skip marker after imports 2015-10-01 08:59:01 -04:00
Antoine Beaupré
4a85f2d0f5 fix most pep8 warnings
* limit all lines to 80 chars
* remove spaces around parameters
* missing blank lines
2015-10-01 08:58:01 -04:00
Antoine Beaupré
5f6eb87385 much nicer validation checking 2015-10-01 08:50:06 -04:00
Antoine Beaupré
d5198c551b split out depends in imports 2015-10-01 08:47:23 -04:00
Antoine Beaupré
d66516351f use builtin NotImplementedError instead of writing our own
NotImplemented didn't work with pytest.raise(), i didn't know about NotImplementedError, thanks tw
2015-10-01 08:46:30 -04:00
Antoine Beaupré
ef0ed409b6 fix typo 2015-10-01 08:44:17 -04:00