Mercurial > hg
comparison mercurial/util.py @ 9112:54eb3782d32f
util: use propertycache in opener instead of __getattr__
author | Simon Heimberg <simohe@besonet.ch> |
---|---|
date | Fri, 10 Jul 2009 17:54:04 +0200 |
parents | bbc78cb1bf15 |
children | b46063eabe98 |
comparison
equal
deleted
inserted
replaced
9111:ac3f1e6696eb | 9112:54eb3782d32f |
---|---|
840 self.audit_path = path_auditor(base) | 840 self.audit_path = path_auditor(base) |
841 else: | 841 else: |
842 self.audit_path = always | 842 self.audit_path = always |
843 self.createmode = None | 843 self.createmode = None |
844 | 844 |
845 def __getattr__(self, name): | 845 @propertycache |
846 if name == '_can_symlink': | 846 def _can_symlink(self): |
847 self._can_symlink = checklink(self.base) | 847 return checklink(self.base) |
848 return self._can_symlink | |
849 raise AttributeError(name) | |
850 | 848 |
851 def _fixfilemode(self, name): | 849 def _fixfilemode(self, name): |
852 if self.createmode is None: | 850 if self.createmode is None: |
853 return | 851 return |
854 os.chmod(name, self.createmode & 0666) | 852 os.chmod(name, self.createmode & 0666) |