/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/tests/blackbox/test_remove.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-12 18:05:15 UTC
  • mto: (4371.4.5 vila-better-heads)
  • mto: This revision was merged to the branch mainline in revision 4449.
  • Revision ID: john@arbash-meinel.com-20090612180515-t0cwbjsnve094oik
Add a failing test for handling nodes that are in the same linear chain.

It fails because the ancestry skipping causes us to miss the fact that the two nodes
are actually directly related. We could check at the beginning, as the 
code used to do, but I think that will be incomplete for the more-than-two
heads cases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
        f.write("\nsome other new content!")
62
62
        f.close()
63
63
 
64
 
    def run_bzr_remove_changed_files(self, error_regexes, files_to_remove,
65
 
                                     working_dir=None):
 
64
    def run_bzr_remove_changed_files(self, error_regexes, files_to_remove):
66
65
        error_regexes.extend(["Can't safely remove modified or unknown files:",
67
66
            'Use --keep to not delete them,'
68
67
            ' or --force to delete them regardless.'
69
68
            ])
70
69
        self.run_bzr_error(error_regexes,
71
 
                           ['remove'] + list(files_to_remove),
72
 
                           working_dir=working_dir)
 
70
            ['remove'] + list(files_to_remove))
73
71
        #see if we can force it now
74
 
        self.run_bzr(['remove', '--force'] + list(files_to_remove),
75
 
                     working_dir=working_dir)
 
72
        self.run_bzr(['remove', '--force'] + list(files_to_remove))
76
73
 
77
74
    def test_remove_new_no_files_specified(self):
78
75
        tree = self.make_branch_and_tree('.')
199
196
        self.run_bzr("commit -m 'added files'")
200
197
        self.changeFile(a)
201
198
        self.changeFile(c)
202
 
        self.run_bzr_remove_changed_files(
203
 
            ['modified:[.\s]*a[.\s]*b/c'],
204
 
            ['../a', 'c', '.', '../d'], working_dir='b')
 
199
        os.chdir('b')
 
200
        self.run_bzr_remove_changed_files(['modified:[.\s]*a[.\s]*b/c'],
 
201
            ['../a', 'c', '.', '../d'])
 
202
        os.chdir('..')
205
203
        self.assertNotInWorkingTree(files)
206
204
        self.failIfExists(files)
207
205