Merge lp:~cjohnston/launchpad/640882 into lp:launchpad

Proposed by Chris Johnston
Status: Merged
Merged at revision: 17022
Proposed branch: lp:~cjohnston/launchpad/640882
Merge into: lp:launchpad
Diff against target: 78 lines (+10/-9)
3 files modified
lib/lp/code/model/branchmergeproposaljob.py (+5/-6)
lib/lp/code/model/tests/test_branchmergeproposaljobs.py (+3/-1)
lib/lp/soyuz/model/initializedistroseriesjob.py (+2/-2)
To merge this branch: bzr merge lp:~cjohnston/launchpad/640882
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+221213@code.launchpad.net

Commit message

Add link to MP when sending out diff error emails

Description of the change

Add link to MP when sending out diff error emails

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/code/model/branchmergeproposaljob.py'
2--- lib/lp/code/model/branchmergeproposaljob.py 2013-08-07 04:55:57 +0000
3+++ lib/lp/code/model/branchmergeproposaljob.py 2014-05-28 14:48:38 +0000
4@@ -21,7 +21,6 @@
5 'UpdatePreviewDiffJob',
6 ]
7
8-import contextlib
9 from datetime import (
10 datetime,
11 timedelta,
12@@ -101,8 +100,7 @@
13 BaseRunnableJobSource,
14 )
15 from lp.services.mail.sendmail import format_address_for_person
16-from lp.services.webapp import errorlog
17-
18+from lp.services.webapp import canonical_url
19
20 class BranchMergeProposalJobType(DBEnumeratedType):
21 """Values that ICodeImportJob.state can take."""
22@@ -351,15 +349,16 @@
23 def checkReady(self):
24 """Is this job ready to run?"""
25 bmp = self.branch_merge_proposal
26+ url = canonical_url(bmp)
27 if bmp.source_branch.last_scanned_id is None:
28 raise UpdatePreviewDiffNotReady(
29- 'The source branch has no revisions.')
30+ 'The source branch of %s has no revisions.' % url)
31 if bmp.target_branch.last_scanned_id is None:
32 raise UpdatePreviewDiffNotReady(
33- 'The target branch has no revisions.')
34+ 'The target branch of %s has no revisions.' % url)
35 if bmp.source_branch.pending_writes:
36 raise BranchHasPendingWrites(
37- 'The source branch has pending writes.')
38+ 'The source branch of %s has pending writes.' % url)
39
40 def acquireLease(self, duration=600):
41 return self.job.acquireLease(duration)
42
43=== modified file 'lib/lp/code/model/tests/test_branchmergeproposaljobs.py'
44--- lib/lp/code/model/tests/test_branchmergeproposaljobs.py 2013-08-07 04:55:57 +0000
45+++ lib/lp/code/model/tests/test_branchmergeproposaljobs.py 2014-05-28 14:48:38 +0000
46@@ -260,7 +260,9 @@
47 self.assertEqual(
48 'Launchpad encountered an error during the following operation: '
49 'generating the diff for a merge proposal. '
50- 'The source branch has no revisions.',
51+ 'The source branch of http://code.launchpad.dev/~person-name-'
52+ '100011/product-name-100002/branch-100009/+merge/1 has no '
53+ 'revisions.',
54 email.get_payload(decode=True))
55
56 def test_run_branches_pending_writes(self):
57
58=== modified file 'lib/lp/soyuz/model/initializedistroseriesjob.py'
59--- lib/lp/soyuz/model/initializedistroseriesjob.py 2013-07-04 08:32:03 +0000
60+++ lib/lp/soyuz/model/initializedistroseriesjob.py 2014-05-28 14:48:38 +0000
61@@ -141,7 +141,7 @@
62 parts += ",".join(parents)
63 pkgsets = [
64 IStore(Packageset).get(Packageset, int(pkgsetid)).name
65- for pkgsetid in self.packagesets]
66+ for pkgsetid in self.packagesets]
67 parts += ", architectures: %s" % (self.arches,)
68 parts += ", archindep_archtag: %s" % self.archindep_archtag
69 parts += ", packagesets: %s" % pkgsets
70@@ -209,7 +209,7 @@
71 ids.initialize()
72
73 def notifyUserError(self, error):
74- """Calls up and slso saves the error text in this job's metadata.
75+ """Calls up and also saves the error text in this job's metadata.
76
77 See `BaseRunnableJob`.
78 """