~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Martin Pool
  • Date: 2006-06-20 07:55:43 UTC
  • mfrom: (1798 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1799.
  • Revision ID: mbp@sourcefrog.net-20060620075543-b10f6575d4a4fa32
[merge] bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from bzrlib.progress import DummyProgress, ProgressPhase
28
28
from bzrlib.trace import mutter, warning
29
29
import bzrlib.ui 
 
30
import bzrlib.urlutils as urlutils
30
31
 
31
32
 
32
33
ROOT_PARENT = "root-parent"
79
80
        self._tree.lock_write()
80
81
        try:
81
82
            control_files = self._tree._control_files
82
 
            self._limbodir = control_files.controlfilename('limbo')
 
83
            self._limbodir = urlutils.local_path_from_url(
 
84
                control_files.controlfilename('limbo'))
83
85
            try:
84
86
                os.mkdir(self._limbodir)
85
87
            except OSError, e:
537
539
        if child_id is None:
538
540
            return lexists(self._tree.abspath(childpath))
539
541
        else:
540
 
            if tt.final_parent(child_id) != parent_id:
 
542
            if self.final_parent(child_id) != parent_id:
541
543
                return False
542
 
            if child_id in tt._removed_contents:
 
544
            if child_id in self._removed_contents:
543
545
                # XXX What about dangling file-ids?
544
546
                return False
545
547
            else:
845
847
        parent_id is the transaction id of the parent directory of the file.
846
848
        contents is an iterator of bytestrings, which will be used to produce
847
849
        the file.
848
 
        file_id is the inventory ID of the file, if it is to be versioned.
 
850
        :param file_id: The inventory ID of the file, if it is to be versioned.
 
851
        :param executable: Only valid when a file_id has been supplied.
849
852
        """
850
853
        trans_id = self._new_entry(name, parent_id, file_id)
 
854
        # TODO: rather than scheduling a set_executable call,
 
855
        # have create_file create the file with the right mode.
851
856
        self.create_file(contents, trans_id)
852
857
        if executable is not None:
853
858
            self.set_executability(executable, trans_id)
1061
1066
    try:
1062
1067
        working_kind = working_tree.kind(file_id)
1063
1068
        has_contents = True
1064
 
    except OSError, e:
1065
 
        if e.errno != errno.ENOENT:
1066
 
            raise
 
1069
    except NoSuchFile:
1067
1070
        has_contents = False
1068
1071
        contents_mod = True
1069
1072
        meta_mod = False