# HG changeset patch # User Yuya Nishihara # Date 2015-09-20 11:08:22 # Node ID 3d24f31c6b8f768107795edc6038b5717bde29ff # Parent 007ac1acfcacbb9ec4fff14924f6afd634c04785 dirstate: state that getcwd() shouldn't be used to get real file path hgweb will force it to be '' so that file patterns can be resolved relative to the repository root. I want to clarify that is correct. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -220,6 +220,12 @@ class dirstate(object): return os.getcwd() def getcwd(self): + '''Return the path from which a canonical path is calculated. + + This path should be used to resolve file patterns or to convert + canonical paths back to file paths for display. It shouldn't be + used to get real file paths. Use vfs functions instead. + ''' cwd = self._cwd if cwd == self._root: return ''