You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2010/03/20 01:22:05 UTC

svn commit: r925497 - /couchdb/trunk/src/couchdb/couch_rep.erl

Author: jan
Date: Sat Mar 20 00:22:04 2010
New Revision: 925497

URL: http://svn.apache.org/viewvc?rev=925497&view=rev
Log:
backwards compatible ids for non-docid replications

Modified:
    couchdb/trunk/src/couchdb/couch_rep.erl

Modified: couchdb/trunk/src/couchdb/couch_rep.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep.erl?rev=925497&r1=925496&r2=925497&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_rep.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep.erl Sat Mar 20 00:22:04 2010
@@ -455,7 +455,12 @@ make_replication_id({Props}, UserCtx) ->
     QueryParams = proplists:get_value(<<"query_params">>, Props),
     DocIds = proplists:get_value(<<"doc_ids">>, Props),
     Base = couch_util:to_hex(erlang:md5(
-        term_to_binary([HostName, Src, Tgt, Filter, QueryParams, DocIds])
+        case DocIds of
+        undefined ->
+            term_to_binary([HostName, Src, Tgt, Filter, QueryParams]);
+        DocIds ->
+            term_to_binary([HostName, Src, Tgt, Filter, QueryParams, DocIds])
+        end
     )),
     Extension = maybe_append_options(
         [<<"continuous">>, <<"create_target">>], Props),



Re: svn commit: r925497 - /couchdb/trunk/src/couchdb/couch_rep.erl

Posted by Filipe David Manana <fd...@gmail.com>.
Jan,

It would also be a good idea to do the same with the filtered replication
specific parameters ("filter" and "query_params"). The patch attached to
this email does it.

Also, don't forget the regression test attached to
https://issues.apache.org/jira/browse/COUCHDB-703

cheers

On Sat, Mar 20, 2010 at 12:22 AM, <ja...@apache.org> wrote:

> Author: jan
> Date: Sat Mar 20 00:22:04 2010
> New Revision: 925497
>
> URL: http://svn.apache.org/viewvc?rev=925497&view=rev
> Log:
> backwards compatible ids for non-docid replications
>
> Modified:
>    couchdb/trunk/src/couchdb/couch_rep.erl
>
> Modified: couchdb/trunk/src/couchdb/couch_rep.erl
> URL:
> http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep.erl?rev=925497&r1=925496&r2=925497&view=diff
>
> ==============================================================================
> --- couchdb/trunk/src/couchdb/couch_rep.erl (original)
> +++ couchdb/trunk/src/couchdb/couch_rep.erl Sat Mar 20 00:22:04 2010
> @@ -455,7 +455,12 @@ make_replication_id({Props}, UserCtx) ->
>     QueryParams = proplists:get_value(<<"query_params">>, Props),
>     DocIds = proplists:get_value(<<"doc_ids">>, Props),
>     Base = couch_util:to_hex(erlang:md5(
> -        term_to_binary([HostName, Src, Tgt, Filter, QueryParams, DocIds])
> +        case DocIds of
> +        undefined ->
> +            term_to_binary([HostName, Src, Tgt, Filter, QueryParams]);
> +        DocIds ->
> +            term_to_binary([HostName, Src, Tgt, Filter, QueryParams,
> DocIds])
> +        end
>     )),
>     Extension = maybe_append_options(
>         [<<"continuous">>, <<"create_target">>], Props),
>
>
>


-- 
Filipe David Manana,
fdmanana@gmail.com

"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."

Re: svn commit: r925497 - /couchdb/trunk/src/couchdb/couch_rep.erl

Posted by Filipe David Manana <fd...@gmail.com>.
Thanks Nikolai for reporting the issue.

That was a case that somehow didn't get properly tested when I implemented
the feature.

cheers

On Sun, Mar 21, 2010 at 8:59 PM, Nikolai Teofilov <n....@gmail.com>wrote:

