[sysadmin-bin] More fixes
- From: Bartłomiej Piotrowski <bpiotrowski src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] More fixes
- Date: Wed, 29 Jul 2020 13:20:38 +0000 (UTC)
commit f80a0f1e5129d377a326f12e55b13ab23dc4202c
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date: Wed Jul 29 15:20:17 2020 +0200
More fixes
git/gnome-post-receive-email | 19 ++++++++++---------
git/util.py | 1 +
2 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/git/gnome-post-receive-email b/git/gnome-post-receive-email
index a2365df..cc31447 100755
--- a/git/gnome-post-receive-email
+++ b/git/gnome-post-receive-email
@@ -134,7 +134,7 @@ class RefChange(object):
def generate_header(self, out, subject, include_revs=True, oldrev=None, newrev=None, cc=None):
if user_fullname:
- from_address = "%s <%s src gnome org>" % (Header(user_fullname.decode('utf-8')), user_entry)
+ from_address = "%s <%s src gnome org>" % (Header(user_fullname.decode("utf-8")), user_entry)
else:
if socket.gethostname() == 'gitlab.gnome.org':
from_address = "%s <%s>" % (Header(gitlab_name), gitlab_email)
@@ -149,8 +149,7 @@ class RefChange(object):
else:
subject = Header(subject.decode('utf-8'))
- mail = s("""
-To: %(recipients)s
+ mail = """To: %(recipients)s
Cc: %(cc)s
From: %(from_address)s
Subject: %(subject)s
@@ -159,7 +158,7 @@ X-Git-Refname: %(refname)s
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
-""") % {
+""" % {
'recipients': recipients,
'cc': ','.join(cc),
'from_address': from_address,
@@ -167,9 +166,6 @@ Content-Transfer-Encoding: 8bit
'projectshort': projectshort,
'refname': self.refname}
- print(mail, file=out)
- out.flush()
-
if include_revs:
if oldrev:
oldrev = oldrev
@@ -180,13 +176,18 @@ Content-Transfer-Encoding: 8bit
else:
newrev = NULL_REVISION
- print(s("""
+
+
+ git_headers = s("""
X-Git-Oldrev: %(oldrev)s
X-Git-Newrev: %(newrev)s
""") % {
'oldrev': oldrev,
'newrev': newrev,
- }, file=out)
+ }
+ mail = mail + git_headers
+
+ print(mail, file=out)
out.flush()
# Trailing newline to signal the end of the header
diff --git a/git/util.py b/git/util.py
index f0458dc..0906b45 100644
--- a/git/util.py
+++ b/git/util.py
@@ -74,3 +74,4 @@ def end_email():
email_file.flush()
_do_send_email(email_file.name)
email_file.close()
+ email_file = None
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]