changeset 26293:3d24f31c6b8f

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.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 20 Sep 2015 20:08:22 +0900
parents 007ac1acfcac
children 1ffc61c4e32e
files mercurial/dirstate.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 ''