submittodebian: if patch is relatively small (shorter than fifty

lines), display it inline instead of attaching to the report.
This commit is contained in:
Luca Falavigna 2009-12-18 21:33:37 +01:00
parent 3dc0985b0f
commit 47abdefae9
2 changed files with 15 additions and 2 deletions

7
debian/changelog vendored
View File

@ -1,9 +1,14 @@
ubuntu-dev-tools (0.86) UNRELEASED; urgency=low
[ Emmet Hikory ]
* mk-sbuild-lv: Add richer support for ports architectures in Ubuntu
* mk-sbuild-lv: Really use -security for SOURCES_SECURITY_SUITE in Ubuntu
-- Emmet Hikory <persia@ubuntu.com> Tue, 15 Dec 2009 09:57:20 +0900
[ Kumar Appaiah ]
* submittodebian: if patch is relatively small (shorter than fifty
lines), display it inline instead of attaching to the report.
-- Kumar Appaiah <akumar@debian.org> Fri, 18 Dec 2009 21:30:30 +0100
ubuntu-dev-tools (0.85) lucid; urgency=low

View File

@ -93,7 +93,15 @@ def edit_debdiff(debdiff):
run_cmd(cmd)
def submit_bugreport(body, debdiff, changelog):
cmd = 'reportbug -P "User: ubuntu-devel@lists.ubuntu.com" -P "Usertags: origin-ubuntu lucid ubuntu-patch" -T patch -A %s -B debian -i %s -V %s %s' % (debdiff, body, deb_version, changelog.package)
# Count the number of lines in the patch
debdiff_file = open(debdiff, 'r')
n_lines = len(debdiff_file.readlines())
debdiff_file.close()
# If the patch is smaller than 51 lines, we include it inline, attach it otherwise.
inclusion_method = '--include' if n_lines < 51 else '-A'
cmd = 'reportbug -P "User: ubuntu-devel@lists.ubuntu.com" -P "Usertags: origin-ubuntu lucid ubuntu-patch" -T patch %s %s -B debian -i %s -V %s %s' % (inclusion_method, debdiff, body, deb_version, changelog.package)
run_cmd(cmd)
def run_cmd(cmd):