Changeset 1203 in tailor for vcpx/repository/bzr.py


Ignore:
Timestamp:
07/01/06 14:00:23 (7 years ago)
Author:
Adeodato Simo <dato@…>
Hash name:
20060701120023-d6905-5c72403bc1a2b22540203982d818d6aa61be6525
Message:

[bzr] _addSubtree(): do not add files in IGNORED_METADIRS and .bzrignore

The implementation of _addSubtree() recently introduced forces the
addition of files ignored by bzr, because the source repository could
contain files that matched bzr's idea of ignorable files.

However, dirs in IGNORED_METADIRS and things like the status and log
files (which _prepareTargetRepository adds to .bzrignore) should always
be ignored. This patch addresses that.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/repository/bzr.py

    r1201 r1203  
    2525from bzrlib.add import smart_add_tree 
    2626from bzrlib import errors 
     27from bzrlib import IGNORE_FILENAME 
    2728 
    2829from vcpx.repository import Repository 
     
    5051        # TODO: check if there is a "repository" in the configuration, 
    5152        # and use it as a bzr repository 
     53        self.ignored = [] 
    5254        self._working_tree = None 
    5355        try: 
    5456            bzrdir = BzrDir.open(self.basedir) 
    55             self._working_tree = bzrdir.open_workingtree() 
     57            wt = self._working_tree = bzrdir.open_workingtree() 
     58 
     59            # read .bzrignore for _addSubtree() 
     60            if wt.has_filename(IGNORE_FILENAME): 
     61                f = wt.get_file_byname(IGNORE_FILENAME) 
     62                self.ignored.extend([ line.rstrip("\n\r") for line in f.readlines() ]) 
    5663        except errors.NotBranchError, errors.NoWorkingTree: 
    5764            pass 
     
    164171        added, ignored = smart_add_tree(self._working_tree, [subdir], recurse=True) 
    165172 
     173        from vcpx.dualwd import IGNORED_METADIRS 
     174 
     175        for meta in IGNORED_METADIRS + self.ignored: 
     176            if ignored.has_key(meta): 
     177                del ignored[meta] 
     178 
    166179        if len(ignored): 
    167180            f = [] 
     
    255268        """ 
    256269        from os.path import join, split 
    257         from bzrlib import IGNORE_FILENAME 
    258270 
    259271        if self._working_tree is None: 
    260             ignored = [] 
     272            ignored = self.ignored 
    261273 
    262274            # Omit our own log... 
Note: See TracChangeset for help on using the changeset viewer.