History

revset: propagate error from is_empty(), replace .try_next().is_some()

Yuya Nishihara committed 3 months ago

Commit 4e55a6c1 parent fd3fdb04 files · +8 −11Browse files

Showing the changes to cli/src (2 of 4 files). Show all

Unified · Split

2 files
  1. cli/src/cli_util.rs +3 −6
  2. cli/src/commands/log.rs +1 −1
cli/src/cli_util.rs+3−6
@@ -2072,15 +2072,12 @@ to the current parents may contain changes from multiple commits. · 2071 unmodified lines
20722072 .env
20732073 .resolve_immutable_expression(tx.repo())
20742074 .map_err(snapshot_command_error)?;
2075− let wc_immutable = immutable_expr
2075+ let wc_immutable = !immutable_expr
20762076 .intersection(&RevsetExpression::commit(wc_commit.id().clone()))
20772077 .evaluate(tx.repo())
20782078 .map_err(snapshot_command_error)?
2079− .stream()
2080− .try_next()
2081− .await
2082− .map_err(snapshot_command_error)?
2083− .is_some();
2079+ .is_empty()
2080+ .map_err(snapshot_command_error)?;
20842081 let mut_repo = tx.repo_mut();
20852082 let new_wc_commit;
20862083 if wc_immutable {
cli/src/commands/log.rs+1−1
@@ -382,7 +382,7 @@ pub(crate) async fn cmd_log( · 381 unmodified lines
382382 this is often not useful because all non-empty commits touch '.'. If you meant \
383383 to show the working copy commit, pass -r '@' instead."
384384 )?;
385− } else if revset.is_empty()
385+ } else if revset.is_empty()?
386386 && workspace_command
387387 .parse_revset(ui, &RevisionArg::from(only_path.to_owned()))
388388 .is_ok()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t