Maven 1.x Changelog Plugin
  1. Maven 1.x Changelog Plugin
  2. MPCHANGELOG-55

svn doesn not return any log entries due redundant quotation marks in range

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.7.2, 1.8.1
    • Fix Version/s: 1.8.1
    • Labels:
      None
    • Environment:
      SuSE Linux 9.2, JDK 1.5, svn client version 1.0.0,
    • Number of attachments :
      1

      Description

      SvnChangeLogGenerator.getScmDateArgument(Date, Date) appends quotation marks into string with requested date range. This causes that svn interprets parameter "-r

      {2005-01-30}

      :

      {2004-12-30}

      " as file name instead of -r parameter and returns empty log.

      1. MPCHANGELOG-55.txt
        0.6 kB
        Jeremy Michael Crosbie

        Activity

        Hide
        Brett Porter added a comment -

        changed to -r"

        {2005-01-30}:{2004-12-30}" instead of "-r{2005-01-30}

        :

        {2004-12-30}"

        Can you verify
        svn log -r"{2005-01-30}:{2004-12-30}

        "
        works in your environment?

        Show
        Brett Porter added a comment - changed to -r" {2005-01-30}:{2004-12-30}" instead of "-r{2005-01-30} : {2004-12-30}" Can you verify svn log -r"{2005-01-30}:{2004-12-30} " works in your environment?
        Hide
        Petr Adamek added a comment -

        No, it does not work:

        SCM Command Line[0]: svn
        SCM Command Line[1]: log
        SCM Command Line[2]: -v
        SCM Command Line[3]: -r"

        {2005-01-30}:{2004-12-30}"
        svn: Syntax error in revision argument '"{2005-01-30}

        :

        {2004-12-30}"'
        ChangeLog found: 0 entries

        Works only version without quotations:

        SCM Command Line[0]: svn
        SCM Command Line[1]: log
        SCM Command Line[2]: -v
        SCM Command Line[3]: -r{2005-01-30}:{2004-12-30}

        ChangeLog found: 68 entries

        Show
        Petr Adamek added a comment - No, it does not work: SCM Command Line [0] : svn SCM Command Line [1] : log SCM Command Line [2] : -v SCM Command Line [3] : -r" {2005-01-30}:{2004-12-30}" svn: Syntax error in revision argument '"{2005-01-30} : {2004-12-30}"' ChangeLog found: 0 entries Works only version without quotations: SCM Command Line [0] : svn SCM Command Line [1] : log SCM Command Line [2] : -v SCM Command Line [3] : -r{2005-01-30}:{2004-12-30} ChangeLog found: 68 entries
        Hide
        Brett Porter added a comment -

        how about:
        svn log -r{2005-01-30}:{2004-12-30}
        ?

        This works in cygwin, windows, Redhat 9. (though so did the quoted versions... presumably my shell swallows them first).

        Show
        Brett Porter added a comment - how about: svn log -r{2005-01-30}:{2004-12-30} ? This works in cygwin, windows, Redhat 9. (though so did the quoted versions... presumably my shell swallows them first).
        Hide
        Petr Adamek added a comment -

        Both

        svn log "-r

        {2005-01-30}

        :

        {2004-12-30}

        "

        and

        svn log -r{2005-01-30}:{2004-12-30}

        work typed on command line, but don't work used in changelog plugin:

        SCM Command Line[0]: svn
        SCM Command Line[1]: log
        SCM Command Line[2]: -v
        SCM Command Line[3]: -r{2005-01-30}:{2004-12-30}
        svn: Syntax error in revision argument '{2005-01-30}:{2004-12-30}'
        ChangeLog found: 0 entries

        I think that '

        {' and '}

        ' must be escaped due to shell expansions, but Commandline class probably uses Runtime.exec() and gives parameters direct without shell expansions.

        Show
        Petr Adamek added a comment - Both svn log "-r {2005-01-30} : {2004-12-30} " and svn log -r{2005-01-30}:{2004-12-30} work typed on command line, but don't work used in changelog plugin: SCM Command Line [0] : svn SCM Command Line [1] : log SCM Command Line [2] : -v SCM Command Line [3] : -r{2005-01-30}:{2004-12-30} svn: Syntax error in revision argument '{2005-01-30}:{2004-12-30}' ChangeLog found: 0 entries I think that ' {' and '} ' must be escaped due to shell expansions, but Commandline class probably uses Runtime.exec() and gives parameters direct without shell expansions.
        Hide
        Petr Adamek added a comment -

        I made some experiments on three different computers, one with SuSE 9.1, one with SuSE 9.2 and one with Fedora Core 3, but plugin behaves the same way. But I found that the plugin version 1.7.1 works perfectly while the plugin version 1.7.2 contains this bug:

        SuSE 9.1: 1.7.1 works, but 1.7.2 does not work
        SuSE 9.2: 1.7.1 works, but 1.7.2 does not work
        FC 3: 1.7.1 works, but 1.7.2 does not work

        I am sure, that the problem lies in the patch that solved

        http://jira.codehaus.org/browse/MPCHANGELOG-29

        because this patch added problematic quotes.

        On Linux, Execute class uses shell script antRun and all parameters are processed correctly. Therefore no escaping is required and all characters including quotes are given to executed process.

        But on WindowsNT, Execute class uses antRun.bat executed by cmd.exe and probably does not escape problematic characters like '

        {' and '}

        '. I think, that this is the bug of org.apache.tools.ant.taskdefs.Execute.WinNTCommandLauncher class.

        Summary: Version without quotes works on Linux but does not work on WindowsNT while version with quotes works on WindowsNT but does not work on Linux.

        Ugly workaround can be made by detecting OS type and adding quotes only on WindowsNT. Better solution is to use corrected version of ant. Unfortunatly I have no computer with Windows therefore I cannot try to prove any of both solutions.

        Show
        Petr Adamek added a comment - I made some experiments on three different computers, one with SuSE 9.1, one with SuSE 9.2 and one with Fedora Core 3, but plugin behaves the same way. But I found that the plugin version 1.7.1 works perfectly while the plugin version 1.7.2 contains this bug: SuSE 9.1: 1.7.1 works, but 1.7.2 does not work SuSE 9.2: 1.7.1 works, but 1.7.2 does not work FC 3: 1.7.1 works, but 1.7.2 does not work I am sure, that the problem lies in the patch that solved http://jira.codehaus.org/browse/MPCHANGELOG-29 because this patch added problematic quotes. On Linux, Execute class uses shell script antRun and all parameters are processed correctly. Therefore no escaping is required and all characters including quotes are given to executed process. But on WindowsNT, Execute class uses antRun.bat executed by cmd.exe and probably does not escape problematic characters like ' {' and '} '. I think, that this is the bug of org.apache.tools.ant.taskdefs.Execute.WinNTCommandLauncher class. Summary: Version without quotes works on Linux but does not work on WindowsNT while version with quotes works on WindowsNT but does not work on Linux. Ugly workaround can be made by detecting OS type and adding quotes only on WindowsNT. Better solution is to use corrected version of ant. Unfortunatly I have no computer with Windows therefore I cannot try to prove any of both solutions.
        Hide
        Jeremy Michael Crosbie added a comment -

        By moving the escaped quote after "-r", the plugin works.

        Show
        Jeremy Michael Crosbie added a comment - By moving the escaped quote after "-r", the plugin works.
        Hide
        Brett Porter added a comment -

        In response to Jeremy: yes, but it will break it on other operating systems.

        Show
        Brett Porter added a comment - In response to Jeremy: yes, but it will break it on other operating systems.

          People

          • Assignee:
            Brett Porter
            Reporter:
            Petr Adamek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: