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

svn revert on a missing dir should optionally check out a fresh copy of the dir

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • all
    • 0.17
    • libsvn_client

    Description

      'svn revert' on a missing versioned directory (yes, a corrupt working copy) 
      should optionally check out a fresh copy of the dir.  If a versioned directory 
      has been removed then the meta info is missing and hence there is no 
      local way to get the dir back.  However, the data is on the server and it 
      would be nice if svn recognised this and could optionally go to the server 
      to get the data.  Using the parent's entries file there should be enough 
      information to get the URL and revision of the missing data.
      
      Note that currently svn just fails silently in this situation.
      
      e.g.
      
      Here we show the current behaviour, and show that the data can be 
      recovered with a checkout.  It would be cool if the checkout was prompted.
      
      [will@BATFISH:~:Fri 31, 2:42PM]
      % mkdir svntest
      [will@BATFISH:~:Fri 31, 2:43PM]
      % cd svntest
      [will@BATFISH:~/svntest:Fri 31, 2:43PM]
      % svnadmin create repos
      [will@BATFISH:~/svntest:Fri 31, 2:43PM]
      % svn mkdir file:///Users/will/svntest/repos/trunk/ -m ""
      
      Committed revision 1.
      [will@BATFISH:~/svntest:Fri 31, 2:43PM]
      % svn checkout file:///Users/will/svntest/repos/trunk/
      Checked out revision 1.
      [will@BATFISH:~/svntest:Fri 31, 2:43PM]
      % cd trunk
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:43PM]
      % mkdir testdir
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:43PM]
      % svn add testdir
      A          testdir
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:43PM]
      % svn commit -m ""
      Adding    testdir
      
      Committed revision 2.
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:44PM]
      % ls -a testdir
      .    ..   .svn
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:44PM]
      % rm -rf testdir
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:44PM]
      % ls
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:44PM]
      % svn up
      
      subversion/libsvn_fs/tree.c:177
      svn_error: #21064 : <Filesystem has no such file>
        file not found: transaction `2', path `/trunk/testdir'
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:44PM]
      % svn revert testdir
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:44PM]
      % ls
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:44PM]
      % svn st 
      !      ./testdir
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:45PM]
      % svn co file:///Users/will/svntest/repos/trunk/testdir
      Checked out revision 2.
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:45PM]
      % svn st
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:46PM]
      % ls
      testdir
      [will@BATFISH:~/svntest/trunk:Fri 31, 2:46PM]
      % ls -a testdir
      .    ..   .svn
      

      Original issue reported by uther

      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: