Uploaded image for project: 'Maven SCM'
  1. Maven SCM
  2. SCM-679

enhance scm api to support limited number of returned changesets by changelog command

    XMLWordPrintableJSON

Details

    • Patch

    Description

      The current api returns changesets between specified/unspecified dates/revisions.
      This leaves some important usecases unsupported; some of them are:

      • get last changeset on given repository/path
      • get last n changesets there ("first page" when browsing changes)

      The only workarround currently possible is, list all commits and filter them - but this is very time consuming.
      For this reason, I propose attached enhancement which overloads the changeLog method, adding the limit parameter:

          ChangeLogScmResult changeLog( ScmRepository repository, ScmFileSet fileSet, Date startDate, Date endDate,
                                        int numDays, ScmBranch branch, String datePattern, Integer limit )
              throws ScmException;
      

      For the "last changeset" usecase, the client sets limit = 1.

      For "paged browsing", it can specify null startDate/endDate on firstPage, and then work with dates for next/previous pages, still using the limit to specify page size.

      Note that the limit parameter can be null (as it is "Integer", not "int") to specify unlimited number of returned changesets.

      The suggested patch includes deprecations of enhanced methods, I hope this is a good way to reduce the number of actively used overloaded variants of "changelog" in future.

      Attachments

        1. scm-changelog-limit-wrapped.patch
          51 kB
          Petr Kozelka
        2. scm-changelog-limit.patch
          33 kB
          Petr Kozelka

        Activity

          People

            olamy Olivier Lamy
            pkozelka Petr Kozelka
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: