~ubuntu-branches/debian/jessie/bzr-fastimport/jessie

« back to all changes in this revision

Viewing changes to tests/test_generic_processor.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2011-04-28 16:16:34 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110428161634-zh6yosxj56ncskv9
Tags: 0.10.0+bzr317-1
* New upstream snapshot.
 + Fixes 'bzr fast-import' command. LP: #736681

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
                         revtree.inventory.root.children[path].revision)
195
195
 
196
196
 
 
197
class TestImportToPackTag(TestCaseForGenericProcessor):
 
198
 
 
199
    def file_command_iter(self, path, kind='file', content='aaa',
 
200
        executable=False, to_kind=None, to_content='bbb', to_executable=None):
 
201
        # Revno 1: create a file or symlink
 
202
        # Revno 2: modify it
 
203
        if to_kind is None:
 
204
            to_kind = kind
 
205
        if to_executable is None:
 
206
            to_executable = executable
 
207
        def command_list():
 
208
            author = ['', 'bugs@a.com', time.time(), time.timezone]
 
209
            committer = ['', 'elmer@a.com', time.time(), time.timezone]
 
210
            def files_one():
 
211
                yield commands.FileModifyCommand(path,
 
212
                    kind_to_mode(kind, executable), None, content)
 
213
            yield commands.CommitCommand('head', '1', author,
 
214
                committer, "commit 1", None, [], files_one)
 
215
            def files_two():
 
216
                yield commands.FileModifyCommand(path,
 
217
                    kind_to_mode(to_kind, to_executable), None, to_content)
 
218
 
 
219
            # pass "head" for from_ to show that #401249 is worse than I knew
 
220
            yield commands.CommitCommand('head', '2', author,
 
221
                committer, "commit 2", "head", [], files_two)
 
222
 
 
223
            yield commands.TagCommand('tag1', ':1', committer, "tag 1")
 
224
 
 
225
            # pass "head" for from_ to demonstrate #401249
 
226
            yield commands.TagCommand('tag2', 'head', committer, "tag 2")
 
227
        return command_list
 
228
 
 
229
    def test_tag(self):
 
230
        handler, branch = self.get_handler()
 
231
        path = 'a'
 
232
        raise tests.KnownFailure("non-mark committish not yet supported"
 
233
                                 "- bug #410249")
 
234
        handler.process(self.file_command_iter(path))
 
235
 
 
236
 
197
237
class TestImportToPackModify(TestCaseForGenericProcessor):
198
238
 
199
239
    def file_command_iter(self, path, kind='file', content='aaa',