Commit graph

4 commits

Author SHA1 Message Date
Yuya Nishihara
30666dfbcf cli: preserve source of user error, print source chain one by one
"Caused by" lines are inserted before the hint because they are more strongly
related to the error.
2024-02-02 08:22:24 +09:00
Yuya Nishihara
58acc1d111 tests: replace jj_cmd_success() involving mutation to allow stderr output 2023-10-11 19:24:01 +09:00
Martin von Zweigbergk
b8f71a4b30 working_copy: in LockedWorkingCopy::drop(), discard unsaved changes
In `LockedWorkingCopy::drop()`, we panic if the caller had not called
`finish()`. IIRC, the idea was both to find bugs where we forgot to
call `finish()` and to prevent continuing with a modified
`WorkingCopy` instance. I don't think the former has been a problem in
practice. It has been a problem in practice to call `discard()` to
avoid the panic, though. To address that, we can make the `Drop`
implementation discard the changes (forcing a reload of the state if
the working copy is accessed again).
2023-09-01 12:25:47 -07:00
Martin von Zweigbergk
f3a16eb964 cli: add hint when snapshot fails due to large file
I also converted the error from `InternalError` to `UserError`. So far
I've intented to use `InternalError` only to indicate bugs or corrupt
repos. I'm not sure that's a good idea, and we can revisit it later.
2023-09-01 12:25:47 -07:00