/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/workingtree.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-03-24 00:53:02 UTC
  • mfrom: (6883.7.16 cleanups)
  • Revision ID: breezy.the.bot@gmail.com-20180324005302-z0eh8ftsz57804cg
Avoid using file ids in a couple more places.

Merged from https://code.launchpad.net/~jelmer/brz/cleanups/+merge/341360

Show diffs side-by-side

added added

removed removed

Lines of Context:
461
461
                    new_parents = [revision_id]
462
462
                tree.set_parent_ids(new_parents)
463
463
 
464
 
    def id2abspath(self, file_id):
465
 
        return self.abspath(self.id2path(file_id))
466
 
 
467
464
    def get_file_size(self, path, file_id=None):
468
465
        """See Tree.get_file_size"""
469
466
        # XXX: this returns the on-disk size; it should probably return the
728
725
            return file_id
729
726
 
730
727
    def get_symlink_target(self, path, file_id=None):
731
 
        if path is not None:
732
 
            abspath = self.abspath(path)
733
 
        else:
734
 
            abspath = self.id2abspath(file_id)
 
728
        abspath = self.abspath(path)
735
729
        target = osutils.readlink(abspath)
736
730
        return target
737
731
 
776
770
        raise NotImplementedError(self.flush)
777
771
 
778
772
    def kind(self, relpath, file_id=None):
779
 
        if file_id is not None:
780
 
            return osutils.file_kind(self.id2abspath(file_id))
781
773
        return osutils.file_kind(self.abspath(relpath))
782
774
 
783
775
    def list_files(self, include_root=False, from_dir=None, recursive=True):
1300
1292
            resolved = _mod_conflicts.ConflictList()
1301
1293
            conflict_re = re.compile('^(<{7}|={7}|>{7})')
1302
1294
            for conflict in self.conflicts():
 
1295
                path = self.id2path(conflict.file_id)
1303
1296
                if (conflict.typestring != 'text conflict' or
1304
 
                    self.kind(self.id2path(conflict.file_id), conflict.file_id) != 'file'):
 
1297
                    self.kind(path, conflict.file_id) != 'file'):
1305
1298
                    un_resolved.append(conflict)
1306
1299
                    continue
1307
 
                my_file = open(self.id2abspath(conflict.file_id), 'rb')
 
1300
                my_file = open(self.abspath(path), 'rb')
1308
1301
                try:
1309
1302
                    for line in my_file:
1310
1303
                        if conflict_re.search(line):