Andrew Geissler | 220dafd | 2023-10-04 10:18:08 -0500 | [diff] [blame^] | 1 | # Check if mbox was merged by patchtest |
| 2 | # |
| 3 | # Copyright (C) 2016 Intel Corporation |
| 4 | # |
| 5 | # SPDX-License-Identifier: GPL-2.0 |
| 6 | |
| 7 | import subprocess |
| 8 | import base |
| 9 | from data import PatchTestInput |
| 10 | |
| 11 | def headlog(): |
| 12 | output = subprocess.check_output( |
| 13 | "cd %s; git log --pretty='%%h#%%aN#%%cD:#%%s' -1" % PatchTestInput.repodir, |
| 14 | universal_newlines=True, |
| 15 | shell=True |
| 16 | ) |
| 17 | return output.split('#') |
| 18 | |
| 19 | class Merge(base.Base): |
| 20 | def test_series_merge_on_head(self): |
| 21 | if not PatchTestInput.repo.ismerged: |
| 22 | commithash, author, date, shortlog = headlog() |
| 23 | self.fail('Series does not apply on top of target branch', |
| 24 | 'Rebase your series on top of targeted branch', |
| 25 | data=[('Targeted branch', '%s (currently at %s)' % (PatchTestInput.repo.branch, commithash))]) |