Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-3198

commit places working copy into bad state

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.5.x
    • ---
    • unknown
    • None
    • Mac OS X

    Description

      This issue was originally discussed on the users mailing list.
      http://subversion.tigris.org/servlets/ReadMsg?list=users&msgNo=77694
      Karl Fogel then said it should be submitted as an official issue.
      http://subversion.tigris.org/servlets/ReadMsg?list=users&&msgNo=77700
      
      What follows mostly comes from the original e-mail. I have made a couple
      additions / modifications.
      
      ------------------------------
      
      What follows is a reproducible test-cast to get your working copy into
      an unfixable state.
      
      willow:~/tmp/test svn st
      willow:~/tmp/test ls
      a.txt
      willow:~/tmp/test svn cp a.txt b.txt
      A         b.txt
      willow:~/tmp/test svn cp a.txt c.txt
      A         c.txt
      willow:~/tmp/test rm b.txt
      willow:~/tmp/test svn st
      !  +   b.txt
      A  +   c.txt
      willow:~/tmp/test svn commit -m "Problem commit."
      Adding         b.txt
      Adding         c.txt
      svn: Commit succeeded, but other errors follow:
      svn: Error bumping revisions post-commit (details follow):
      svn: In directory '/Users/scelis/tmp/test'
      svn: Error processing command 'committed' in '/Users/scelis/tmp/test'
      svn: Error replacing text-base of 'b.txt'
      svn: Can't open file '/Users/scelis/tmp/test/b.txt': No such file or directory
      willow:~/tmp/test svn st
       L    .
      !  +   b.txt
      A  +   c.txt
      willow:~/tmp/test svn unlock .
      svn: '/Users/scelis/tmp' is not a working copy
      willow:~/tmp/test svn cleanup
      svn: In directory '.'
      svn: Error processing command 'committed' in '.'
      svn: Can't move '.svn/props/b.txt.svn-work' to
      '.svn/prop-base/b.txt.svn-base': No such file or directory
      willow:~/tmp/test svn revert b.txt
      svn: Working copy '.' locked
      svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
      
      ------------------------------
      
      First, please note the versions of Subversion that I am using.
      
      Server Version:
      1.4.4 (r25188)
      Windows 2000 Server
      
      Client Version:
      willow:~ svn --version
      svn, version 1.5.0 (Release Candidate 5)
        compiled May  5 2008, 09:28:47
      Mac OS X 10.5
      
      ------------------------------
      
      Looking back at the transcript above, there are two potential issues that I see.
      
      1) The commit succeeds and checks in b.txt even though b.txt is no
      longer in my working copy.  Should that be how it works?  I would
      expect the entire commit to fail, or at least for b.txt to not be
      checked in.  It seems strange to me that the commit succeeds but then
      my working copy has no knowledge of that, showing that c.txt still
      needs to be committed.
      
      2) Once the commit has succeeded, there is no way to fix my working
      copy to get back to a normal state. One big culprit of this is the
      fact that 'svn unlock .' fails saying that the parent directory is not
      a working copy. This is true, however the directory I tried to unlock
      is definitely a working copy directory.  The other big culprit is that
      'svn cleanup' complains about a file down under the .svn directory. If
      anything it should complain about a normal file in my working copy.
      
      ------------------------------
      
      I tried to replicate this using a 1.4.6 client and saw similar issues. 
      However, with a little voodoo I was able to fix the working copy. It
      went like this:
      
      willow:~/tmp/test svn st
      willow:~/tmp/test ls
      a.txt
      willow:~/tmp/test svn cp a.txt b.txt
      A         b.txt
      willow:~/tmp/test svn cp a.txt c.txt
      A         c.txt
      willow:~/tmp/test rm b.txt
      willow:~/tmp/test svn st
      !  +   b.txt
      A  +   c.txt
      willow:~/tmp/test svn commit -m "Problem commit."
      Adding         b.txt
      Adding         c.txt
      svn: Commit succeeded, but other errors follow:
      svn: Error bumping revisions post-commit (details follow):
      svn: In directory '/Users/scelis/tmp/test'
      svn: Error processing command 'committed' in '/Users/scelis/tmp/test'
      svn: Error replacing text-base of 'b.txt'
      svn: Can't open file '/Users/scelis/tmp/test/b.txt': No such file or directory
      willow:~/tmp/test svn st
       L    .
      !  +   b.txt
      A  +   c.txt
      willow:~/tmp/test svn unlock .
      svn: Working copy '/Users/scelis/tmp/test' locked
      svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
      willow:~/tmp/test svn cleanup
      svn: In directory '.'
      svn: Error processing command 'committed' in '.'
      svn: Error replacing text-base of 'b.txt'
      svn: Can't open file 'b.txt': No such file or directory
      willow:~/tmp/test touch b.txt
      willow:~/tmp/test svn cleanup
      willow:~/tmp/test svn status
      M      b.txt
      A  +   c.txt
      willow:~/tmp/test svn revert b.txt
      Reverted 'b.txt'
      willow:~/tmp/test svn status
      A  +   c.txt
      willow:~/tmp/test svn update
      svn: Failed to add file 'c.txt': object of the same name already exists
      willow:~/tmp/test svn status
      !      .
      A  +   c.txt
      willow:~/tmp/test svn revert c.txt
      Reverted 'c.txt'
      willow:~/tmp/test svn status
      ?      c.txt
      !      .
      willow:~/tmp/test rm c.txt
      willow:~/tmp/test svn update
      At revision 6085.
      willow:~/tmp/test svn status
      
      ------------------------------
      
      As you can see, in this situation 'svn cleanup' complains about just
      b.txt instead of the file under .svn.  This led me down a path which
      eventually fixed my working copy, even though it wasn't pretty.
      
      As such, I believe there is a regression issue in Subversion 1.5
      as there is no way to fix the working copy once it enters the bad
      state.  I also believe there is a bug in both 1.4.6 and 1.5 that
      causes the bad working copy state in the first place.
      

      Original issue reported by scelis

      Attachments

        Activity

          People

            Unassigned Unassigned
            subversion-importer Subversion Importer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: