Michael Eischer
66a8e897a9
Merge pull request #5300 from MichaelEischer/fix-output-race
...
ui/termstatus: fix race condition in StdioWrapper
2025-03-24 11:17:14 +01:00
Michael Eischer
ec19d67512
ui/termstatus: fix race condition in StdioWrapper
2025-03-24 11:07:15 +01:00
Michael Eischer
f7f48b3026
ui/progress: extend Printer interface with print to stdout method
2025-03-23 17:46:04 +01:00
Martin Smith
f238f81ba6
Renames to fix clashes with reserved words.
2025-03-22 18:20:30 +00:00
Martin Smith
3788605127
Rename unused parameters to '_'.
2025-03-22 18:20:30 +00:00
Martin Smith
092899df8b
Remove unnecessary type conversions.
2025-03-22 18:20:30 +00:00
Martin Smith
1daf5317f8
Fix import ordering.
2025-03-22 18:20:30 +00:00
greatroar
c1781e0abb
ui/termstatus: Remove unused bytes.Buffer
2025-02-01 08:21:40 +01:00
Srigovind Nayak
d7d9af4c9f
ui: restore --delete indicates number of deleted files ( #5100 )
...
* ui: restore --delete indicates number of deleted files
* adds new field `FilesDeleted` to the State struct, JSON and text progress updaters
* increment FilesDeleted count when ReportedDeletedFile
* ui: collect the files to be deleted, delete, then update the count post deletion
* docs: update scripting output fields for restore command
ui: report deleted directories and refactor function name to ReportDeletion
2024-12-01 15:29:11 +01:00
Michael Eischer
9c758313e3
Merge pull request #5119 from MichaelEischer/backup-json-start-end-time
...
backup: include start and end time in json output
2024-11-11 21:50:30 +01:00
Michael Eischer
569a117a1d
improve fprintf related error handling
2024-11-01 17:07:43 +01:00
Michael Eischer
e65f4e2231
backup: include start and end time in json output
...
The timestamps were already stored in the created snapshot.
2024-11-01 16:31:34 +01:00
Michael Eischer
ca1e5e10b6
add proper constants for node type
2024-08-31 18:20:01 +02:00
Michael Terry
88f59fc2d6
json: switch backup and restore errors from string to struct types
...
This keeps backwards compatibility with the previous empty structs.
And maybe we'd want to put other fields into the inner struct later,
rather than the outer message.
2024-08-03 16:21:44 -04:00
Michael Terry
a376323331
restore: print JSON versions of errors in --json mode
...
Previously, they were printed as freeform text.
This also adds a ui.Terminal interface to make writing
tests easier and also adds a few tests.
2024-08-03 15:18:46 -04:00
Michael Terry
ad2585af67
backup: show actual error strings in --json mode
...
Previously, an error JSON fragment would look like:
{"message_type": "error", "error": {}}
This is because encoding/json cannot marshal an error interface.
Instead, we now call .Error() to get the string value.
2024-08-03 15:07:52 -04:00
Michael Terry
f4bdfea1c9
backup: print scanner errors to stderr, not stdout
2024-08-03 15:07:52 -04:00
Michael Eischer
59c880fce3
restorer: only show size in text output for files
2024-07-20 12:46:28 +02:00
Michael Eischer
aedead2823
ui/termstatus: fix clearing status lines
...
To clear the status lines, they should be set to an empty array to
prevent future updates of those lines. Setting the status lines to an
array containing an empty string is wrong as this causes the output to
continuously add that empty status line after each message.
2024-07-06 11:27:35 +02:00
Michael Eischer
aa8e18cf32
restore: add deletions to progress output
2024-07-05 22:38:39 +02:00
Michael Eischer
ae978d60cc
restore: pass action enum to restore progress
2024-07-05 20:41:27 +02:00
Michael Eischer
c47bf33884
restore: print processed files at maximum verbosity
2024-07-05 20:41:27 +02:00
Michael Eischer
e47e08a688
restorer: separately track skipped files
2024-06-12 22:36:52 +02:00
Michael Eischer
64b7b6b975
restore/ui: refactor for extensibility
2024-06-12 22:36:52 +02:00
Michael Eischer
607daeed4f
restore: move nil pointer check into restoreui
2024-06-12 22:36:52 +02:00
Michael Eischer
7cd324fe26
ui/table: avoid duplicate table cell width calculation
2024-06-07 21:45:40 +02:00
Michael Eischer
edd3e214c2
ui/table: fix width calculation of multi-line column headers
2024-06-07 21:44:49 +02:00
Florian Thoma
e9de9684f4
Use character display width for table padding
...
Using len(...) for table cell padding produced wrong results for unicode
chracters leading to misaligned tables. Implementation changed to take
the actual terminal display width into consideration.
2024-06-05 09:33:15 +02:00
Michael Eischer
6869bdaaa8
backup: implement --skip-if-unchanged
2024-05-30 15:14:31 +02:00
greatroar
46f04bc5f0
termstatus: Do formatting in Message, not Terminal
2024-05-27 19:05:39 +02:00
greatroar
66d03c797e
ui, termstatus: Move WrapStdio
...
Saves some imports. ui still needs to import ui/termstatus from
message.go.
2024-05-21 11:25:16 +02:00
greatroar
0b56214473
ui: Simplify stdio wrapper
...
The StdioWrapper type is really just a pair of io.WriteClosers, so
remove it in favor of a function that returns two of those. Test
coverage increases because the removed code was not tested.
2024-05-21 11:23:32 +02:00
greatroar
7f439a9c34
ui: Inline lineWriter into StdioWrapper
2024-05-21 11:00:09 +02:00
Michael Eischer
eda9f7beb4
ui/progress: add helper to print messages during tests
2024-04-14 13:45:08 +02:00
Michael Eischer
e71660cd1e
backup: rename data_added_in_repo statistic to data_added_packed
2024-02-25 20:40:52 +01:00
Michael Eischer
86897314d5
backup: expose data_added_in_repo in JSON output
...
The value describes how much data was added after compression.
Previously, it was only available in the text output.
2024-02-23 20:27:13 +01:00
Michael Eischer
a59f654fa6
archiver: refactor summary collection from ui into the archiver
2024-02-23 20:27:13 +01:00
Alexander Neumann
c0514dd8ba
Fix linter errors (except for tests)
2024-02-10 22:58:10 +01:00
Michael Eischer
f0e1ad2285
fix linter warning
2024-01-27 12:51:45 +01:00
Michael Eischer
feeab84204
repair pack: extract the repair logic into the repository package
...
Currently, the cmd/restic package contains a significant amount of code
that modifies repository internals. This code should in the mid-term
move into the repository package.
2024-01-27 12:51:45 +01:00
Michael Eischer
6bdca13603
ui/termstatus: simplify cleaning up on termination
...
`writeStatus` also cleans no longer used status lines.
The old code actually cleaned one line too much. However, as that line
was never used it makes no difference.
2024-01-21 21:27:27 +01:00
Michael Eischer
e6dfefba13
termstatus: update import path of golang.org/x/term
2024-01-06 21:59:26 +01:00
Andrea Gelmini
241916d55b
Fix typos
2023-12-06 13:11:55 +01:00
Lorenz Bausch
2657217574
Tweak restore summary
2023-09-20 10:59:55 +02:00
greatroar
41a5bf357f
cmd, ui: Move size parsing code and make it more robust
2023-07-02 21:44:50 +02:00
Michael Eischer
07d1f8047e
restore: More descriptive field names for the JSON output
2023-06-09 12:07:55 +02:00
Michael Eischer
b2b0760eb0
restore: add test for json output
2023-06-09 12:03:33 +02:00
Michael Eischer
d54176ce5d
restore: add basic json progress
2023-06-09 12:03:33 +02:00
Michael Eischer
a9aff885d6
restore: reorganize progress bar code
...
The structure is now much more similar to that of the backup command.
2023-06-09 12:03:33 +02:00
Michael Eischer
0b908bb1fb
Address review comments
2023-06-08 20:24:21 +02:00