~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Martin Pool
  • Date: 2009-03-24 04:49:51 UTC
  • mfrom: (3407.2.20 controlfiles)
  • mto: This revision was merged to the branch mainline in revision 4202.
  • Revision ID: mbp@sourcefrog.net-20090324044951-k5h6x6u0zz4721m5
bzrdir takes responsibility for file/directory unix modes

Show diffs side-by-side

added added

removed removed

Lines of Context:
722
722
    def _set_merges_from_parent_ids(self, parent_ids):
723
723
        merges = parent_ids[1:]
724
724
        self._transport.put_bytes('pending-merges', '\n'.join(merges),
725
 
            mode=self._control_files._file_mode)
 
725
            mode=self.bzrdir._get_file_mode())
726
726
 
727
727
    @needs_tree_write_lock
728
728
    def set_parent_ids(self, revision_ids, allow_leftmost_as_ghost=False):
805
805
        self._must_be_locked()
806
806
        my_file = rio_file(stanzas, header)
807
807
        self._transport.put_file(filename, my_file,
808
 
            mode=self._control_files._file_mode)
 
808
            mode=self.bzrdir._get_file_mode())
809
809
 
810
810
    @needs_write_lock # because merge pulls data into the branch.
811
811
    def merge_from_branch(self, branch, to_revision=None, from_revision=None,
1034
1034
        self._serialize(self._inventory, sio)
1035
1035
        sio.seek(0)
1036
1036
        self._transport.put_file('inventory', sio,
1037
 
            mode=self._control_files._file_mode)
 
1037
            mode=self.bzrdir._get_file_mode())
1038
1038
        self._inventory_is_modified = False
1039
1039
 
1040
1040
    def _kind(self, relpath):
1750
1750
        path = self._basis_inventory_name()
1751
1751
        sio = StringIO(xml)
1752
1752
        self._transport.put_file(path, sio,
1753
 
            mode=self._control_files._file_mode)
 
1753
            mode=self.bzrdir._get_file_mode())
1754
1754
 
1755
1755
    def _create_basis_xml_from_inventory(self, revision_id, inventory):
1756
1756
        """Create the text that will be saved in basis-inventory"""
2519
2519
            return False
2520
2520
        else:
2521
2521
            self._transport.put_bytes('last-revision', revision_id,
2522
 
                mode=self._control_files._file_mode)
 
2522
                mode=self.bzrdir._get_file_mode())
2523
2523
            return True
2524
2524
 
2525
2525
    @needs_tree_write_lock
2674
2674
        xml5.serializer_v5.write_inventory(inv, sio, working=True)
2675
2675
        sio.seek(0)
2676
2676
        branch._transport.put_file('inventory', sio,
2677
 
            mode=branch.control_files._file_mode)
 
2677
            mode=branch.bzrdir._get_file_mode())
2678
2678
        branch._transport.put_bytes('pending-merges', '',
2679
 
            mode=branch.control_files._file_mode)
 
2679
            mode=branch.bzrdir._get_file_mode())
2680
2680
        
2681
2681
 
2682
2682
    def initialize(self, a_bzrdir, revision_id=None, from_branch=None,
2792
2792
        control_files.create_lock()
2793
2793
        control_files.lock_write()
2794
2794
        transport.put_bytes('format', self.get_format_string(),
2795
 
            mode=control_files._file_mode)
 
2795
            mode=a_bzrdir._get_file_mode())
2796
2796
        if from_branch is not None:
2797
2797
            branch = from_branch
2798
2798
        else: