Michael Eischer
1ae2d08d1b
termstatus: centralize OutputIsTerminal checks
2025-10-03 18:55:46 +02:00
Michael Eischer
daeb55a4fb
Merge pull request #5511 from greatroar/atomic
...
ui/progress: Restore atomics in Counter
2025-09-21 22:29:40 +02:00
Michael Eischer
86ddee8518
ui: document Message / Printer / Terminal interfaces
2025-09-21 16:32:00 +02:00
greatroar
a8f506ea4d
ui/progress: Simplify Updater
...
Removed a defer'd call that was a bit subtle.
2025-09-16 09:56:33 +02:00
greatroar
0a1ce4f207
ui/progress: Restore atomics in Counter
...
We switched from atomics to a mutex in #3189 because of an alignment
bug, but the new-style atomic types don't need manual alignment.
2025-09-16 09:49:48 +02:00
Michael Eischer
32b7168a9e
centralize index progress bar for termstatus
2025-09-15 20:25:17 +02: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
092899df8b
Remove unnecessary type conversions.
2025-03-22 18:20:30 +00:00
Michael Eischer
eda9f7beb4
ui/progress: add helper to print messages during tests
2024-04-14 13:45:08 +02: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
d1a5ec7839
Rename unused testing parameter to _
...
The parameter is an additional marker that the test helper must only be
used for tests.
2023-05-18 21:17:53 +02:00
Michael Eischer
e499bbe3ae
progress: extract progress updating into Updater struct
...
This allows reusing the code to create periodic progress updates.
2023-01-14 01:13:08 +01:00
greatroar
2dafda9164
ui/progress: Load both values in a single Lock/Unlock
...
We always need both values, except in a test, so we don't need to lock
twice and risk scheduling in between.
Also, removed the resetting in Done. This copied a mutex, which isn't
allowed. Static analyzers tend to trip over that.
2022-10-25 07:55:24 +02:00
Michael Eischer
af31266b7d
golangci-lint: replace deprecated golint with revive
2022-03-28 22:33:17 +02:00
Michael Eischer
ddb7697d29
restic: Test progress reporting of StreamTrees
2021-01-28 11:10:50 +01:00
Michael Eischer
313ad0e32f
progress/counter: Fix test for final report call
2021-01-28 11:10:50 +01:00
Michael Eischer
505f8a2229
progress/counter: Support updating the progress bar maximum
2021-01-28 11:10:47 +01:00
Michael Eischer
34afc93ddc
ui/progress: extract signal handling into own package
2020-12-29 16:32:18 +01:00
Michael Eischer
c2ef049f1b
ui/progress: don't print progress on non-interactive terminals
...
This reverts to the old behavior of not printing progress updates on
non-interactive terminals. It was accidentally changed in #3058 .
2020-12-29 16:03:43 +01:00
greatroar
3b09ae9074
AIX port
2020-12-29 01:35:01 +01:00
Alexander Neumann
6c514adb8a
ui/progress: Use mutex instead of atomic
...
The counter value needs to be aligned to 64 bit in memory for the
atomic functions to work on some platform (such as 32 bit ARM).
The atomic package says in its documentation:
> These functions require great care to be used correctly. Except for
> special, low-level applications, synchronization is better done with
> channels or the facilities of the sync package.
This commit replaces the atomic functions with a simple sync.Mutex, so
we don't have to care about alignment.
2020-12-22 21:03:27 +01:00
greatroar
ddca699cd2
Replace restic.Progress with new progress.Counter
...
This fixes two race conditions while cleaning up the code.
2020-11-09 12:12:35 +01:00