~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/clean_tree.py

  • Committer: Alexander Belchenko
  • Date: 2010-05-04 09:20:17 UTC
  • mto: This revision was merged to the branch mainline in revision 5212.
  • Revision ID: bialix@ukr.net-20100504092017-sc16krr0bg73fjp5
more comments

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
            return 0
59
59
        if not no_prompt:
60
60
            for path, subp in deletables:
 
61
                # FIXME using print is very bad idea
 
62
                # clean_tree should accept to_file argument to write the output
61
63
                print subp
62
64
            val = raw_input('Are you sure you wish to delete these [y/N]?')
63
65
            if val.lower() not in ('y', 'yes'):
72
74
    result = []
73
75
    for path, subp in deletables:
74
76
        # bzr won't recurse into unknowns/ignored directories by default
75
 
        # so we don't pay a penalty for checking subdirs of path for nested bzrdir
76
 
        # that said we won't detect the branch in the subdir of non-branch directory
77
 
        # and therefore delete it. (FIXME?)
 
77
        # so we don't pay a penalty for checking subdirs of path for nested
 
78
        # bzrdir.
 
79
        # That said we won't detect the branch in the subdir of non-branch
 
80
        # directory and therefore delete it. (worth to FIXME?)
78
81
        if isdir(path):
79
82
            try:
80
83
                bzrdir.BzrDir.open(path)
81
84
            except errors.NotBranchError:
82
85
                result.append((path,subp))
 
86
            else:
 
87
                # TODO may be we need to notify user about skipped directories?
 
88
                pass
83
89
        else:
84
90
            result.append((path,subp))
85
91
    return result