summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/patch.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/patch.py')
-rw-r--r--meta/lib/oe/patch.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 58c6e34fe8..edd77196ee 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -462,21 +462,23 @@ class GitApplyTree(PatchTree):
462 return (tmpfile, cmd) 462 return (tmpfile, cmd)
463 463
464 @staticmethod 464 @staticmethod
465 def addNote(repo, ref, key, value=None): 465 def addNote(repo, ref, key, value=None, commituser=None, commitemail=None):
466 note = key + (": %s" % value if value else "") 466 note = key + (": %s" % value if value else "")
467 notes_ref = GitApplyTree.notes_ref 467 notes_ref = GitApplyTree.notes_ref
468 runcmd(["git", "config", "notes.rewriteMode", "ignore"], repo) 468 runcmd(["git", "config", "notes.rewriteMode", "ignore"], repo)
469 runcmd(["git", "config", "notes.displayRef", notes_ref, notes_ref], repo) 469 runcmd(["git", "config", "notes.displayRef", notes_ref, notes_ref], repo)
470 runcmd(["git", "config", "notes.rewriteRef", notes_ref, notes_ref], repo) 470 runcmd(["git", "config", "notes.rewriteRef", notes_ref, notes_ref], repo)
471 runcmd(["git", "notes", "--ref", notes_ref, "append", "-m", note, ref], repo) 471 cmd = ["git"]
472 GitApplyTree.gitCommandUserOptions(cmd, commituser, commitemail)
473 runcmd(cmd + ["notes", "--ref", notes_ref, "append", "-m", note, ref], repo)
472 474
473 @staticmethod 475 @staticmethod
474 def removeNote(repo, ref, key): 476 def removeNote(repo, ref, key, commituser=None, commitemail=None):
475 notes = GitApplyTree.getNotes(repo, ref) 477 notes = GitApplyTree.getNotes(repo, ref)
476 notes = {k: v for k, v in notes.items() if k != key and not k.startswith(key + ":")} 478 notes = {k: v for k, v in notes.items() if k != key and not k.startswith(key + ":")}
477 runcmd(["git", "notes", "--ref", GitApplyTree.notes_ref, "remove", "--ignore-missing", ref], repo) 479 runcmd(["git", "notes", "--ref", GitApplyTree.notes_ref, "remove", "--ignore-missing", ref], repo)
478 for note, value in notes.items(): 480 for note, value in notes.items():
479 GitApplyTree.addNote(repo, ref, note, value) 481 GitApplyTree.addNote(repo, ref, note, value, commituser, commitemail)
480 482
481 @staticmethod 483 @staticmethod
482 def getNotes(repo, ref): 484 def getNotes(repo, ref):
@@ -507,7 +509,7 @@ class GitApplyTree(PatchTree):
507 GitApplyTree.gitCommandUserOptions(cmd, d=d) 509 GitApplyTree.gitCommandUserOptions(cmd, d=d)
508 cmd += ["commit", "-m", subject, "--no-verify"] 510 cmd += ["commit", "-m", subject, "--no-verify"]
509 runcmd(cmd, dir) 511 runcmd(cmd, dir)
510 GitApplyTree.addNote(dir, "HEAD", GitApplyTree.ignore_commit) 512 GitApplyTree.addNote(dir, "HEAD", GitApplyTree.ignore_commit, d.getVar('PATCH_GIT_USER_NAME'), d.getVar('PATCH_GIT_USER_EMAIL'))
511 513
512 @staticmethod 514 @staticmethod
513 def extractPatches(tree, startcommits, outdir, paths=None): 515 def extractPatches(tree, startcommits, outdir, paths=None):
@@ -654,7 +656,7 @@ class GitApplyTree(PatchTree):
654 raise 656 raise
655 finally: 657 finally:
656 if patch_applied: 658 if patch_applied:
657 GitApplyTree.addNote(self.dir, "HEAD", GitApplyTree.original_patch, os.path.basename(patch['file'])) 659 GitApplyTree.addNote(self.dir, "HEAD", GitApplyTree.original_patch, os.path.basename(patch['file']), self.commituser, self.commitemail)
658 660
659 661
660class QuiltTree(PatchSet): 662class QuiltTree(PatchSet):