Merge lp://staging/~mwhudson/loggerhead/which-mainline-merged into lp://staging/loggerhead

Proposed by Michael Hudson-Doyle
Status: Merged
Merged at revision: not available
Proposed branch: lp://staging/~mwhudson/loggerhead/which-mainline-merged
Merge into: lp://staging/loggerhead
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~mwhudson/loggerhead/which-mainline-merged
Reviewer Review Type Date Requested Status
Martin Albisetti Approve
Review via email: mp+5963@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Hi there,

This branch adds to the revision page of non-mainline revisions the revno of the mainline revision that merged it.

Cheers,
mwh

Revision history for this message
Martin Albisetti (beuno) wrote :

Hi Michael,

Thanks for throwing this together so quickly :)

The only comment I have, is that I think that this:

> + if '.' in change.revid:

should read:

> + if '.' in change.revno:

no?

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loggerhead/controllers/revision_ui.py'
2--- loggerhead/controllers/revision_ui.py 2009-03-19 19:04:40 +0000
3+++ loggerhead/controllers/revision_ui.py 2009-04-28 03:01:54 +0000
4@@ -95,6 +95,15 @@
5
6 h.add_branch_nicks(change)
7
8+ if '.' in change.revid:
9+ ri = self._history._rev_info
10+ i = self._history._rev_indices[change.revid]
11+ while ri[i][0][2] > 0:
12+ i += 1
13+ merged_in = ri[i][0][3]
14+ else:
15+ merged_in = None
16+
17 # Directory Breadcrumbs
18 directory_breadcrumbs = (
19 util.directory_breadcrumbs(
20@@ -116,6 +125,7 @@
21 'filter_file_id': filter_file_id,
22 'util': util,
23 'history': h,
24+ 'merged_in': merged_in,
25 'navigation': navigation,
26 'query': query,
27 'remember': remember,
28
29=== modified file 'loggerhead/templatefunctions.py'
30--- loggerhead/templatefunctions.py 2009-03-19 00:18:46 +0000
31+++ loggerhead/templatefunctions.py 2009-04-28 03:01:54 +0000
32@@ -57,12 +57,12 @@
33
34
35 @templatefunc
36-def revisioninfo(url, branch, entry, file_changes=None, currently_showing=None):
37+def revisioninfo(url, branch, entry, file_changes=None, currently_showing=None, merged_in=None):
38 from loggerhead import util
39 return _pt('revisioninfo').expand(
40 url=url, change=entry, branch=branch, util=util,
41 file_changes=file_changes, currently_showing=currently_showing,
42- **templatefunctions)
43+ merged_in=merged_in, **templatefunctions)
44
45
46 @templatefunc
47
48=== modified file 'loggerhead/templates/revision.pt'
49--- loggerhead/templates/revision.pt 2009-03-31 21:15:48 +0000
50+++ loggerhead/templates/revision.pt 2009-04-28 03:01:54 +0000
51@@ -96,7 +96,7 @@
52 </ul>
53 </tal:we-are-comparing>
54
55- <tal:revision-info replace="structure python:revisioninfo(url, branch, change, file_changes, specific_path)" />
56+ <tal:revision-info replace="structure python:revisioninfo(url, branch, change, file_changes, specific_path, merged_in)" />
57 <tal:specific-path condition="not:specific_path">
58 <p class="expand show_if_js" id="expand_all"><a href="#">
59 <img tal:attributes="src python:branch.static_url('/static/images/treeCollapsed.png')"
60
61=== modified file 'loggerhead/templates/revisioninfo.pt'
62--- loggerhead/templates/revisioninfo.pt 2009-03-19 00:18:46 +0000
63+++ loggerhead/templates/revisioninfo.pt 2009-04-28 03:01:54 +0000
64@@ -12,6 +12,11 @@
65 href python:url(['/revision', merge_point.revno], clear=1)"
66 tal:content="python:revno_with_nick(merge_point)"></a>
67 </div>
68+ <div class="mto" tal:condition="merged_in">
69+ This revision was merged to the branch mainline in
70+ <a tal:attributes="href python:url(['/revision', merged_in], clear=1)">revision
71+ <tal:b content="merged_in"/></a>.
72+ </div>
73 <div class="revid" tal:content="string:Revision ID: ${change/revid}"></div>
74 <div class="information" tal:content="structure python:util.fixed_width(change.comment)"></div>
75 </div>

Subscribers

People subscribed via source and target branches