Skip to content

Commit 7a4011a

Browse files
committed
Revert "Skip changeset discussions unless requested"
1 parent 24709f1 commit 7a4011a

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

src/backend/apidb/common_pgsql_selection.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ void extract_changesets(
458458
for (const auto &row : rows) {
459459
auto elem = extract_changeset(row, cc, changeset_cols);
460460
auto tags = extract_tags(row, tag_cols);
461-
auto comments = (include_changeset_discussions ? extract_comments(row, comments_cols) : comments_t{});
461+
auto comments = extract_comments(row, comments_cols);
462462
elem.comments_count = comments.size();
463463
formatter.write_changeset(
464464
elem, tags, include_changeset_discussions, comments, now);

src/backend/apidb/readonly_pgsql_selection.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,10 @@ void readonly_pgsql_selection::write_changesets(output_formatter &formatter,
362362
"to_char(cc.created_at,'YYYY-MM-DD\"T\"HH24:MI:SS\"Z\"') AS created_at "
363363
"FROM changeset_comments cc JOIN users u ON cc.author_id = u.id "
364364
"where cc.changeset_id=c.id AND cc.visible ORDER BY cc.created_at) x "
365-
")cc ON $2 "
365+
")cc ON true "
366366
"WHERE c.id = ANY($1)");
367367

368-
pqxx::result changesets = m.exec_prepared("extract_changesets", sel_changesets, include_changeset_discussions);
368+
pqxx::result changesets = m.exec_prepared("extract_changesets", sel_changesets);
369369

370370
fetch_changesets(sel_changesets, cc);
371371

test/test_apidb_backend_changesets.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ void check_changeset_with_comments_impl(
290290
REQUIRE(f.m_changesets.size() == 1);
291291

292292
comments_t comments;
293-
294-
if (include_discussion) {
293+
{
295294
changeset_comment_info comment;
296295
comment.id = 1;
297296
comment.author_id = 3;
@@ -312,7 +311,7 @@ void check_changeset_with_comments_impl(
312311
std::string("user_1"), // display_name
313312
{}, // bounding box
314313
0, // num_changes
315-
include_discussion ? 1 : 0 // comments_count
314+
1 // comments_count
316315
),
317316
tags_t(),
318317
include_discussion,

0 commit comments

Comments
 (0)