/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/plugins/fastimport/exporter.py

  • Committer: Jelmer Vernooij
  • Date: 2017-11-12 20:07:32 UTC
  • mto: This revision was merged to the branch mainline in revision 6819.
  • Revision ID: jelmer@jelmer.uk-20171112200732-ehxgen03s9jphe8n
Swap arguments for get_symlink_target and kind/stored_kind.

Show diffs side-by-side

added added

removed removed

Lines of Context:
294
294
            marks_file.export_marks(self.export_marks_file, revision_ids)
295
295
 
296
296
    def is_empty_dir(self, tree, path):
297
 
        path_id = tree.path2id(path)
298
 
        if path_id is None:
 
297
        # Continue if path is not a directory
 
298
        try:
 
299
            if tree.kind(path) != 'directory':
 
300
                return False
 
301
        except bazErrors.NoSuchFile:
299
302
            self.warning("Skipping empty_dir detection - no file_id for %s" %
300
303
                (path,))
301
304
            return False
302
305
 
303
 
        # Continue if path is not a directory
304
 
        if tree.kind(path_id) != 'directory':
305
 
            return False
306
 
 
307
306
        # Use treewalk to find the contents of our directory
308
307
        contents = list(tree.walkdirs(prefix=path))[0]
309
308
        if len(contents[1]) == 0:
494
493
            elif kind == 'symlink':
495
494
                file_cmds.append(commands.FileModifyCommand(path.encode("utf-8"),
496
495
                    helpers.kind_to_mode('symlink', False),
497
 
                    None, tree_new.get_symlink_target(id_)))
 
496
                    None, tree_new.get_symlink_target(path, id_)))
498
497
            elif kind == 'directory':
499
498
                if not self.plain_format:
500
499
                    file_cmds.append(commands.FileModifyCommand(path.encode("utf-8"),
557
556
 
558
557
            # Renaming a directory implies all children must be renamed.
559
558
            # Note: changes_from() doesn't handle this
560
 
            if kind == 'directory' and tree_old.kind(id_) == 'directory':
 
559
            if kind == 'directory' and tree_old.kind(oldpath, id_) == 'directory':
561
560
                for p, e in tree_old.inventory.iter_entries_by_dir(from_dir=id_):
562
561
                    if e.kind == 'directory' and self.plain_format:
563
562
                        continue