ExportXMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major
    • Component/s: p4-plugin
    • None
    • Environment:
      Jenkins 2.568.2; p4-plugin master @ 61aefe1f

      With a Path filter configured, the build's "Changes" page lists the same changelist many times. The number of entries equals the number of files of that changelist that lie outside the filter path.

      Cause: PerforceScm.applyPathFilters() (added in #249, commit 3a854ac6) loops over the affected files of each change and calls remainder.add(c) once for every file that does not start with the filter path. The change itself is never de-duplicated:

       

       

      for (P4ChangeEntry c : entries) {
          for (P4AffectedFile affectedFile : c.getAffectedFiles()) {
              if (!affectedFile.getPath().startsWith(filterPath)) {
                  remainder.add(c);
              }
          }
      }
      

       

      Observed: with a path filter of //navigation/jenkins, a changelist with 203 files, none of them under that path, is listed 203 times in the changelog of the build. A changelist with 201 files is listed 201 times; a changelist with 1 file is listed once. All entries are the same change.

       

      Related: a change is kept if any one of its files is outside the filter path, and if the result is empty the unfiltered list is returned. The intended semantics of the filter should be clarified. The existing test (CheckoutTest) does not cover a multi-file change.

       

      Expected: each change is listed at most once.

            Assignee:
            Unassigned
            Reporter:
            Heiko Nardmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: