Add a 'pushed(x)' built-in function to revsets
I would find a function that filters for commits that have been pushed to a remote repository useful in revsets.
Proposed function description:
pushed(x): all commits in x that have been pushed to a remote repo
Example usages: Lint all commits in the current stack that haven't been pushed yet (commits that have been pushed shouldn't be modified!): `$ git test fix --exec 'cargo fmt --all' 'stack() - pushed(stack())'
Print all new commits that will be pushed with 'git push': $ git_push_check() { echo "New commits that will be pushed:" && git query "master..$1 - pushed(master..$1)" ; }
It might actually be easier or more composeable to define pushed(), which evaluates to all commits reachable from a remote ref. (The implementation treats commit ranges symbolically and has separate evaluate vs contains code paths, so it can be made efficient in many cases.)