@@ -1,5 +1,5 @@
11#!/usr/bin/python
2−# Copyright 2013 Canonical Ltd.
2+# Copyright 2013, 2014 Canonical Ltd.
33#
44# This program is free software; you can redistribute it and/or modify
55# it under the terms of the GNU Lesser General Public License as published by
@@ -13,11 +13,15 @@
1313# You should have received a copy of the GNU Lesser General Public License
1414# along with this program. If not, see <http://www.gnu.org/licenses/>.
1515
16−import os, subprocess
17−from bzrlib import branch, errors
18−from bzrlib.urlutils import dirname, local_path_from_url
16+import os
17+import subprocess
18+from bzrlib import branch
19+from bzrlib.urlutils import local_path_from_url
1920
20−def execute_makecheck(local_branch, master_branch, old_revision_number, old_revision_id, future_revision_number, future_revision_id, tree_delta, future_tree):
21+
22+def execute_makecheck(
23+ local_branch, master_branch, old_revision_number, old_revision_id,
24+ future_revision_number, future_revision_id, tree_delta, future_tree):
2125 if not master_branch.basis_tree().has_filename("qml/Shell.qml"):
2226 return
2327
@@ -27,7 +31,9 @@ def execute_makecheck(local_branch, master_branch, old_revision_number, old_revi
2731 os.environ['CTEST_OUTPUT_ON_FAILURE'] = "1"
2832 if (subprocess.call("make -C builddir test", shell=True) != 0):
2933
30− print("\n\n*** Warning ***\n\nBasic tests failed. This commit will not pass continuous integration.")
34+ print("\n\n*** Warning ***\n\n"
35+ "Basic tests failed. This commit will not pass continuous "
36+ "integration.")
3137
3238 branch = local_branch or master_branch
3339 revision = branch.repository.get_revision(future_revision_id)
@@ -36,8 +42,10 @@ def execute_makecheck(local_branch, master_branch, old_revision_number, old_revi
3642 msg_file.close()
3743
3844 print("\n\nSaved commit message to $SRC_DIR/message.txt.")
39− print("You can uncommit this revision, fix the tests and reuse your message running:\n\nbzr commit -F message.txt\n\n")
45+ print("You can uncommit this revision, fix the tests and reuse your "
46+ "message running:\n\nbzr commit -F message.txt\n\n")
4047 elif os.path.isfile("message.txt"):
4148 os.remove("message.txt")
4249
43−branch.Branch.hooks.install_named_hook('pre_commit', execute_makecheck, 'make check pre-commit')
50+branch.Branch.hooks.install_named_hook(
51+ 'pre_commit', execute_makecheck, 'make check pre-commit')