test_mbox_merge.py 826 B

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