~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Jelmer Vernooij
  • Date: 2012-04-02 01:44:26 UTC
  • mfrom: (6518 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6519.
  • Revision ID: jelmer@samba.org-20120402014426-0o5qtysohyl006b2
merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    cache_utf8,
39
39
    config,
40
40
    conflicts as _mod_conflicts,
 
41
    controldir,
41
42
    debug,
42
43
    dirstate,
43
44
    errors,
893
894
    @needs_read_lock
894
895
    def path2id(self, path):
895
896
        """Return the id for path in this tree."""
 
897
        if isinstance(path, list):
 
898
            if path == []:
 
899
                path = [""]
 
900
            path = osutils.pathjoin(*path)
896
901
        path = path.strip('/')
897
902
        entry = self._get_entry(path=path)
898
903
        if entry == (None, None):
1608
1613
    def _get_matchingbzrdir(self):
1609
1614
        """Overrideable method to get a bzrdir for testing."""
1610
1615
        # please test against something that will let us do tree references
1611
 
        return bzrdir.format_registry.make_bzrdir(
 
1616
        return controldir.format_registry.make_bzrdir(
1612
1617
            'development-subtree')
1613
1618
 
1614
1619
    _matchingbzrdir = property(__get_matchingbzrdir)
1776
1781
        if path is not None:
1777
1782
            path = path.encode('utf8')
1778
1783
        parent_index = self._get_parent_index()
1779
 
        return self._dirstate._get_entry(parent_index, fileid_utf8=file_id, path_utf8=path)
 
1784
        return self._dirstate._get_entry(parent_index, fileid_utf8=file_id,
 
1785
            path_utf8=path)
1780
1786
 
1781
1787
    def _generate_inventory(self):
1782
1788
        """Create and set self.inventory from the dirstate object.
2028
2034
    def path2id(self, path):
2029
2035
        """Return the id for path in this tree."""
2030
2036
        # lookup by path: faster than splitting and walking the ivnentory.
 
2037
        if isinstance(path, list):
 
2038
            if path == []:
 
2039
                path = [""]
 
2040
            path = osutils.pathjoin(*path)
2031
2041
        entry = self._get_entry(path=path)
2032
2042
        if entry == (None, None):
2033
2043
            return None