/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 bzrlib/mutabletree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-08-20 05:22:49 UTC
  • mfrom: (6046.2.11 54624-warn-on-large-files)
  • Revision ID: pqm@pqm.ubuntu.com-20110820052249-41vfmtn5g0i7ngqb
(jr) bzr add now skips large files in recursive mode. The default "large"
 size is 20MB, and is configurable via the add.maximum_file_size
 option. A value of 0 disables skipping. Named items passed to add are
 never skipped. (Shannon Weyrick, #54624) (Shannon Weyrick)

Show diffs side-by-side

added added

removed removed

Lines of Context:
582
582
        :param parent_ie: Parent inventory entry if known, or None.  If
583
583
            None, the parent is looked up by name and used if present, otherwise it
584
584
            is recursively added.
 
585
        :param path: 
585
586
        :param kind: Kind of new entry (file, directory, etc)
586
 
        :param action: callback(tree, parent_ie, path, kind); can return file_id
 
587
        :param inv_path:
587
588
        :return: Inventory entry for path and a list of paths which have been added.
588
589
        """
589
590
        # Nothing to do if path is already versioned.
628
629
            if (prev_dir is None or not is_inside([prev_dir], path)):
629
630
                yield (path, inv_path, this_ie, None)
630
631
            prev_dir = path
631
 
 
 
632
        
632
633
    def __init__(self, tree, action, conflicts_related=None):
633
634
        self.tree = tree
634
635
        if action is None:
695
696
 
696
697
            # get the contents of this directory.
697
698
 
698
 
            # find the kind of the path being added.
 
699
            # find the kind of the path being added, and save stat_value
 
700
            # for reuse
 
701
            stat_value = None
699
702
            if this_ie is None:
700
 
                kind = osutils.file_kind(abspath)
 
703
                stat_value = osutils.file_stat(abspath)
 
704
                kind = osutils.file_kind_from_stat_mode(stat_value.st_mode)
701
705
            else:
702
706
                kind = this_ie.kind
703
 
 
 
707
            
 
708
            # allow AddAction to skip this file
 
709
            if self.action.skip_file(self.tree,  abspath,  kind,  stat_value):
 
710
                continue
704
711
            if not InventoryEntry.versionable_kind(kind):
705
712
                trace.warning("skipping %s (can't add file of kind '%s')",
706
713
                              abspath, kind)
769
776
                        # recurse into this already versioned subdir.
770
777
                        things_to_add.append((subp, sub_invp, sub_ie, this_ie))
771
778
                    else:
772
 
                        # user selection overrides ignoes
 
779
                        # user selection overrides ignores
773
780
                        # ignore while selecting files - if we globbed in the
774
781
                        # outer loop we would ignore user files.
775
782
                        ignore_glob = self.tree.is_ignored(subp)