Display the root location of a Hg repository. More information: https://www.mercurial-scm.org/doc/hg.1.html#root.
hg root
hg root --cwd path/to/directory