> Thanks Filipe!
>
> This is very nice and important contribution!
>
> Cheers
> Nikolai
>
> On 21.03.2010, at 21:21, Jan Lehnardt wrote:
>
> > Done and done.
> >
> > Thanks again Filipe.
> >
> > Cheers
> > Jan
> > --
> >
> > On 21 Mar 2010, at 07:10, Filipe David Manana wrote:
> >
> >> Jan,
> >>
> >> It would also be a good idea to do the same with the filtered
> replication specific parameters ("filter" and "query_params"). The patch
> attached to this email does it.
> >>
> >> Also, don't forget the regression test attached to
> https://issues.apache.org/jira/browse/COUCHDB-703
> >>
> >> cheers
> >>
> >> On Sat, Mar 20, 2010 at 12:22 AM, <ja...@apache.org> wrote:
> >> Author: jan
> >> Date: Sat Mar 20 00:22:04 2010
> >> New Revision: 925497
> >>
> >> URL: http://svn.apache.org/viewvc?rev=925497&view=rev
> >> Log:
> >> backwards compatible ids for non-docid replications
> >>
> >> Modified:
> >>   couchdb/trunk/src/couchdb/couch_rep.erl
> >>
> >> Modified: couchdb/trunk/src/couchdb/couch_rep.erl
> >> URL:
> http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep.erl?rev=925497&r1=925496&r2=925497&view=diff
> >>
> ==============================================================================
> >> --- couchdb/trunk/src/couchdb/couch_rep.erl (original)
> >> +++ couchdb/trunk/src/couchdb/couch_rep.erl Sat Mar 20 00:22:04 2010
> >> @@ -455,7 +455,12 @@ make_replication_id({Props}, UserCtx) ->
> >>    QueryParams = proplists:get_value(<<"query_params">>, Props),
> >>    DocIds = proplists:get_value(<<"doc_ids">>, Props),
> >>    Base = couch_util:to_hex(erlang:md5(
> >> -        term_to_binary([HostName, Src, Tgt, Filter, QueryParams,
> DocIds])
> >> +        case DocIds of
> >> +        undefined ->
> >> +            term_to_binary([HostName, Src, Tgt, Filter, QueryParams]);
> >> +        DocIds ->
> >> +            term_to_binary([HostName, Src, Tgt, Filter, QueryParams,
> DocIds])
> >> +        end
> >>    )),
> >>    Extension = maybe_append_options(
> >>        [<<"continuous">>, <<"create_target">>], Props),
> >>
> >>
> >>
> >>
> >>
> >> --
> >> Filipe David Manana,
> >> fdmanana@gmail.com
> >>
> >> "Reasonable men adapt themselves to the world.
> >> Unreasonable men adapt the world to themselves.
> >> That's why all progress depends on unreasonable men."
> >>
> >> <backwards_compatible_repids-trunk.patch>
> >
>
>


-- 
Filipe David Manana,
fdmanana@gmail.com

"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."

Re: svn commit: r925497 - /couchdb/trunk/src/couchdb/couch_rep.erl

Posted by Nikolai Teofilov <n....@gmail.com>.
Thanks Filipe!

This is very nice and important contribution!

Cheers
Nikolai

On 21.03.2010, at 21:21, Jan Lehnardt wrote:

> Done and done.
> 
> Thanks again Filipe.
> 
> Cheers
> Jan
> --
> 
> On 21 Mar 2010, at 07:10, Filipe David Manana wrote:
> 
>> Jan,
>> 
>> It would also be a good idea to do the same with the filtered replication specific parameters ("filter" and "query_params"). The patch attached to this email does it.
>> 
>> Also, don't forget the regression test attached to https://issues.apache.org/jira/browse/COUCHDB-703
>> 
>> cheers
>> 
>> On Sat, Mar 20, 2010 at 12:22 AM, <ja...@apache.org> wrote:
>> Author: jan
>> Date: Sat Mar 20 00:22:04 2010
>> New Revision: 925497
>> 
>> URL: http://svn.apache.org/viewvc?rev=925497&view=rev
>> Log:
>> backwards compatible ids for non-docid replications
>> 
>> Modified:
>>   couchdb/trunk/src/couchdb/couch_rep.erl
>> 
>> Modified: couchdb/trunk/src/couchdb/couch_rep.erl
>> URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep.erl?rev=925497&r1=925496&r2=925497&view=diff
>> ==============================================================================
>> --- couchdb/trunk/src/couchdb/couch_rep.erl (original)
>> +++ couchdb/trunk/src/couchdb/couch_rep.erl Sat Mar 20 00:22:04 2010
>> @@ -455,7 +455,12 @@ make_replication_id({Props}, UserCtx) ->
>>    QueryParams = proplists:get_value(<<"query_params">>, Props),
>>    DocIds = proplists:get_value(<<"doc_ids">>, Props),
>>    Base = couch_util:to_hex(erlang:md5(
>> -        term_to_binary([HostName, Src, Tgt, Filter, QueryParams, DocIds])
>> +        case DocIds of
>> +        undefined ->
>> +            term_to_binary([HostName, Src, Tgt, Filter, QueryParams]);
>> +        DocIds ->
>> +            term_to_binary([HostName, Src, Tgt, Filter, QueryParams, DocIds])
>> +        end
>>    )),
>>    Extension = maybe_append_options(
>>        [<<"continuous">>, <<"create_target">>], Props),
>> 
>> 
>> 
>> 
>> 
>> -- 
>> Filipe David Manana,
>> fdmanana@gmail.com
>> 
>> "Reasonable men adapt themselves to the world.
>> Unreasonable men adapt the world to themselves.
>> That's why all progress depends on unreasonable men."
>> 
>> <backwards_compatible_repids-trunk.patch>
> 


Re: svn commit: r925497 - /couchdb/trunk/src/couchdb/couch_rep.erl

Posted by Jan Lehnardt <ja...@apache.org>.
Done and done.

Thanks again Filipe.

Cheers
Jan
--

On 21 Mar 2010, at 07:10, Filipe David Manana wrote:

> Jan,
> 
> It would also be a good idea to do the same with the filtered replication specific parameters ("filter" and "query_params"). The patch attached to this email does it.
> 
> Also, don't forget the regression test attached to https://issues.apache.org/jira/browse/COUCHDB-703
> 
> cheers
> 
> On Sat, Mar 20, 2010 at 12:22 AM, <ja...@apache.org> wrote:
> Author: jan
> Date: Sat Mar 20 00:22:04 2010
> New Revision: 925497
> 
> URL: http://svn.apache.org/viewvc?rev=925497&view=rev
> Log:
> backwards compatible ids for non-docid replications
> 
> Modified:
>    couchdb/trunk/src/couchdb/couch_rep.erl
> 
> Modified: couchdb/trunk/src/couchdb/couch_rep.erl
> URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep.erl?rev=925497&r1=925496&r2=925497&view=diff
> ==============================================================================
> --- couchdb/trunk/src/couchdb/couch_rep.erl (original)
> +++ couchdb/trunk/src/couchdb/couch_rep.erl Sat Mar 20 00:22:04 2010
> @@ -455,7 +455,12 @@ make_replication_id({Props}, UserCtx) ->
>     QueryParams = proplists:get_value(<<"query_params">>, Props),
>     DocIds = proplists:get_value(<<"doc_ids">>, Props),
>     Base = couch_util:to_hex(erlang:md5(
> -        term_to_binary([HostName, Src, Tgt, Filter, QueryParams, DocIds])
> +        case DocIds of
> +        undefined ->
> +            term_to_binary([HostName, Src, Tgt, Filter, QueryParams]);
> +        DocIds ->
> +            term_to_binary([HostName, Src, Tgt, Filter, QueryParams, DocIds])
> +        end
>     )),
>     Extension = maybe_append_options(
>         [<<"continuous">>, <<"create_target">>], Props),
> 
> 
> 
> 
> 
> -- 
> Filipe David Manana,
> fdmanana@gmail.com
> 
> "Reasonable men adapt themselves to the world.
> Unreasonable men adapt the world to themselves.
> That's why all progress depends on unreasonable men."
> 
> <backwards_compatible_repids-trunk.patch>


Re: svn commit: r925497 - /couchdb/trunk/src/couchdb/couch_rep.erl

Posted by Filipe David Manana <fd...@gmail.com>.
Jan,

It would also be a good idea to do the same with the filtered replication
specific parameters ("filter" and "query_params"). The patch attached to
this email does it.

Also, don't forget the regression test attached to
https://issues.apache.org/jira/browse/COUCHDB-703

cheers

On Sat, Mar 20, 2010 at 12:22 AM, <ja...@apache.org> wrote:

> Author: jan
> Date: Sat Mar 20 00:22:04 2010
> New Revision: 925497
>
> URL: http://svn.apache.org/viewvc?rev=925497&view=rev
> Log:
> backwards compatible ids for non-docid replications
>
> Modified:
>    couchdb/trunk/src/couchdb/couch_rep.erl
>
> Modified: couchdb/trunk/src/couchdb/couch_rep.erl
> URL:
> http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep.erl?rev=925497&r1=925496&r2=925497&view=diff
>
> ==============================================================================
> --- couchdb/trunk/src/couchdb/couch_rep.erl (original)
> +++ couchdb/trunk/src/couchdb/couch_rep.erl Sat Mar 20 00:22:04 2010
> @@ -455,7 +455,12 @@ make_replication_id({Props}, UserCtx) ->
>     QueryParams = proplists:get_value(<<"query_params">>, Props),
>     DocIds = proplists:get_value(<<"doc_ids">>, Props),
>     Base = couch_util:to_hex(erlang:md5(
> -        term_to_binary([HostName, Src, Tgt, Filter, QueryParams, DocIds])
> +        case DocIds of
> +        undefined ->
> +            term_to_binary([HostName, Src, Tgt, Filter, QueryParams]);
> +        DocIds ->
> +            term_to_binary([HostName, Src, Tgt, Filter, QueryParams,
> DocIds])
> +        end
>     )),
>     Extension = maybe_append_options(
>         [<<"continuous">>, <<"create_target">>], Props),
>
>
>


-- 
Filipe David Manana,
fdmanana@gmail.com

"Reasonable men adapt themselves to the world.
Unreasonable men adapt the world to themselves.
That's why all progress depends on unreasonable men."