@@ -897,19 +897,34 @@ static BUILTIN_FUNCTION_MAP: LazyLock<HashMap<&str, RevsetFunction>> = LazyLock:
897897 } ;
898898 Ok ( RevsetExpression :: bookmarks ( expr) )
899899 } ) ;
900- map. insert ( "remote_bookmarks" , |diagnostics, function, _context| {
901- parse_remote_bookmarks_arguments ( diagnostics, function, None )
900+ map. insert ( "remote_bookmarks" , |diagnostics, function, context| {
901+ parse_remote_bookmarks_arguments (
902+ diagnostics,
903+ function,
904+ None ,
905+ context. default_ignored_remote ,
906+ )
902907 } ) ;
903908 map. insert (
904909 "tracked_remote_bookmarks" ,
905- |diagnostics, function, _context| {
906- parse_remote_bookmarks_arguments ( diagnostics, function, Some ( RemoteRefState :: Tracked ) )
910+ |diagnostics, function, context| {
911+ parse_remote_bookmarks_arguments (
912+ diagnostics,
913+ function,
914+ Some ( RemoteRefState :: Tracked ) ,
915+ context. default_ignored_remote ,
916+ )
907917 } ,
908918 ) ;
909919 map. insert (
910920 "untracked_remote_bookmarks" ,
911- |diagnostics, function, _context| {
912- parse_remote_bookmarks_arguments ( diagnostics, function, Some ( RemoteRefState :: New ) )
921+ |diagnostics, function, context| {
922+ parse_remote_bookmarks_arguments (
923+ diagnostics,
924+ function,
925+ Some ( RemoteRefState :: New ) ,
926+ context. default_ignored_remote ,
927+ )
913928 } ,
914929 ) ;
915930 map. insert ( "tags" , |diagnostics, function, _context| {
@@ -1205,6 +1220,7 @@ fn parse_remote_bookmarks_arguments(
12051220 diagnostics : & mut RevsetDiagnostics ,
12061221 function : & FunctionCallNode ,
12071222 remote_ref_state : Option < RemoteRefState > ,
1223+ default_ignored_remote : Option < & RemoteName > ,
12081224) -> Result < Arc < UserRevsetExpression > , RevsetParseError > {
12091225 let ( [ ] , [ bookmark_opt_arg, remote_opt_arg] ) =
12101226 function. expect_named_arguments ( & [ "" , "remote" ] ) ?;
@@ -1215,6 +1231,8 @@ fn parse_remote_bookmarks_arguments(
12151231 } ;
12161232 let remote_expr = if let Some ( remote_arg) = remote_opt_arg {
12171233 expect_string_expression ( diagnostics, remote_arg) ?
1234+ } else if let Some ( remote) = default_ignored_remote {
1235+ StringExpression :: exact ( remote) . negated ( )
12181236 } else {
12191237 StringExpression :: all ( )
12201238 } ;
@@ -2869,7 +2887,6 @@ fn resolve_commit_ref(
28692887 remote,
28702888 remote_ref_state,
28712889 } => {
2872- // TODO: should we allow to select @git bookmarks explicitly?
28732890 let bookmark_matcher = bookmark. to_matcher ( ) ;
28742891 let remote_matcher = remote. to_matcher ( ) ;
28752892 let commit_ids = repo
@@ -2878,7 +2895,6 @@ fn resolve_commit_ref(
28782895 . filter ( |( _, remote_ref) | {
28792896 remote_ref_state. is_none_or ( |state| remote_ref. state == state)
28802897 } )
2881- . filter ( |& ( symbol, _) | !crate :: git:: is_special_git_remote ( symbol. remote ) )
28822898 . flat_map ( |( _, remote_ref) | remote_ref. target . added_ids ( ) )
28832899 . cloned ( )
28842900 . collect ( ) ;
@@ -3395,13 +3411,14 @@ impl<'a> RevsetParseContext<'a> {
33953411 local_variables : _,
33963412 user_email,
33973413 date_pattern_context,
3398- default_ignored_remote : _ ,
3414+ default_ignored_remote,
33993415 extensions,
34003416 workspace,
34013417 } = * self ;
34023418 LoweringContext {
34033419 user_email,
34043420 date_pattern_context,
3421+ default_ignored_remote,
34053422 extensions,
34063423 workspace,
34073424 }
@@ -3413,6 +3430,7 @@ impl<'a> RevsetParseContext<'a> {
34133430pub struct LoweringContext < ' a > {
34143431 user_email : & ' a str ,
34153432 date_pattern_context : DatePatternContext ,
3433+ default_ignored_remote : Option < & ' a RemoteName > ,
34163434 extensions : & ' a RevsetExtensions ,
34173435 workspace : Option < RevsetWorkspaceContext < ' a > > ,
34183436}
@@ -3796,7 +3814,7 @@ mod tests {
37963814 CommitRef(
37973815 RemoteBookmarks {
37983816 bookmark: Pattern(Substring("")),
3799- remote: Pattern(Substring("" )),
3817+ remote: NotIn( Pattern(Exact("ignored") )),
38003818 remote_ref_state: None,
38013819 },
38023820 )
@@ -3805,7 +3823,7 @@ mod tests {
38053823 CommitRef(
38063824 RemoteBookmarks {
38073825 bookmark: Pattern(Substring("")),
3808- remote: Pattern(Substring("" )),
3826+ remote: NotIn( Pattern(Exact("ignored") )),
38093827 remote_ref_state: Some(Tracked),
38103828 },
38113829 )
@@ -3814,7 +3832,7 @@ mod tests {
38143832 CommitRef(
38153833 RemoteBookmarks {
38163834 bookmark: Pattern(Substring("")),
3817- remote: Pattern(Substring("" )),
3835+ remote: NotIn( Pattern(Exact("ignored") )),
38183836 remote_ref_state: Some(New),
38193837 },
38203838 )
0 commit comments