Skip to content

Instantly share code, notes, and snippets.

@upsuper
Created November 25, 2014 22:49
Show Gist options
  • Select an option

  • Save upsuper/6f67f933fa583d3750ae to your computer and use it in GitHub Desktop.

Select an option

Save upsuper/6f67f933fa583d3750ae to your computer and use it in GitHub Desktop.
Clear left .orig & .rej in hg repo
#!/bin/sh
files=$(hg status | awk '$1 == "?" && $2 ~ /\.(orig|rej)$/ { print $2 }')
echo "$files"
read -r -p "Remove these files? [y/N]" resp
case $resp in
[yY][eE][sS]|[yY])
rm $files
;;
*)
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment