@@ -815,9 +815,9 @@ fn classify_bookmark_update(
815815 }
816816}
817817
818- fn ensure_new_bookmark_name ( view : & View , name : & RefName ) -> Result < ( ) , CommandError > {
818+ fn ensure_new_bookmark_name ( repo : & dyn Repo , name : & RefName ) -> Result < ( ) , CommandError > {
819819 let symbol = name. as_symbol ( ) ;
820- if view. get_local_bookmark ( name) . is_present ( ) {
820+ if repo . view ( ) . get_local_bookmark ( name) . is_present ( ) {
821821 return Err ( user_error_with_hint (
822822 format ! ( "Bookmark already exists: {symbol}" ) ,
823823 format ! (
@@ -826,7 +826,7 @@ fn ensure_new_bookmark_name(view: &View, name: &RefName) -> Result<(), CommandEr
826826 ) ,
827827 ) ) ;
828828 }
829- if has_tracked_remote_bookmarks ( view , name) {
829+ if has_tracked_remote_bookmarks ( repo , name) {
830830 return Err ( user_error_with_hint (
831831 format ! ( "Tracked remote bookmarks exist for deleted bookmark: {symbol}" ) ,
832832 format ! (
@@ -868,7 +868,7 @@ fn create_explicitly_named_bookmarks(
868868 )
869869 . hinted ( hint)
870870 } ) ?;
871- ensure_new_bookmark_name ( tx. repo ( ) . view ( ) , & name) ?;
871+ ensure_new_bookmark_name ( tx. repo ( ) , & name) ?;
872872 let revision = tx
873873 . base_workspace_helper ( )
874874 . resolve_single_rev ( ui, & revision_str. to_string ( ) . into ( ) ) ?;
@@ -915,12 +915,11 @@ fn create_change_bookmarks(
915915
916916 for ( commit, name) in iter:: zip ( & all_commits, & bookmark_names) {
917917 let target = RefTarget :: normal ( commit. id ( ) . clone ( ) ) ;
918- let view = tx. base_repo ( ) . view ( ) ;
919- if view. get_local_bookmark ( name) == & target {
918+ if tx. base_repo ( ) . view ( ) . get_local_bookmark ( name) == & target {
920919 // Existing bookmark pointing to the commit, which is allowed
921920 continue ;
922921 }
923- ensure_new_bookmark_name ( view , name) ?;
922+ ensure_new_bookmark_name ( tx . base_repo ( ) . as_ref ( ) , name) ?;
924923 writeln ! (
925924 ui. status( ) ,
926925 "Creating bookmark {name} for revision {change_id:.12}" ,
0 commit comments