You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Randall Leeds (JIRA)" <ji...@apache.org> on 2012/10/29 20:52:12 UTC

[jira] [Commented] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

    [ https://issues.apache.org/jira/browse/COUCHDB-1485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486292#comment-13486292 ] 

Randall Leeds commented on COUCHDB-1485:
----------------------------------------

7e3c69ba951de7cfaa095145ba49c58d539a28ea does not seem to be responsible for this change but I can verify that the revision hash does not change with the COPY command on 1.1.1.

I'm currently searching through the 1.2.x branch trying to determine where this change was introduced.

Whatever the case, it's always been that COPY returns the new revision in the response. I don't know if it was every guaranteed that the revision id would stay the same after a COPY.
                
> COPY behavior changed between 1.1.1 to 1.2
> ------------------------------------------
>
>                 Key: COUCHDB-1485
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1485
>             Project: CouchDB
>          Issue Type: Question
>          Components: HTTP Interface
>    Affects Versions: 1.2
>         Environment: Mac OS X 10.7.4
>            Reporter: Michael Phan-Ba
>            Assignee: Randall Leeds
>              Labels: api-change, document
>
> I believe commit 7e3c69ba951de7cfaa095145ba49c58d539a28ea (CouchDB 1.2) changed the behavior of HTTP COPY to update the revision to reflect the new document ID.
> Is there a way to make COPY update the rev property on the client side for previous versions of CouchDB?
> See commit c5209edceef1635c4ef0d23119f8327b5f3403de "fix tests for couchdb 1.1.1" at:
> https://github.com/mikepb/clerk/commit/c5209edceef1635c4ef0d23119f8327b5f3403de

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Re: [jira] [Commented] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

Posted by Benoit Chesneau <bc...@gmail.com>.
On Tue, Oct 30, 2012 at 7:13 PM, Robert Newson <rn...@apache.org> wrote:
> #!/bin/sh
>
> URL="localhost:5984/db1"
>
> curl "localhost:5984"
> curl $URL -XDELETE
> curl $URL -XPUT
> curl $URL/doc1 -XPUT -d '{}'
> curl $URL/doc1 -HDestination:doc2 -XCOPY
>
> {"couchdb":"Welcome","version":"1.1.1"}
> {"error":"not_found","reason":"missing"}
> {"ok":true}
> {"ok":true,"id":"doc1","rev":"1-967a00dff5e02add41819138abb3284d"}
> {"id":"doc2","rev":"1-967a00dff5e02add41819138abb3284d"}
>
> vs
>
> {"couchdb":"Welcome","version":"1.2.0"}
> {"ok":true}
> {"ok":true}
> {"ok":true,"id":"doc1","rev":"1-967a00dff5e02add41819138abb3284d"}
> {"ok":true,"id":"doc2","rev":"1-6aaf7080aad9d1a9482e07c46581dac0"}
>

odd. I never paid attention. Though I wouldn't care about it... It is
somehow unexpected (how could revisions be the same since the docids
changed)

Re: [jira] [Commented] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

Posted by Robert Newson <rn...@apache.org>.
#!/bin/sh

URL="localhost:5984/db1"

curl "localhost:5984"
curl $URL -XDELETE
curl $URL -XPUT
curl $URL/doc1 -XPUT -d '{}'
curl $URL/doc1 -HDestination:doc2 -XCOPY

{"couchdb":"Welcome","version":"1.1.1"}
{"error":"not_found","reason":"missing"}
{"ok":true}
{"ok":true,"id":"doc1","rev":"1-967a00dff5e02add41819138abb3284d"}
{"id":"doc2","rev":"1-967a00dff5e02add41819138abb3284d"}

vs

{"couchdb":"Welcome","version":"1.2.0"}
{"ok":true}
{"ok":true}
{"ok":true,"id":"doc1","rev":"1-967a00dff5e02add41819138abb3284d"}
{"ok":true,"id":"doc2","rev":"1-6aaf7080aad9d1a9482e07c46581dac0"}

On 30 October 2012 17:47, Benoit Chesneau <bc...@gmail.com> wrote:
> On Mon, Oct 29, 2012 at 8:52 PM, Randall Leeds (JIRA) <ji...@apache.org> wrote:
>
>
>>
>> Whatever the case, it's always been that COPY returns the new revision in the response. I don't know if it was every guaranteed that the revision id would stay the same after a COPY.
>
> I'm pretty sure the revision in the new doc resulting from the copy
> has always been different from the source.

Re: [jira] [Commented] (COUCHDB-1485) COPY behavior changed between 1.1.1 to 1.2

Posted by Benoit Chesneau <bc...@gmail.com>.
On Mon, Oct 29, 2012 at 8:52 PM, Randall Leeds (JIRA) <ji...@apache.org> wrote:


>
> Whatever the case, it's always been that COPY returns the new revision in the response. I don't know if it was every guaranteed that the revision id would stay the same after a COPY.

I'm pretty sure the revision in the new doc resulting from the copy
has always been different from the source.