~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/text.py

  • Committer: Robert Collins
  • Date: 2006-01-02 22:37:32 UTC
  • mfrom: (1185.50.33 bzr-jam-integration)
  • Revision ID: robertc@robertcollins.net-20060102223732-d5221b37ff0f7888
Merge in John Meinels integration branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
 
66
66
    def _try_put(self, fn, f):
67
67
        try:
68
 
            self._transport.put(fn, f)
 
68
            self._transport.put(fn, f, mode=self._file_mode)
69
69
        except NoSuchFile:
70
70
            if not self._prefixed:
71
71
                raise
72
72
            try:
73
 
                self._transport.mkdir(os.path.dirname(fn))
 
73
                self._transport.mkdir(os.path.dirname(fn), mode=self._dir_mode)
74
74
            except FileExists:
75
75
                pass
76
 
            self._transport.put(fn, f)
 
76
            self._transport.put(fn, f, mode=self._file_mode)
77
77
 
78
78
    def _get(self, fn):
79
79
        if fn.endswith('.gz'):
95
95
            raise KeyError(fileid + '-' + str(suffix))
96
96
 
97
97
        try:
98
 
            result = other._transport.copy_to([path], self._transport, pb=pb)
 
98
            result = other._transport.copy_to([path], self._transport, pb=pb,
 
99
                                              mode=self._file_mode)
99
100
        except NoSuchFile:
100
101
            if not self._prefixed:
101
102
                raise
102
103
            try:
103
 
                self._transport.mkdir(hash_prefix(fileid)[:-1])
 
104
                self._transport.mkdir(hash_prefix(fileid)[:-1], mode=self._dir_mode)
104
105
            except FileExists:
105
106
                pass
106
 
            result = other._transport.copy_to([path], self._transport, pb=pb)
 
107
            result = other._transport.copy_to([path], self._transport, pb=pb,
 
108
                                              mode=self._file_mode)
107
109
 
108
110
        if result != 1:
109
111
            raise BzrError('Unable to copy file: %r' % (path,))