dirstate: state that getcwd() shouldn't be used to get real file path
authorYuya Nishihara <yuya@tcha.org>
Sun, 20 Sep 2015 20:08:22 +0900
changeset 26293 3d24f31c6b8f
parent 26292 007ac1acfcac
child 26294 1ffc61c4e32e
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.
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Wed Sep 16 12:36:21 2015 -0700
+++ b/mercurial/dirstate.py	Sun Sep 20 20:08:22 2015 +0900
@@ -220,6 +220,12 @@
         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 ''