/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/transport/__init__.py

  • Committer: Martin Pool
  • Date: 2007-08-16 01:02:17 UTC
  • mfrom: (2696.1.2 remove-deprecated)
  • mto: This revision was merged to the branch mainline in revision 2712.
  • Revision ID: mbp@sourcefrog.net-20070816010217-oja4sj0bsjsnrbkv
Merge removal of deprecations

Show diffs side-by-side

added added

removed removed

Lines of Context:
688
688
            yield self.get(relpath)
689
689
            count += 1
690
690
 
691
 
    @deprecated_method(zero_eleven)
692
 
    def put(self, relpath, f, mode=None):
693
 
        """Copy the file-like object into the location.
694
 
 
695
 
        :param relpath: Location to put the contents, relative to base.
696
 
        :param f:       File-like object.
697
 
        :param mode: The mode for the newly created file, 
698
 
                     None means just use the default
699
 
        """
700
 
        if isinstance(f, str):
701
 
            return self.put_bytes(relpath, f, mode=mode)
702
 
        else:
703
 
            return self.put_file(relpath, f, mode=mode)
704
 
 
705
691
    def put_bytes(self, relpath, bytes, mode=None):
706
692
        """Atomically put the supplied bytes into the given location.
707
693
 
789
775
                self.mkdir(parent_dir, mode=dir_mode)
790
776
                return self.put_file(relpath, f, mode=mode)
791
777
 
792
 
    @deprecated_method(zero_eleven)
793
 
    def put_multi(self, files, mode=None, pb=None):
794
 
        """Put a set of files into the location.
795
 
 
796
 
        :param files: A list of tuples of relpath, file object [(path1, file1), (path2, file2),...]
797
 
        :param pb:  An optional ProgressBar for indicating percent done.
798
 
        :param mode: The mode for the newly created files
799
 
        :return: The number of files copied.
800
 
        """
801
 
        def _put(path, f):
802
 
            if isinstance(f, str):
803
 
                self.put_bytes(path, f, mode=mode)
804
 
            else:
805
 
                self.put_file(path, f, mode=mode)
806
 
        return len(self._iterate_over(files, _put, pb, 'put', expand=True))
807
 
 
808
778
    def mkdir(self, relpath, mode=None):
809
779
        """Create a directory at the given path."""
810
780
        raise NotImplementedError(self.mkdir)
815
785
            self.mkdir(path, mode=mode)
816
786
        return len(self._iterate_over(relpaths, mkdir, pb, 'mkdir', expand=False))
817
787
 
818
 
    @deprecated_method(zero_eleven)
819
 
    def append(self, relpath, f, mode=None):
820
 
        """Append the text in the file-like object to the supplied location.
821
 
 
822
 
        returns the length of relpath before the content was written to it.
823
 
        
824
 
        If the file does not exist, it is created with the supplied mode.
825
 
        """
826
 
        return self.append_file(relpath, f, mode=mode)
827
 
 
828
788
    def append_file(self, relpath, f, mode=None):
829
789
        """Append bytes from a file-like object to a file at relpath.
830
790