Maven SCM
  1. Maven SCM
  2. SCM-649

Enhance SCM changelog model to hold more data about changes

    Details

    • Flags:
      Patch

      Description

      Hello,

      I would like to get more information from SCM changelog command, and attached patches contain my proposal doing some part of this.
      There are separate patches for model and for GIT and SVN implementations, I hope it makes them easier to review.
      New functionality is mostly covered with tests.

      Summary of proposed enhancements:

      ChangeFile.java:

      • added: ScmFileStatus action
      • added: String originalName
      • added: String originalRevision
      • they all included in toString()

      ScmFileStatus.java:

      • added: RENAMED = new ScmFileStatus( "renamed" );
      • added: COPIED = new ScmFileStatus( "copied" );

      ChangeSet.java:

      • added: String parentRevision
      • added: Set<String> mergedRevisions
      • both added to toString()
      • both added to toXML() + those from ChangeFile - all values stored in elements not attributes just like the others

      GIT implementation notes (GitChangeLogConsumer):

      • besides parsing the "whatchanged" command, now the consumer can handle also many options of the "log" command and harvest most of its provided info.
        In particular, the output of "git log --format=raw -C --raw --no-abbrev" can be parsed.
      • there is a potential to simply enable parsing for some more information like committer, committerDate and treeHash, which I didn't yet (as GIT-only stuff it may require separate discussion)

      SVN implementation notes (SvnChangeLogConsumer):

      • svn action "A" (Add) translates to "added" or "copied" depending of presence of originalFile
      • svn action "M" (Modified) always translates to "modified" no matter if there is an originalFile; any opinions about this ?
      • svn action "R" (Replace) translates to "updated" which IMHO has sufficiently close semantic
      1. scm-richmodel-model.patch
        9 kB
        Petr Kozelka
      2. scm-richmodel-svn.patch
        7 kB
        Petr Kozelka
      3. scm-richmodel-git.patch
        13 kB
        Petr Kozelka
      4. scm-richmodel-bazaar.patch
        5 kB
        Petr Kozelka

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Closed Closed
        7d 20h 24m 1 Olivier Lamy (*$^¨%`£) 07/Dec/11 15:09
        Closed Closed Reopened Reopened
        2d 6h 9m 1 Petr Kozelka 09/Dec/11 21:19
        Reopened Reopened Closed Closed
        18h 3m 1 Olivier Lamy (*$^¨%`£) 10/Dec/11 15:23
        Mark Thomas made changes -
        Workflow jira [ 12962945 ] Default workflow, editable Closed status [ 12999308 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 01:08:37 UTC 2015 [ 1428282517778 ]
        Mark Thomas made changes -
        Patch Submitted Yes [ 10763 ]
        Flags Patch [ 10430 ]
        Mark Thomas made changes -
        Workflow jira [ 12725652 ] Default workflow, editable Closed status [ 12757759 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 12:22:36 UTC 2015 [ 1428236556206 ]
        Olivier Lamy (*$^¨%`£) made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        bazaar in r1212880
        Thanks

        Show
        Olivier Lamy (*$^¨%`£) added a comment - bazaar in r1212880 Thanks
        Olivier Lamy (*$^¨%`£) made changes -
        Component/s maven-scm-provider-bazaar [ 12060 ]
        Hide
        Petr Kozelka added a comment -

        ... cannot add bazaar component to Jira issue, so I guess next time it's better to make a new one with link here

        Show
        Petr Kozelka added a comment - ... cannot add bazaar component to Jira issue, so I guess next time it's better to make a new one with link here
        Petr Kozelka made changes -
        Attachment scm-richmodel-bazaar.patch [ 58119 ]
        Hide
        Petr Kozelka added a comment -

        Attaching the bazaar patch.

        Show
        Petr Kozelka added a comment - Attaching the bazaar patch.
        Petr Kozelka made changes -
        Status Closed [ 6 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Hide
        Petr Kozelka added a comment -

        I just implemented simple support of this feature for Bazaar SCM so I hope it's ok to reopen the existing issue.
        Please let me know if subtasks or any other way is preferred.

        Bazaar implementation notes:

        • action "renamed" is supported; this stores originalFile but not originalRevision because there is no such information in the log
        • I manually enhanced the changeLogWithMerge.txt file to contain "renamed" section (taken from my sample bzr repo), which is then checked in test
        Show
        Petr Kozelka added a comment - I just implemented simple support of this feature for Bazaar SCM so I hope it's ok to reopen the existing issue. Please let me know if subtasks or any other way is preferred. Bazaar implementation notes: action "renamed" is supported; this stores originalFile but not originalRevision because there is no such information in the log I manually enhanced the changeLogWithMerge.txt file to contain "renamed" section (taken from my sample bzr repo) , which is then checked in test
        Olivier Lamy (*$^¨%`£) made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        fixed revs r1211633,r1211634 and r1211635
        Thanks!

        Show
        Olivier Lamy (*$^¨%`£) added a comment - fixed revs r1211633,r1211634 and r1211635 Thanks!
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        @Petr: Yup I have seen
        Regarding " svn action "M" (Modified) always translates to "modified" no matter if there is an originalFile ": ok for me.
        I will work on submit your patch.

        Show
        Olivier Lamy (*$^¨%`£) added a comment - @Petr: Yup I have seen Regarding " svn action "M" (Modified) always translates to "modified" no matter if there is an originalFile ": ok for me. I will work on submit your patch.
        Hide
        Petr Kozelka added a comment -

        Hi Olivier,
        done, ack forwarded to your @apache mail

        Show
        Petr Kozelka added a comment - Hi Olivier, done, ack forwarded to your @apache mail
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        very nice patch!
        As a huge peace of code, could you send a cla to ASF ?
        See http://www.apache.org/licenses/ section "Contributor License Agreements".
        Let me know when it's done.

        Show
        Olivier Lamy (*$^¨%`£) added a comment - very nice patch! As a huge peace of code, could you send a cla to ASF ? See http://www.apache.org/licenses/ section "Contributor License Agreements". Let me know when it's done.
        Olivier Lamy (*$^¨%`£) made changes -
        Field Original Value New Value
        Fix Version/s 1.7 [ 18136 ]
        Assignee Olivier Lamy [ olamy ]
        Petr Kozelka created issue -

          People

          • Assignee:
            Olivier Lamy (*$^¨%`£)
            Reporter:
            Petr Kozelka
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development