/breezy-svn/trunk

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy-svn/trunk

« back to all changes in this revision

Viewing changes to workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2020-01-31 19:40:01 UTC
  • Revision ID: jelmer@jelmer.uk-20200131194001-ri4z8wyq0cvymo20
More python3/breezy compat fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
    conflicts as _mod_conflicts,
58
58
    errors as bzr_errors,
59
59
    hashcache,
 
60
    location as _mod_location,
60
61
    osutils,
61
62
    rio as _mod_rio,
62
63
    transport as _mod_transport,
622
623
        return ("NEW-" + escape_svn_path(osutils.safe_utf8(relpath).strip("/")),
623
624
                None)
624
625
 
625
 
    def get_root_id(self):
626
 
        return self.path2id("")
627
 
 
628
626
    def path2id(self, path):
629
627
        if isinstance(path, list):
630
628
            path = "/".join(path)
686
684
            pass
687
685
        if file_id.startswith("NEW-"):
688
686
            return urlutils.unescape(file_id[4:])
689
 
        if file_id == self.get_root_id():
 
687
        if file_id == self.path2id(''):
690
688
            # Special case if self.last_revision() == 'null:'
691
689
            return ""
692
690
        raise NoSuchId(self, file_id)
1629
1627
             [(file1_path, file1_name, file1_kind, None, file1_id,
1630
1628
               file1_kind), ... ])
1631
1629
        """
1632
 
        pending = [(prefix, '', 'directory', None, self.get_root_id(), None)]
 
1630
        pending = [(prefix, '', 'directory', None, self.path2id(''), None)]
1633
1631
        while pending:
1634
1632
            dirblock = []
1635
1633
            currentdir = pending.pop()
1846
1844
        wt = self.open_workingtree()
1847
1845
        if revision_id is None:
1848
1846
            revision_id = wt.last_revision()
1849
 
        url = _mod_transport.location_to_url(location)
 
1847
        url = _mod_location.location_to_url(location)
1850
1848
        path = urlutils.local_path_from_url(url)
1851
1849
        return wt.branch.create_checkout(path, lightweight=True,
1852
1850
            revision_id=revision_id).controldir