use crate::common::TestEnvironment;
use crate::common::create_commit;
#[test]
fn test_arrange_bad_revisions() {
let test_env = TestEnvironment::default();
test_env.run_jj_in(".", ["git", "init", "repo"]).success();
let work_dir = test_env.work_dir("repo");
create_commit(&work_dir, "a", &[]);
create_commit(&work_dir, "b", &["a"]);
create_commit(&work_dir, "c", &["b"]);
let output = work_dir.run_jj(["arrange", "none()"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
No revisions to arrange.
[EOF]
");
let output = work_dir.run_jj(["arrange", "a", "c"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Error: Cannot arrange revset with gaps in.
Hint: Revision 123b4d91f6e5 would need to be in the set.
[EOF]
[exit status: 1]
");
let output = work_dir.run_jj(["arrange", "-r=a", "-r=c"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Error: Cannot arrange revset with gaps in.
Hint: Revision 123b4d91f6e5 would need to be in the set.
[EOF]
[exit status: 1]
");
let output = work_dir.run_jj(["arrange", "-r=a", "c"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Error: Cannot arrange revset with gaps in.
Hint: Revision 123b4d91f6e5 would need to be in the set.
[EOF]
[exit status: 1]
");
let output = work_dir.run_jj(["arrange", "--config=revsets.arrange='a|c'"]);
insta::assert_snapshot!(output, @r"
------- stderr -------
Error: Cannot arrange revset with gaps in.
Hint: Revision 123b4d91f6e5 would need to be in the set.
[EOF]
[exit status: 1]
");
}