def test_empty(self):

        import_quilt_patches(self.repo,
                             branch=self.repo.get_branch(),
                             series=SERIES_FILE,
                             tries=1,
                             force=TestFromTAG.Options.force,
                             pq_from=TestFromTAG.Options.pq_from,
                             upstream_tag=TestFromTAG.Options.upstream_tag)
        diff = self.repo.diff(self.repo.get_branch(), 'upstream/0.0.1')
        self.assertEqual(b'', diff)
        diff = self.repo.diff(self.repo.get_branch(), 'master')
        self.assertNotEqual(b'', diff)

        rebase_pq(self.repo,
                  branch=self.repo.get_branch(),
                  options=TestFromTAG.Options)
        diff = self.repo.diff(self.repo.get_branch(), 'upstream/0.0.1')
        self.assertEqual(b'', diff)
        diff = self.repo.diff(self.repo.get_branch(), 'master')
        self.assertNotEqual(b'', diff)

        export_patches(self.repo,
                       branch=self.repo.get_branch(),
                       options=TestFromTAG.Options())
        diff = self.repo.diff(self.repo.get_branch(), self.repo.head)
        self.assertEqual(b'', diff)
Exemple #2
0
    def test_empty(self):

        import_quilt_patches(self.repo,
                             branch=self.repo.get_branch(),
                             series=SERIES_FILE,
                             tries=1,
                             force=TestFromTAG.Options.force,
                             pq_from=TestFromTAG.Options.pq_from,
                             upstream_tag=TestFromTAG.Options.upstream_tag)
        diff = self.repo.diff(self.repo.get_branch(), 'upstream/0.0.1')
        self.assertEqual('', diff)
        diff = self.repo.diff(self.repo.get_branch(), 'master')
        self.assertNotEqual('', diff)

        rebase_pq(self.repo,
                  branch=self.repo.get_branch(),
                  pq_from=TestFromTAG.Options.pq_from,
                  upstream_tag=TestFromTAG.Options.upstream_tag)
        diff = self.repo.diff(self.repo.get_branch(), 'upstream/0.0.1')
        self.assertEqual('', diff)
        diff = self.repo.diff(self.repo.get_branch(), 'master')
        self.assertNotEqual('', diff)

        export_patches(self.repo,
                       branch=self.repo.get_branch(),
                       options=TestFromTAG.Options())
        diff = self.repo.diff(self.repo.get_branch(), self.repo.head)
        self.assertEqual('', diff)
Exemple #3
0
 def test_adding_patch(self):
     import_quilt_patches(self.repo,
                          branch=self.repo.get_branch(),
                          series=SERIES_FILE,
                          tries=1,
                          force=TestFromTAG.Options.force,
                          pq_from=TestFromTAG.Options.pq_from,
                          upstream_tag=TestFromTAG.Options.upstream_tag)
     self.add_file('bar', 'bar', 'added bar')
     export_patches(self.repo,
                    branch=self.repo.get_branch(),
                    options=TestFromTAG.Options())
     self.assertTrue(
         os.path.exists(
             os.path.join(self.repo.path, os.path.dirname(SERIES_FILE),
                          'added-bar.patch')))
     pq.switch_pq(self.repo, 'master')
     rebase_pq(self.repo,
               branch=self.repo.get_branch(),
               pq_from=TestFromTAG.Options.pq_from,
               upstream_tag=TestFromTAG.Options.upstream_tag)
     export_patches(self.repo,
                    branch=self.repo.get_branch(),
                    options=TestFromTAG.Options())
     self.assertTrue(
         os.path.exists(
             os.path.join(self.repo.path, os.path.dirname(SERIES_FILE),
                          'added-bar.patch')))
     # New upstream release
     self.repo.set_branch('bar')
     GitCommand('cherry-pick', cwd=self.repo.path)(['patch-queue/master'])
     self.repo.create_tag('upstream/0.0.2')
     self.repo.set_branch('master')
     self.add_file(
         'debian/changelog', 'foo (0.0.2-1) UNRELEASED; urgency=medium\n'
         '\n'
         '  * Initial foo\n'
         '\n'
         ' -- Mr. T. S. <*****@*****.**>  '
         'Thu, 01 Jan 1970 00:00:00 +0000\n')
     pq.switch_pq(self.repo, 'master')
     rebase_pq(self.repo,
               branch=self.repo.get_branch(),
               pq_from=TestFromTAG.Options.pq_from,
               upstream_tag=TestFromTAG.Options.upstream_tag)
     export_patches(self.repo,
                    branch=self.repo.get_branch(),
                    options=TestFromTAG.Options())
     self.assertFalse(
         os.path.exists(
             os.path.join(self.repo.path, os.path.dirname(SERIES_FILE),
                          'added-bar.patch')))
Exemple #4
0
 def test_adding_patch(self):
     import_quilt_patches(self.repo,
                          branch=self.repo.get_branch(),
                          series=SERIES_FILE,
                          tries=1,
                          force=TestFromTAG.Options.force,
                          pq_from=TestFromTAG.Options.pq_from,
                          upstream_tag=TestFromTAG.Options.upstream_tag)
     self.add_file('bar', 'bar', 'added bar')
     export_patches(self.repo,
                    branch=self.repo.get_branch(),
                    options=TestFromTAG.Options())
     self.assertTrue(os.path.exists(os.path.join(self.repo.path,
                                                 os.path.dirname(SERIES_FILE),
                                                 'added-bar.patch')))
     rebase_pq(self.repo,
               branch=self.repo.get_branch(),
               pq_from=TestFromTAG.Options.pq_from,
               upstream_tag=TestFromTAG.Options.upstream_tag)
     export_patches(self.repo,
                    branch=self.repo.get_branch(),
                    options=TestFromTAG.Options())
     self.assertTrue(os.path.exists(os.path.join(self.repo.path,
                                                 os.path.dirname(SERIES_FILE),
                                                 'added-bar.patch')))
     # New upstream release
     self.repo.set_branch('bar')
     GitCommand('cherry-pick', cwd=self.repo.path)(['patch-queue/master'])
     self.repo.create_tag('upstream/0.0.2')
     self.repo.set_branch('master')
     self.add_file(
         'debian/changelog',
         'foo (0.0.2-1) UNRELEASED; urgency=medium\n'
         '\n'
         '  * Initial foo\n'
         '\n'
         ' -- Mr. T. S. <*****@*****.**>  '
         'Thu, 01 Jan 1970 00:00:00 +0000\n'
     )
     rebase_pq(self.repo,
               branch=self.repo.get_branch(),
               pq_from=TestFromTAG.Options.pq_from,
               upstream_tag=TestFromTAG.Options.upstream_tag)
     export_patches(self.repo,
                    branch=self.repo.get_branch(),
                    options=TestFromTAG.Options())
     self.assertFalse(os.path.exists(os.path.join(self.repo.path,
                                                  os.path.dirname(SERIES_FILE),
                                                  'added-bar.patch')))