← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~pappacena/launchpad:fix-publishing-history-msg into launchpad:master

 

Thiago F. Pappacena has proposed merging ~pappacena/launchpad:fix-publishing-history-msg into launchpad:master.

Commit message:
Refactoring package publishing history template to avoid misplaced messages.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/383030
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/launchpad:fix-publishing-history-msg into launchpad:master.
diff --git a/lib/lp/soyuz/stories/soyuz/xx-packagepublishinghistory.txt b/lib/lp/soyuz/stories/soyuz/xx-packagepublishinghistory.txt
index 0866dff..6fdba84 100644
--- a/lib/lp/soyuz/stories/soyuz/xx-packagepublishinghistory.txt
+++ b/lib/lp/soyuz/stories/soyuz/xx-packagepublishinghistory.txt
@@ -154,3 +154,30 @@ Links to bug reports are added for bugs mentioned in the removal comment.
 
     >>> print(anon_browser.getLink("bug 1").url)
     http://launchpad.test/bugs/1
+
+Checking how a copied binary publishing history looks like on the
+distro-arch-series-binarypackage page.
+
+    >>> login('foo.bar@xxxxxxxxxxxxx')
+    >>> from lp.soyuz.model.distroarchseriesbinarypackage import (
+    ...     DistroArchSeriesBinaryPackage)
+    >>> binary_pub = removeSecurityProxy(stp.getPubBinaries()[0])
+    >>> new_archive = stp.factory.makeArchive(
+    ...         distribution=(
+    ...             binary_pub.distroarchseries.distroseries.distribution))
+    >>> binary_copy = removeSecurityProxy(binary_pub.copyTo(
+    ...     binary_pub.distroarchseries.distroseries, binary_pub.pocket,
+    ...     new_archive)[0])
+    >>> page_obj = DistroArchSeriesBinaryPackage(
+    ...     binary_copy.distroarchseries,
+    ...     binary_copy.binarypackagename)
+    >>> url = canonical_url(page_obj)
+    >>> logout()
+
+    >>> anon_browser.open(url)
+    >>> table = find_tag_by_id(anon_browser.contents, 'publishing-summary')
+    >>> print(extract_text(table))
+        Date    Status    Target     Pocket   Component Section Priority Phased updates Version
+    ... UTC Pending   ubuntutest Breezy ... release  main  base Standard 666
+    Copied from ubuntutest breezy-autotest-release i386 in Primary Archive for Ubuntu Test
+
diff --git a/lib/lp/soyuz/templates/packagepublishing-details.pt b/lib/lp/soyuz/templates/packagepublishing-details.pt
index b6a9a42..8a0df4a 100644
--- a/lib/lp/soyuz/templates/packagepublishing-details.pt
+++ b/lib/lp/soyuz/templates/packagepublishing-details.pt
@@ -73,16 +73,9 @@
         </li>
 
         <li>
-          <span tal:condition="chained_copies">
-            Originally
-            <p tal:replace="python: 'uploaded to' if view.is_source
-                                    else 'built as'" />
-          </span>
-          <span tal:condition="not: chained_copies">
-            Copied from
-          </span>
-
           <tal:source_original_location condition="view/is_source">
+            <span tal:condition="chained_copies">Originally uploaded to</span>
+            <span tal:condition="not: chained_copies">Copied from</span>
             <tal:define
               define="linkify_archive view/linkify_source_archive;
                       source context/sourcepackagerelease">
@@ -101,6 +94,19 @@
             </tal:define>
           </tal:source_original_location>
 
+          <tal:binary_build_location condition="view/is_binary">
+            <span tal:condition="chained_copies">Originally built as</span>
+            <span tal:condition="not: chained_copies">Copied from</span>
+            <tal:message
+              define="build context/binarypackagerelease/build;
+                      pocket build/pocket;
+                      arch build/distro_arch_series;
+                      series arch/distroseries;
+                      distro series/distribution;
+                      message string:${distro/name} ${series/name}-${pocket/name/fmt:lower} ${arch/architecturetag} in ${upload_archive/displayname}"
+              replace="message" />
+          </tal:binary_build_location>
+
           <tal:comment condition="nothing">
               Only show "creator" if we didn't show above, at the
               previous copied_from_archive "li" tag.
@@ -113,18 +119,7 @@
               <tal:source_sponsor condition="python: view.is_source and context.sponsor">
                 (sponsored by <a tal:replace="structure context/sponsor/fmt:link"/>)
               </tal:source_sponsor>
-           </tal:source_creator_and_sponsor>
-
-          <tal:binary_build_location condition="view/is_binary">
-            <tal:message
-              define="build context/binarypackagerelease/build;
-                      pocket build/pocket;
-                      arch build/distro_arch_series;
-                      series arch/distroseries;
-                      distro series/distribution;
-                      message string:${distro/name} ${series/name}-${pocket/name/fmt:lower} ${arch/architecturetag} in ${upload_archive/displayname}"
-              replace="message" />
-          </tal:binary_build_location>
+          </tal:source_creator_and_sponsor>
         </li>
     </tal:copied>
   </ul>