Maven SCM
  1. Maven SCM
  2. SCM-480

"mvn scm:status" doesn't show modified file

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.3
    • Component/s: maven-scm-provider-svn
    • Labels:
      None
    • Environment:
      OS X 10.5.7
      JDK 1.5
      Maven 2.1.0
      SVN 1.6.2

      Description

      "svn status" gives
      M src/main/java/de/artive/test/FooBar.java

      "mvn scm:status" gives
      [INFO] Scanning for projects...
      [INFO] Searching repository for plugin with prefix: 'scm'.
      [INFO] ------------------------------------------------------------------------
      [INFO] Building test-build
      [INFO] task-segment: [scm:status] (aggregator-style)
      [INFO] ------------------------------------------------------------------------
      [INFO] [scm:status]
      [INFO] Executing: /bin/sh -c cd /Users/vivo/workspaces/eclipse-3.4/test-build && svn --username vivo --password '*****' --non-interactive status
      [INFO] Working directory: /Users/vivo/workspaces/eclipse-3.4/test-build
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESSFUL
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 4 seconds
      [INFO] Finished at: Fri Jun 26 13:01:04 CEST 2009
      [INFO] Final Memory: 15M/29M
      [INFO] ------------------------------------------------------------------------

      The changed file is not shown.

      This wouldn't be that bad, if the the release plugin therefore would not recognize that there still is a modified file in the workspace

        Issue Links

          Activity

          Hide
          Mark Struberg added a comment -

          thanks Victor!

          applied in Revision 881560.

          Show
          Mark Struberg added a comment - thanks Victor! applied in Revision 881560.
          Hide
          Matteo Collina added a comment -

          Is the specified patch applied in the latest snapshot?
          Right now mvn scm:status returns nothing.

          Show
          Matteo Collina added a comment - Is the specified patch applied in the latest snapshot? Right now mvn scm:status returns nothing.
          Hide
          Nick Stolwijk added a comment -

          The specifications of the output format are found in the SVN repository.

          http://svn.collab.net/repos/svn/tags/1.6.0/subversion/svn/schema/

          Show
          Nick Stolwijk added a comment - The specifications of the output format are found in the SVN repository. http://svn.collab.net/repos/svn/tags/1.6.0/subversion/svn/schema/
          Hide
          Victor Volle added a comment -

          Added the primitive patch that we are using for some months.
          Works with Subversion clients 1.5 and 1.6 (couldn't test 1.4).

          This is not the patch I proposed (using a matcher). For that I really would need a "specification" of the SVN client ouput and much more time.
          But the fix should solve the most pressing issue.

          Show
          Victor Volle added a comment - Added the primitive patch that we are using for some months. Works with Subversion clients 1.5 and 1.6 (couldn't test 1.4). This is not the patch I proposed (using a matcher). For that I really would need a "specification" of the SVN client ouput and much more time. But the fix should solve the most pressing issue.
          Hide
          Mark Struberg added a comment -

          Victor, I guess Brett meant you should simply attach the changes you commented in textual form as a patch to Jira

          Show
          Mark Struberg added a comment - Victor, I guess Brett meant you should simply attach the changes you commented in textual form as a patch to Jira
          Hide
          Victor Volle added a comment -

          I will give it a try. Does any one have an "official" description of the possible output of subversion?

          Show
          Victor Volle added a comment - I will give it a try. Does any one have an "official" description of the possible output of subversion?
          Hide
          Brett Porter added a comment -

          thanks for identifying the problem. IIRC Subversion 1.6 changed the output format and the SCM library hasn't been updated to match.

          Would you be interested in contributing your fix as a patch using the matcher as you suggested?

          Show
          Brett Porter added a comment - thanks for identifying the problem. IIRC Subversion 1.6 changed the output format and the SCM library hasn't been updated to match. Would you be interested in contributing your fix as a patch using the matcher as you suggested?
          Hide
          mattb added a comment -

          Does anyone have any idea when this issue might be fixed (or even acknowledged)?

          I can't imagine it helps the SCM project all that much if the connector for arguably the most popular SCM provider has trouble detecting local changes.

          Show
          mattb added a comment - Does anyone have any idea when this issue might be fixed (or even acknowledged)? I can't imagine it helps the SCM project all that much if the connector for arguably the most popular SCM provider has trouble detecting local changes.
          Hide
          M.S. added a comment -

          Same here:
          Mac OSX 10.5.8
          Maven 2.2.1
          Subversion 1.6.5
          JDK 1.6.0_15

          svn status shows modified files but scm:check-local-modification won't fail due to invalid scm:status behaviour.

          $ svn status
          M pom.xml

          $ mvn scm:check-local-modification
          [INFO] Scanning for projects...
          [INFO] Searching repository for plugin with prefix: 'scm'.
          [INFO] ------------------------------------------------------------------------
          [INFO] Building global parent POM
          [INFO] task-segment: [scm:check-local-modification]
          [INFO] ------------------------------------------------------------------------
          [INFO] [scm:check-local-modification

          {execution: default-cli}

          ]
          [INFO] Executing: /bin/sh -c cd /Users/mscholl/svnwork/central/de/cismet/global-parent/trunk && svn --non-interactive status
          [INFO] Working directory: /Users/mscholl/svnwork/central/de/cismet/global-parent/trunk
          [INFO] ------------------------------------------------------------------------
          [INFO] BUILD SUCCESSFUL
          [INFO] ------------------------------------------------------------------------
          [INFO] Total time: 3 seconds
          [INFO] Finished at: Mon Sep 07 18:16:49 CEST 2009
          [INFO] Final Memory: 13M/80M
          [INFO] ------------------------------------------------------------------------

          Unfortunately the 1.3-SNAPSHOT build doesn't fix that (at the moment). Is there a chance that it will be fixed in the near future?

          Show
          M.S. added a comment - Same here: Mac OSX 10.5.8 Maven 2.2.1 Subversion 1.6.5 JDK 1.6.0_15 svn status shows modified files but scm:check-local-modification won't fail due to invalid scm:status behaviour. $ svn status M pom.xml $ mvn scm:check-local-modification [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'scm'. [INFO] ------------------------------------------------------------------------ [INFO] Building global parent POM [INFO] task-segment: [scm:check-local-modification] [INFO] ------------------------------------------------------------------------ [INFO] [scm:check-local-modification {execution: default-cli} ] [INFO] Executing: /bin/sh -c cd /Users/mscholl/svnwork/central/de/cismet/global-parent/trunk && svn --non-interactive status [INFO] Working directory: /Users/mscholl/svnwork/central/de/cismet/global-parent/trunk [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3 seconds [INFO] Finished at: Mon Sep 07 18:16:49 CEST 2009 [INFO] Final Memory: 13M/80M [INFO] ------------------------------------------------------------------------ Unfortunately the 1.3-SNAPSHOT build doesn't fix that (at the moment). Is there a chance that it will be fixed in the near future?
          Hide
          mattb added a comment -

          I am having a similar issue, with:

          Subversion 1.6.3
          Maven 2.1.0
          JDK version 1.6.0_11

          $ svn status
          M src/main/java/com/blah/shuffler/BlahShuffler.java
          M pom.xml

          mvn scm:status along with release:prepare both then act as if there are no local modifications.

          Show
          mattb added a comment - I am having a similar issue, with: Subversion 1.6.3 Maven 2.1.0 JDK version 1.6.0_11 $ svn status M src/main/java/com/blah/shuffler/BlahShuffler.java M pom.xml mvn scm:status along with release:prepare both then act as if there are no local modifications.
          Hide
          Victor Volle added a comment -

          the solution has been (manually) tested in the following environment:

          OS X 10.5.7
          JDK 1.5 und 1.6
          Maven 2.1.0
          SVN 1.6.2

          Show
          Victor Volle added a comment - the solution has been (manually) tested in the following environment: OS X 10.5.7 JDK 1.5 und 1.6 Maven 2.1.0 SVN 1.6.2
          Hide
          Victor Volle added a comment -

          Index: SvnStatusConsumer.java
          ===================================================================
          — SvnStatusConsumer.java (revision 788643)
          +++ SvnStatusConsumer.java (working copy)
          @@ -81,7 +81,7 @@

          String statusString = line.substring( 0, 1 );

          • String file = line.substring( 7 );
            + String file = line.substring( 7 ).trim();

          ScmFileStatus status;

          Show
          Victor Volle added a comment - Index: SvnStatusConsumer.java =================================================================== — SvnStatusConsumer.java (revision 788643) +++ SvnStatusConsumer.java (working copy) @@ -81,7 +81,7 @@ String statusString = line.substring( 0, 1 ); String file = line.substring( 7 ); + String file = line.substring( 7 ).trim(); ScmFileStatus status;
          Hide
          Victor Volle added a comment - - edited

          I found the reason:

          In SvnStatusConsumer

          String file = line.substring( 7 );

          The "file" variable then contains " pom.xml" with a leading whitespace!
          Later on there is a test:

          if ( !status.equals( ScmFileStatus.DELETED ) && !new File( workingDirectory, file ).isFile() )
          {
          return;
          }

          but since "file" has a leading white space, "new File(...).isFile" returns false.

          I would propose switching to a pattern matcher instead of String indices.
          A quick fix would be to simply trim the file name

          Show
          Victor Volle added a comment - - edited I found the reason: In SvnStatusConsumer String file = line.substring( 7 ); The "file" variable then contains " pom.xml" with a leading whitespace! Later on there is a test: if ( !status.equals( ScmFileStatus.DELETED ) && !new File( workingDirectory, file ).isFile() ) { return; } but since "file" has a leading white space, "new File(...).isFile" returns false. I would propose switching to a pattern matcher instead of String indices. A quick fix would be to simply trim the file name

            People

            • Assignee:
              Mark Struberg
              Reporter:
              Victor Volle
            • Votes:
              5 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development