/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/workingtree.py

  • Committer: Marius Kruger
  • Date: 2010-04-16 06:52:00 UTC
  • mto: This revision was merged to the branch mainline in revision 5209.
  • Revision ID: marius.kruger@enerweb.co.za-20100416065200-vzsqnfxi29dx8ze7
check if changed file isStillInDirToBeRemoved before bailing out

Show diffs side-by-side

added added

removed removed

Lines of Context:
1954
1954
        def recurse_directory_to_add_files(directory):
1955
1955
            # Recurse directory and add all files
1956
1956
            # so we can check if they have changed.
1957
 
            for parent_info, file_infos in\
1958
 
                self.walkdirs(directory):
 
1957
            for parent_info, file_infos in self.walkdirs(directory):
1959
1958
                for relpath, basename, kind, lstat, fileid, kind in file_infos:
1960
1959
                    # Is it versioned or ignored?
1961
1960
                    if self.path2id(relpath) or self.is_ignored(relpath):
1986
1985
        if not keep_files and not force:
1987
1986
            has_changed_files = len(unknown_nested_files) > 0
1988
1987
            if not has_changed_files:
 
1988
                def isStillInDirToBeRemoved(new_path):
 
1989
                    for f in files:
 
1990
                        if osutils.is_inside(f, path[1]):
 
1991
                            return True
 
1992
                    return False
1989
1993
                for (file_id, path, content_change, versioned, parent_id, name,
1990
1994
                     kind, executable) in self.iter_changes(self.basis_tree(),
1991
1995
                         include_unchanged=True, require_versioned=False,
1996
2000
                            # ... but not ignored
1997
2001
                            has_changed_files = True
1998
2002
                            break
1999
 
                    elif content_change and (kind[1] is not None):
 
2003
                    elif (content_change and (kind[1] is not None) and
 
2004
                            isStillInDirToBeRemoved(path[1])):
2000
2005
                        # Versioned and changed, but not deleted
2001
2006
                        has_changed_files = True
2002
2007
                        break