blob: c8b6718d152c349c71beac281c1b8166e675e811 [file] [log] [blame]
Andrew Geissler220dafd2023-10-04 10:18:08 -05001# Check if mbox was merged by patchtest
2#
3# Copyright (C) 2016 Intel Corporation
4#
5# SPDX-License-Identifier: GPL-2.0
6
7import subprocess
8import base
9from data import PatchTestInput
10
11def 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
19class 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))])