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

patch fails for externals on add/delete

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments


    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: ---
    • Fix Version/s: ---
    • Component/s: cmdline client
    • Labels:


      Discussed at http://svn.haxx.se/users/archive-2014-11/0009.shtml and confirmed
      as a bug by Stefan Sperling.
      I’m primarily a Tortoise user under Windows, but have recently needed to start
      using the command line client more frequently.  Our development environment
      heavily leverages externals and developers often distribute patches as a means
      for code review.  With the command line client I’ve discovered that "svn patch"
      fails with an E155005: No write-lock error when applying a patch which adds or
      deletes files which span externals.  I’ve observed this with both 1.7.7 and
      1.8.10.  I’ve had no problems when applying such patches with the Tortoise patch
      mechanism.  A trivial example for clarity:
      Assume the following wc structure:
      [gmyers@pc test1]$ svn -v status
                       2        2 gmyers       .
                       2        2 gmyers       externals
      X                                        externals/test2
                       2        1 gmyers       fileA.txt
      Performing status on external item at 'externals/test2':
                       1        1 gmyers      
                       1        1 gmyers      
      Now assume I have three patch files which perform the following operations: 1)
      Add a file file2.dat to externals/test2/,  2)Delete externals/test2/fileB.txt, 
      3) Modify externals/test2/fileB.txt.  The patches were all generated by
      performing the desired task and dumping the result from svn diff.
      [gmyers@pc test1]$ cat add.patch
      Index: externals/test2/file2.dat
      --- externals/test2/file2.dat   (revision 0)
      +++ externals/test2/file2.dat   (working copy)
      @@ -0,0 +1 @@
      +This is file2.
      [gmyers@pc test1]$ cat delete.patch
      Index: externals/test2/fileB.txt
      --- externals/test2/fileB.txt   (revision 1)
      +++ externals/test2/fileB.txt   (working copy)
      @@ -1 +0,0 @@
      -This is fileB.txt
      [gmyers@pc test1]$ cat modify.patch
      Index: externals/test2/fileB.txt
      --- externals/test2/fileB.txt   (revision 1)
      +++ externals/test2/fileB.txt   (working copy)
      @@ -1 +1,3 @@
      This is fileB.txt
      +Add some text.
      Now I’ll attempt to apply the patches.  The "add" patch returns E155005 and
      although it creates the new file2.dat file it fails to add it to svn:
      [gmyers@pc test1]$ svn patch add.patch
      svn: E155005: No write-lock in
      The "delete" patch returns E155005 and does nothing:
      [gmyers@pc test1]$ svn patch delete.patch
      svn: E155005: No write-lock in
      The "modify" patch succeeds as expected:
      [gmyers@pc test1]$ svn patch modify.patch
      U         externals/test2/fileB.txt

      Original issue reported by gkm4d




            • Assignee:
              subversion-importer Subversion Importer


              • Created:

                Issue deployment