@@ -40,7 +40,7 @@ pub(crate) fn handle(
4040 CliId :: UncommittedFile {
4141 path, assignment, ..
4242 } ,
43- CliId :: Commit { oid } ,
43+ CliId :: Commit ( oid) ,
4444 ) => {
4545 create_snapshot ( ctx, OperationKind :: AmendCommit ) ;
4646 amend:: file_to_commit ( ctx, path. as_ref ( ) , * assignment, oid, out) ?;
@@ -55,7 +55,7 @@ pub(crate) fn handle(
5555 ( CliId :: Unassigned { .. } , CliId :: Unassigned { .. } ) => {
5656 bail ! ( makes_no_sense_error( & source, & target) )
5757 }
58- ( CliId :: Unassigned { .. } , CliId :: Commit { oid } ) => {
58+ ( CliId :: Unassigned { .. } , CliId :: Commit ( oid) ) => {
5959 create_snapshot ( ctx, OperationKind :: AmendCommit ) ;
6060 amend:: assignments_to_commit ( ctx, None , oid, out) ?;
6161 }
@@ -66,15 +66,15 @@ pub(crate) fn handle(
6666 ( CliId :: Commit { .. } , CliId :: UncommittedFile { .. } ) => {
6767 bail ! ( makes_no_sense_error( & source, & target) )
6868 }
69- ( CliId :: Commit { oid } , CliId :: Unassigned { .. } ) => {
69+ ( CliId :: Commit ( oid) , CliId :: Unassigned { .. } ) => {
7070 create_snapshot ( ctx, OperationKind :: UndoCommit ) ;
7171 undo:: commit ( ctx, oid, out) ?;
7272 }
73- ( CliId :: Commit { oid : source } , CliId :: Commit { oid : destination } ) => {
73+ ( CliId :: Commit ( source) , CliId :: Commit ( destination) ) => {
7474 create_snapshot ( ctx, OperationKind :: SquashCommit ) ;
7575 squash:: commits ( ctx, source, destination, out) ?;
7676 }
77- ( CliId :: Commit { oid } , CliId :: Branch { name, .. } ) => {
77+ ( CliId :: Commit ( oid) , CliId :: Branch { name, .. } ) => {
7878 create_snapshot ( ctx, OperationKind :: MoveCommit ) ;
7979 move_commit:: to_branch ( ctx, oid, name, out) ?;
8080 }
@@ -85,7 +85,7 @@ pub(crate) fn handle(
8585 create_snapshot ( ctx, OperationKind :: MoveHunk ) ;
8686 assign:: assign_all ( ctx, Some ( from) , None , out) ?;
8787 }
88- ( CliId :: Branch { name, .. } , CliId :: Commit { oid } ) => {
88+ ( CliId :: Branch { name, .. } , CliId :: Commit ( oid) ) => {
8989 create_snapshot ( ctx, OperationKind :: AmendCommit ) ;
9090 amend:: assignments_to_commit ( ctx, Some ( name) , oid, out) ?;
9191 }
@@ -104,7 +104,9 @@ pub(crate) fn handle(
104104 }
105105 (
106106 CliId :: CommittedFile {
107- path, commit_oid, ..
107+ path,
108+ commit_id : commit_oid,
109+ ..
108110 } ,
109111 CliId :: Branch { name, .. } ,
110112 ) => {
@@ -113,9 +115,11 @@ pub(crate) fn handle(
113115 }
114116 (
115117 CliId :: CommittedFile {
116- path, commit_oid, ..
118+ path,
119+ commit_id : commit_oid,
120+ ..
117121 } ,
118- CliId :: Commit { oid } ,
122+ CliId :: Commit ( oid) ,
119123 ) => {
120124 create_snapshot ( ctx, OperationKind :: FileChanges ) ;
121125 commits:: commited_file_to_another_commit (
@@ -128,7 +132,9 @@ pub(crate) fn handle(
128132 }
129133 (
130134 CliId :: CommittedFile {
131- path, commit_oid, ..
135+ path,
136+ commit_id : commit_oid,
137+ ..
132138 } ,
133139 CliId :: Unassigned { .. } ,
134140 ) => {
@@ -166,7 +172,7 @@ fn ids(
166172 target : & str ,
167173) -> anyhow:: Result < ( Vec < CliId > , CliId ) > {
168174 let sources = parse_sources ( ctx, id_map, source) ?;
169- let target_result = id_map. parse_str ( target) ?;
175+ let target_result = id_map. resolve_entity_to_ids ( target) ?;
170176 if target_result. len ( ) != 1 {
171177 if target_result. is_empty ( ) {
172178 return Err ( anyhow:: anyhow!(
@@ -177,7 +183,7 @@ fn ids(
177183 let matches: Vec < String > = target_result
178184 . iter ( )
179185 . map ( |id| match id {
180- CliId :: Commit { oid } => {
186+ CliId :: Commit ( oid) => {
181187 format ! ( "{} (commit {})" , id, & oid. to_string( ) [ ..7 ] )
182188 }
183189 CliId :: Branch { name, .. } => format ! ( "{id} (branch '{name}')" ) ,
@@ -209,7 +215,7 @@ pub(crate) fn parse_sources(
209215 }
210216 // Single source
211217 else {
212- let source_result = id_map. parse_str ( source) ?;
218+ let source_result = id_map. resolve_entity_to_ids ( source) ?;
213219 if source_result. len ( ) != 1 {
214220 if source_result. is_empty ( ) {
215221 return Err ( anyhow:: anyhow!(
@@ -220,7 +226,7 @@ pub(crate) fn parse_sources(
220226 let matches: Vec < String > = source_result
221227 . iter ( )
222228 . map ( |id| match id {
223- CliId :: Commit { oid } => {
229+ CliId :: Commit ( oid) => {
224230 format ! ( "{} (commit {})" , id, & oid. to_string( ) [ ..7 ] )
225231 }
226232 CliId :: Branch { name, .. } => format ! ( "{id} (branch '{name}')" ) ,
@@ -251,8 +257,8 @@ fn parse_range(ctx: &mut Context, id_map: &IdMap, source: &str) -> anyhow::Resul
251257 let end_str = parts[ 1 ] ;
252258
253259 // Get the start and end IDs
254- let start_matches = id_map. parse_str ( start_str) ?;
255- let end_matches = id_map. parse_str ( end_str) ?;
260+ let start_matches = id_map. resolve_entity_to_ids ( start_str) ?;
261+ let end_matches = id_map. resolve_entity_to_ids ( end_str) ?;
256262
257263 if start_matches. len ( ) != 1 {
258264 return Err ( anyhow:: anyhow!(
@@ -329,7 +335,7 @@ fn get_all_files_in_display_order(ctx: &mut Context, id_map: &IdMap) -> anyhow::
329335 if let Some ( stack_id) = assignment. stack_id
330336 && stack. id == Some ( stack_id)
331337 {
332- let file_id = id_map. uncommitted_file (
338+ let file_id = id_map. resolve_uncommitted_file_or_unassigned (
333339 assignment. stack_id ,
334340 assignment. path_bytes . as_ref ( ) ,
335341 ) ;
@@ -347,7 +353,8 @@ fn get_all_files_in_display_order(ctx: &mut Context, id_map: &IdMap) -> anyhow::
347353 for assignments in by_file. values ( ) {
348354 for assignment in assignments {
349355 if assignment. stack_id . is_none ( ) {
350- let file_id = id_map. uncommitted_file ( None , assignment. path_bytes . as_ref ( ) ) ;
356+ let file_id = id_map
357+ . resolve_uncommitted_file_or_unassigned ( None , assignment. path_bytes . as_ref ( ) ) ;
351358 if !all_files. contains ( & file_id) {
352359 all_files. push ( file_id) ;
353360 }
@@ -364,7 +371,7 @@ fn parse_list(id_map: &IdMap, source: &str) -> anyhow::Result<Vec<CliId>> {
364371
365372 for part in parts {
366373 let part = part. trim ( ) ;
367- let matches = id_map. parse_str ( part) ?;
374+ let matches = id_map. resolve_entity_to_ids ( part) ?;
368375 if matches. len ( ) != 1 {
369376 if matches. is_empty ( ) {
370377 return Err ( anyhow:: anyhow!(
0 commit comments