Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newsfeeds should observe branch parameter #49

Closed
dlangille opened this issue Aug 27, 2017 · 1 comment
Closed

newsfeeds should observe branch parameter #49

dlangille opened this issue Aug 27, 2017 · 1 comment

Comments

@dlangille
Copy link
Contributor

dlangille commented Aug 27, 2017

see https://www.freshports.org/phorum/read.php?f=1&i=1492&t=1492

@dlangille
Copy link
Contributor Author

Here's the diff to get http://dev.freshports.org/backend working on HEAD only

[dan@webserver:/usr/local/www/freshports.org/classes] $ git diff newsfeed.php
diff --git a/classes/newsfeed.php b/classes/newsfeed.php
index ef03555b..10bfeed6 100644
--- a/classes/newsfeed.php
+++ b/classes/newsfeed.php
@@ -32,7 +32,7 @@
        require_once($_SERVER['DOCUMENT_ROOT'] . '/../feedcreator/lib/Creator/RSSCreator20.php'); 
        require_once($_SERVER['DOCUMENT_ROOT'] . '/../feedcreator/lib/UniversalFeedCreator.php'); 
        
-function newsfeed($db, $Format, $WatchListID = 0) {
+function newsfeed($db, $Format, $WatchListID = 0, $Branch = BRANCH_HEAD) {
 
        $WatchListID = pg_escape_string($WatchListID);
        $Format      = pg_escape_string($Format);
@@ -160,9 +160,10 @@ FROM (
            to_char(commit_log.commit_date - SystemTimeAdjust(), 'HH24:MI') AS commit_time,
            encoding_losses
      FROM commit_log JOIN
-               (SELECT latest_commits_ports.commit_log_id
-                   FROM latest_commits_ports
-               ORDER BY latest_commits_ports.commit_date DESC
+               (SELECT LCP.commit_log_id
+                  FROM latest_commits_ports LCP JOIN commit_log_branches CLB ON LCP.commit_log_id = CLB.commit_log_id
+                                     JOIN system_branch SB ON SB.branch_name = '$Branch' AND SB.id = CLB.branch_id
+              ORDER BY LCP.commit_date DESC
                  LIMIT $MaxNumberOfPorts) AS LCP
            ON commit_log.id = LCP.commit_log_id) AS LCPCL JOIN commit_log_ports
                          ON commit_log_ports.commit_log_id = LCPCL.commit_log_id
[dan@webserver:/usr/local/www/freshports.org/classes] $ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant