~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/memory.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""Implementation of Transport that uses memory for its storage.
18
18
 
183
183
        for file in self._files:
184
184
            if file.startswith(self._cwd):
185
185
                yield urlutils.escape(file[len(self._cwd):])
186
 
    
 
186
 
187
187
    def list_dir(self, relpath):
188
188
        """See Transport.list_dir()."""
189
189
        _abspath = self._abspath(relpath)
222
222
                    del container[path]
223
223
        do_renames(self._files)
224
224
        do_renames(self._dirs)
225
 
    
 
225
 
226
226
    def rmdir(self, relpath):
227
227
        """See Transport.rmdir."""
228
228
        _abspath = self._abspath(relpath)
243
243
        """See Transport.stat()."""
244
244
        _abspath = self._abspath(relpath)
245
245
        if _abspath in self._files:
246
 
            return MemoryStat(len(self._files[_abspath][0]), False, 
 
246
            return MemoryStat(len(self._files[_abspath][0]), False,
247
247
                              self._files[_abspath][1])
248
248
        elif _abspath in self._dirs:
249
249
            return MemoryStat(0, True, self._dirs[_abspath])