~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/memory.py

  • Committer: Martin Pool
  • Date: 2006-03-10 06:29:53 UTC
  • mfrom: (1608 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1611.
  • Revision ID: mbp@sourcefrog.net-20060310062953-bc1c7ade75c89a7a
[merge] bzr.dev; pycurl not updated for readv yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
    def __init__(self, size, is_dir, perms):
37
37
        self.st_size = size
38
 
        if perms is None:
39
 
            perms = 0644
40
38
        if not is_dir:
 
39
            if perms is None:
 
40
                perms = 0644
41
41
            self.st_mode = S_IFREG | perms
42
42
        else:
 
43
            if perms is None:
 
44
                perms = 0755
43
45
            self.st_mode = S_IFDIR | perms
44
46
 
45
47
 
91
93
        self._check_parent(_abspath)
92
94
        orig_content, orig_mode = self._files.get(_abspath, ("", None))
93
95
        self._files[_abspath] = (orig_content + f.read(), orig_mode)
 
96
        return len(orig_content)
94
97
 
95
98
    def _check_parent(self, _abspath):
96
99
        dir = os.path.dirname(_abspath)