You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2009/09/06 21:30:24 UTC
svn commit: r811868 - /couchdb/trunk/src/couchdb/couch_rep.erl
Author: kocolosk
Date: Sun Sep 6 19:30:23 2009
New Revision: 811868
URL: http://svn.apache.org/viewvc?rev=811868&view=rev
Log:
check if either history is empty, not both
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=811868&r1=811867&r2=811868&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_rep.erl (original)
+++ couchdb/trunk/src/couchdb/couch_rep.erl Sun Sep 6 19:30:23 2009
@@ -268,7 +268,7 @@
compare_rep_history(SourceHistory, TargetHistory)
end.
-compare_rep_history([], []) ->
+compare_rep_history(S, T) when S =:= [] orelse T =:= [] ->
?LOG_INFO("no common ancestry -- performing full replication", []),
{0, []};
compare_rep_history([{S}|SourceRest], [{T}|TargetRest]=Target) ->
Re: svn commit: r811868 - /couchdb/trunk/src/couchdb/couch_rep.erl
Posted by Adam Kocoloski <ko...@apache.org>.
On Sep 7, 2009, at 5:06 AM, Jan Lehnardt wrote:
>
> On 6 Sep 2009, at 21:30, kocolosk@apache.org wrote:
>
>> Author: kocolosk
>> Date: Sun Sep 6 19:30:23 2009
>> New Revision: 811868
>>
>> URL: http://svn.apache.org/viewvc?rev=811868&view=rev
>> Log:
>> check if either history is empty, not both
>>
>> Modified:
>> couchdb/trunk/src/couchdb/couch_rep.erl
>
> Hi Adam, good catch!
>
> Neither make check nor the test suite caught this one. Is it
> possible to write a test for this?
That's a good idea, and yes, it's not too difficult to test. Thanks
for the reminder,
Adam
Re: svn commit: r811868 - /couchdb/trunk/src/couchdb/couch_rep.erl
Posted by Jan Lehnardt <ja...@googlemail.com>.
On 6 Sep 2009, at 21:30, kocolosk@apache.org wrote:
> Author: kocolosk
> Date: Sun Sep 6 19:30:23 2009
> New Revision: 811868
>
> URL: http://svn.apache.org/viewvc?rev=811868&view=rev
> Log:
> check if either history is empty, not both
>
> Modified:
> couchdb/trunk/src/couchdb/couch_rep.erl
Hi Adam, good catch!
Neither make check nor the test suite caught this one. Is it possible
to write a test for this?
Cheers
Jan
--
>
> Modified: couchdb/trunk/src/couchdb/couch_rep.erl
> URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_rep.erl?rev=811868&r1=811867&r2=811868&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- couchdb/trunk/src/couchdb/couch_rep.erl (original)
> +++ couchdb/trunk/src/couchdb/couch_rep.erl Sun Sep 6 19:30:23 2009
> @@ -268,7 +268,7 @@
> compare_rep_history(SourceHistory, TargetHistory)
> end.
>
> -compare_rep_history([], []) ->
> +compare_rep_history(S, T) when S =:= [] orelse T =:= [] ->
> ?LOG_INFO("no common ancestry -- performing full replication",
> []),
> {0, []};
> compare_rep_history([{S}|SourceRest], [{T}|TargetRest]=Target) ->
>
>