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

Fix handling of not-executable files becoming executable without any other changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
143
143
        self.assertTrue(tree.has_filename("notexec"))
144
144
        self.assertEquals(False, tree.inventory[tree.path2id("notexec")].executable)
145
145
 
 
146
    def test_becomes_executable(self):
 
147
        self.make_git_repo("d")
 
148
        os.chdir("d")
 
149
        bb = GitBranchBuilder()
 
150
        bb.set_file("foobar", "foo\nbar\n", False)
 
151
        mark1 = bb.commit("Somebody <somebody@someorg.org>", "mymsg")
 
152
        bb.set_file("foobar", "foo\nbar\n", True)
 
153
        mark2 = bb.commit("Somebody <somebody@someorg.org>", "mymsg")
 
154
        gitsha2 = bb.finish()[mark2]
 
155
        os.chdir("..")
 
156
        oldrepo = self.open_git_repo("d")
 
157
        newrepo = self.clone_git_repo("d", "f")
 
158
        revid = oldrepo.get_mapping().revision_id_foreign_to_bzr(gitsha2)
 
159
        tree = newrepo.revision_tree(revid)
 
160
        self.assertTrue(tree.has_filename("foobar"))
 
161
        ie = tree.inventory[tree.path2id("foobar")]
 
162
        self.assertEquals(True, ie.executable)
 
163
        self.assertEquals(revid, ie.revision)
 
164
 
146
165
    def test_non_ascii_characters(self):
147
166
        self.make_git_repo("d")
148
167
        os.chdir("d")