Mercurial > public > mercurial-scm > hg
comparison mercurial/scmutil.py @ 18945:e75b72fffdfe
vfs: split "expand" into "realpath"/"expandpath" to apply each separately
Before this patch, vfs constructor applies both "util.expandpath()"
and "os.path.realpath()" on "base" path, if "expand" is True.
This patch splits it into "realpath" and "expandpath", to apply each
functions separately: this splitting can allow to use vfs also where
one of each is not needed.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Mon, 15 Apr 2013 01:22:15 +0900 |
parents | 02ee846b246a |
children | 2f05fa162316 |
comparison
equal
deleted
inserted
replaced
18944:a9c443b3b240 | 18945:e75b72fffdfe |
---|---|
261 '''Operate files relative to a base directory | 261 '''Operate files relative to a base directory |
262 | 262 |
263 This class is used to hide the details of COW semantics and | 263 This class is used to hide the details of COW semantics and |
264 remote file access from higher level code. | 264 remote file access from higher level code. |
265 ''' | 265 ''' |
266 def __init__(self, base, audit=True, expand=False): | 266 def __init__(self, base, audit=True, expandpath=False, realpath=False): |
267 if expand: | 267 if expandpath: |
268 base = os.path.realpath(util.expandpath(base)) | 268 base = util.expandpath(base) |
269 if realpath: | |
270 base = os.path.realpath(base) | |
269 self.base = base | 271 self.base = base |
270 self._setmustaudit(audit) | 272 self._setmustaudit(audit) |
271 self.createmode = None | 273 self.createmode = None |
272 self._trustnlink = None | 274 self._trustnlink = None |
273 | 275 |