~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/add.py

  • Committer: Jelmer Vernooij
  • Date: 2011-05-23 12:30:49 UTC
  • mto: This revision was merged to the branch mainline in revision 5952.
  • Revision ID: jelmer@samba.org-20110523123049-n3fn2zl6ioigeimg
Avoid 'import bzrlib.osutils'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import sys
20
20
 
21
 
import bzrlib.osutils
 
21
from bzrlib import (
 
22
    osutils,
 
23
    )
22
24
 
23
25
 
24
26
class AddAction(object):
38
40
        if should_print is not None:
39
41
            self.should_print = should_print
40
42
 
41
 
    def __call__(self, inv, parent_ie, path, kind, _quote=bzrlib.osutils.quotefn):
 
43
    def __call__(self, inv, parent_ie, path, kind, _quote=osutils.quotefn):
42
44
        """Add path to inventory.
43
45
 
44
46
        The default action does nothing.
87
89
        if (parent_ie.file_id in self.base_tree):
88
90
            base_parent_ie = self.base_tree.inventory[parent_ie.file_id]
89
91
            base_child_ie = base_parent_ie.children.get(
90
 
                bzrlib.osutils.basename(path))
 
92
                osutils.basename(path))
91
93
            if base_child_ie is not None:
92
94
                return (base_child_ie.file_id,
93
95
                        self.base_tree.id2path(base_child_ie.file_id))
94
 
        full_base_path = bzrlib.osutils.pathjoin(self.base_path, path)
 
96
        full_base_path = osutils.pathjoin(self.base_path, path)
95
97
        # This may return None, but it is our last attempt
96
98
        return self.base_tree.path2id(full_base_path), full_base_path