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

update and revert bugs, w/ patch from Philip Martin

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • all
    • 0.14.0
    • src
    • None

    Description

      Here are Philip Martin's two messages.  The first describes
      the bug(s) he encountered, the second contains a patch:
      
      From: Philip Martin <pmartin@uklinux.net>
      Subject:  update and revert bugs
      To: dev@subversion.tigris.org
      Date: 03 Nov 2001 18:11:24 +0000
      
      
      Two, possibly related, bugs:
      
      First, given an up-to-date directory containing an out of date file,
      update on the file doesn't seem to work:
      
         $ svn st -uv .
         _               11    .
         _               10    ./bar.c
         Head revision:     11
         $ svn up bar.c
         $ svn st -uv .
         _               11    .
         _               10    ./bar.c
         Head revision:     11
      
      It appears that the file difference does not get reported if the
      directory is up to date.
      
      
      Second, in this situation (file out-of-date in up-to-date directory)
      the working copy can be corrupted as follows:
      
         $ svn del bar.c
         D  bar.c
         $ svn add bar.c
         A          bar.c
         $ svn revert bar.c
         Reverted bar.c
         $ svn st -uv
      
         svn_error: #21049 : <Filesystem has no such file>
           file not found: filesystem `/home/pm/sw/subversion/repository/trial/db',
      revision `0', path `bar.c'
      
      
      I am using a subversion version with my new repository diff code, but
      my changes don't touch the update or revert code.
      
      Philip
      
      -------------------- SECOND MESSAGE ------------------------
      From: Philip Martin <pmartin@uklinux.net>
      Subject:  Re: update and revert bugs [PATCH]
      To: dev@subversion.tigris.org
      Date: 05 Nov 2001 15:30:17 +0000
      
      Philip Martin <pmartin@uklinux.net> writes:
      
      > Second, in this situation (file out-of-date in up-to-date directory)
      > the working copy can be corrupted as follows:
      
      This bug occurs in an up-to-date working copy as well.
      
      > 
      >    $ svn del bar.c
      >    D  bar.c
      >    $ svn add bar.c
      >    A          bar.c
      >    $ svn revert bar.c
      >    Reverted bar.c
      >    $ svn st -uv
      > 
      >    svn_error: #21049 : <Filesystem has no such file>
      >      file not found: filesystem `/home/pm/sw/subversion/repository/trial/db',
      revision `0', path `bar.c'
      
      The problem is that the revert command does not remove the
      revision="0" line from the .svn/entries file. It looks like
      fold_entry() should do this but modify_flags does not contain
      SVN_WC__ENTRY_MODIFY_REVISION. It looks like revert_admin_things()
      should be setting it, how about:
      
      * subversion/libsvn_wc/adm_ops: revert_admin_things(): restore the
        revision when reverting a replaced file.
      
      Index: subversion/libsvn_wc/adm_ops.c
      ===================================================================
      --- subversion/libsvn_wc/.svn/text-base/adm_ops.c	Sat Nov  3 17:29:27 2001
      +++ subversion/libsvn_wc/adm_ops.c	Mon Nov  5 15:24:30 2001
      @@ -825,6 +825,10 @@
                 *modify_flags |= SVN_WC__ENTRY_MODIFY_TEXT_TIME;
                 entry->text_time = tstamp;
               }
      +
      +      /* Restore the revison if reverting a replaced file. */
      +      if (entry->schedule == svn_wc_schedule_replace)
      +        *modify_flags |= SVN_WC__ENTRY_MODIFY_REVISION;
           }
       
         if (entry->conflicted)
      
      
      Philip
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            kfogel Karl Fogel
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: