The hg prompt walks up the directory hierarchy to decide if we are in a
repo subdirectory. Because hg is an external command, it resolves symlinks.
Switch to using pwd -P so hg and fish will have the same view of the hg repo.
Based on comment:
https://github.com/fish-shell/fish-shell/pull/5190#issuecomment-421912360
I hate doing this but I am tired of touching a fish script as part of
some change and having `make style` radically change it. Which makes
editing fish scripts more painful than it needs to be. It is time to do
a wholesale reformatting of these scripts to conform to the documented
style as implemented by the `fish_indent` program.
`sort -u | uniq` is completely redundant, calling grep for every
status-pair is unnecessary, `contains` doesn't take the word "in" as
special.
None of these are critical and there's basically no performance benefit
since this function is utterly dominated by hg calls.
This doesn't add anything except slowing the function down by about
33%. Checking for a branch is just as good and that is displayed in the
prompt anyway.