[dak/master] Do not break manual rejects when a note exists
Signed-off-by: Joerg Jaspert <joerg@debian.org>
---
dak/process_new.py | 2 +-
daklib/queue.py | 9 +++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dak/process_new.py b/dak/process_new.py
index 7841a7d..060fa23 100755
--- a/dak/process_new.py
+++ b/dak/process_new.py
@@ -679,7 +679,7 @@ def do_new(upload, session):
elif answer == 'M' and not Options["Trainee"]:
aborted = upload.do_reject(manual=1,
reject_message=Options["Manual-Reject"],
- note=get_new_comments(changes.get("source", ""), session=session))
+ notes=get_new_comments(changes.get("source", ""), session=session))
if not aborted:
upload.pkg.remove_known_changes(session=session)
session.commit()
diff --git a/daklib/queue.py b/daklib/queue.py
index c9a6532..5ea545f 100755
--- a/daklib/queue.py
+++ b/daklib/queue.py
@@ -2061,7 +2061,7 @@ distribution."""
os.close(dest_fd)
###########################################################################
- def do_reject (self, manual=0, reject_message="", note=""):
+ def do_reject (self, manual=0, reject_message="", notes=""):
"""
Reject an upload. If called without a reject message or C{manual} is
true, spawn an editor so the user can write one.
@@ -2080,9 +2080,10 @@ distribution."""
if manual and not reject_message:
(fd, temp_filename) = utils.temp_filename()
temp_file = os.fdopen(fd, 'w')
- if len(note) > 0:
- for line in note:
- temp_file.write(line)
+ if len(notes) > 0:
+ for note in notes:
+ temp_file.write("\nAuthor: %s\nVersion: %s\nTimestamp: %s\n\n%s" \
+ % (note.author, note.version, note.notedate, note.comment))
temp_file.close()
editor = os.environ.get("EDITOR","vi")
answer = 'E'
--
1.6.3.3
Reply to: