@@ -135,6 +135,28 @@ fn test_checkout_conflicting_branches() {
135
135
"### ) ;
136
136
}
137
137
138
+ #[ test]
139
+ fn test_checkout_conflicting_change_ids ( ) {
140
+ let test_env = TestEnvironment :: default ( ) ;
141
+ test_env. jj_cmd_success ( test_env. env_root ( ) , & [ "init" , "repo" , "--git" ] ) ;
142
+ let repo_path = test_env. env_root ( ) . join ( "repo" ) ;
143
+
144
+ test_env. jj_cmd_success ( & repo_path, & [ "describe" , "-m" , "one" ] ) ;
145
+ test_env. jj_cmd_success ( & repo_path, & [ "--at-op=@-" , "describe" , "-m" , "two" ] ) ;
146
+
147
+ // Trigger resolution of concurrent operations
148
+ test_env. jj_cmd_success ( & repo_path, & [ "st" ] ) ;
149
+
150
+ let stderr = test_env. jj_cmd_failure ( & repo_path, & [ "checkout" , "qpvuntsm" ] ) ;
151
+ insta:: assert_snapshot!( stderr, @r###"
152
+ Error: Revset "qpvuntsm" resolved to more than one revision
153
+ Hint: The revset "qpvuntsm" resolved to these revisions:
154
+ qpvuntsm d2ae6806 (empty) two
155
+ qpvuntsm a9330854 (empty) one
156
+ Some of these commits have the same change id. Abandon one of them with `jj abandon -r <REVISION>`.
157
+ "### ) ;
158
+ }
159
+
138
160
fn get_log_output ( test_env : & TestEnvironment , cwd : & Path ) -> String {
139
161
let template = r#"commit_id ++ " " ++ description"# ;
140
162
test_env. jj_cmd_success ( cwd, & [ "log" , "-T" , template] )
0 commit comments