Uploaded image for project: 'Crucible'
  1. Crucible
  2. CRUC-6316

Uploading patch through REST API fail to anchor to a revision due to CRLF ending

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Low
    • 3.4.1
    • 2.7.15, 2.9.2
    • None

    Description

      Steps to reproduce:

      1. Create a CRLF ending file and upload it to a SVN repository
      2. Modify the file and get the diff
      3. Create a Crucible review
      4. Upload the diff/patch to the review through REST:
        curl -u admin:admin -X POST -d @patch http://localhost:8060/rest-service/reviews-v1/CR-15/patch -H "Content-Type: application/json"
        
      5. The uploaded patch fail to anchor to a revision
      6. The following appear in the log:
        2012-12-25 21:03:38,113 DEBUG [btpool0-13 ] fisheye.perf ProfilingServletFilter-logRequest - start request POST /json/cru/CR-15/anchor-patch/?stripCount=0&anchorSource=svntest&anchorPath=branches%2FbranchA&patchId=21 sessionid=1xorcruijqztcabbwisefqzi1
        2012-12-25 21:03:38,126 DEBUG [btpool0-13 ] fisheye.perf RepositoryHandle-acquire - acquire engine on svntest, count=1
        2012-12-25 21:03:38,129 DEBUG [btpool0-13 ] fisheye.app SvnThrottledClient-start - Executing cat -r 15 http://localhost:8080/subversion/branches/branchA/DemoApp.cpp@15
        2012-12-25 21:03:38,186 DEBUG [btpool0-13 ] fisheye.app PatchSource-validateAnchorContent - Anchor validation failed
        com.cenqua.crucible.revision.diff.patchDiff.PatchException: Patch did not apply cleanly to FishEye repository at line 3072
        	at com.cenqua.crucible.revision.source.PatchSource.applyPatchDiff(PatchSource.java:216)
        	at com.cenqua.crucible.revision.source.PatchSource.validateAnchorContent(PatchSource.java:322)
        	at com.cenqua.crucible.util.PatchAnchorHelper.anchorPatchRevisions(PatchAnchorHelper.java:223)
        	at com.atlassian.crucible.actions.create.AnchorPatchAjaxAction.execute(AnchorPatchAjaxAction.java:195)
        	at sun.reflect.GeneratedMethodAccessor1133.invoke(Unknown Source)
        	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        	at java.lang.reflect.Method.invoke(Method.java:597)
        
      7. When trying to set the anchor manually from the UI, the following error appear:
        Crucible tried to anchor your patch to 'svntest', but there was conflicting content in 'branches/branchA/DemoApp.cpp' at revision '15'. You may not be able to see full context diffs.
        
      8. Adding the diff/patch file directly from the UI works

      Tested attaching from UI will have the same problem for FishEye/Crucible 2.8.2

      Attachments

        Issue Links

          Activity

            People

              mswinarski Maciej Swinarski (Inactive)
              klfoong Foong (Inactive)
              Votes:
              8 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: