Permissions: -rwxr-xr-x
#!/bin/bashroot="$(pwd -P)"while [[ $root && ! -d $root/.hg ]]do root="${root%/*}"doneecho "$root"