Project

General

Profile

Patch #42135 » 0003-5.0-stable-Backport-r22826-r23421-and-r22809-from-trunk.patch

Katsuya HIDAKA, 2025-01-21 14:32

View differences:

app/models/issue_query.rb
520 520
  def sql_for_watcher_id_field(field, operator, value)
521 521
    db_table = Watcher.table_name
522 522
    me_ids = [0, User.current.id]
523
    me_ids = me_ids.concat(User.current.groups.pluck(:id))
523
    me_ids.concat(User.current.groups.pluck(:id))
524 524
    me, others = value.partition {|id| me_ids.include?(id.to_i)}
525 525
    sql =
526 526
      if others.any?
test/unit/query_test.rb
1054 1054
    result = query.results_scope
1055 1055

  
1056 1056
    bookmarks = User.current.bookmarked_project_ids
1057
    assert_equal Project.where(parent_id: bookmarks).ids, result.map(&:id).sort
1057
    assert_equal Project.where(parent_id: bookmarks).ids.sort, result.map(&:id).sort
1058 1058
  end
1059 1059

  
1060 1060
  def test_filter_watched_issues_by_user
test/unit/repository_bazaar_test.rb
165 165
    end
166 166

  
167 167
    if File.directory?(REPOSITORY_PATH_NON_ASCII) && RUN_LATIN1_OUTPUT_TEST
168
      # https://www.redmine.org/issues/42024
169
      def skip_bzr_failure_on_ubuntu24
170
        return unless File.exist?('/etc/os-release')
171

  
172
        os_release = File.read('/etc/os-release')
173
        name = os_release[/^NAME="(.+?)"$/, 1]
174
        version = os_release[/^VERSION_ID="(.+?)"$/, 1]
175

  
176
        if name == 'Ubuntu' && version == '24.04'
177
          skip 'bzr command fails on Ubuntu 24.04, causing this test to fail'
178
        end
179
      end
180

  
168 181
      def test_cat_latin1_path
182
        skip_bzr_failure_on_ubuntu24
183

  
169 184
        latin1_repo = create_latin1_repo
170 185
        buf =
171 186
          latin1_repo.cat(
......
186 201
      end
187 202

  
188 203
      def test_annotate_latin1_path
204
        skip_bzr_failure_on_ubuntu24
205

  
189 206
        latin1_repo = create_latin1_repo
190 207
        ann1 =
191 208
          latin1_repo.annotate(
......
206 223
      end
207 224

  
208 225
      def test_diff_latin1_path
226
        skip_bzr_failure_on_ubuntu24
227

  
209 228
        latin1_repo = create_latin1_repo
210 229
        diff1 =
211 230
          latin1_repo.diff(
......
217 236
      end
218 237

  
219 238
      def test_entries_latin1_path
239
        skip_bzr_failure_on_ubuntu24
240

  
220 241
        latin1_repo = create_latin1_repo
221 242
        entries = latin1_repo.entries("test-#{CHAR_1_UTF8_HEX}-dir", 2)
222 243
        assert_kind_of Redmine::Scm::Adapters::Entries, entries
......
227 248
      end
228 249

  
229 250
      def test_entry_latin1_path
251
        skip_bzr_failure_on_ubuntu24
252

  
230 253
        latin1_repo = create_latin1_repo
231 254
        ["test-#{CHAR_1_UTF8_HEX}-dir",
232 255
         "/test-#{CHAR_1_UTF8_HEX}-dir",
......
245 268
      end
246 269

  
247 270
      def test_changeset_latin1_path
271
        skip_bzr_failure_on_ubuntu24
272

  
248 273
        latin1_repo = create_latin1_repo
249 274
        assert_equal 0, latin1_repo.changesets.count
250 275
        latin1_repo.fetch_changesets
(6-6/8)