You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/05/01 16:07:07 UTC
[20/23] couch-replicator commit: updated
refs/heads/1843-feature-bigcouch to 4965655
Simplify _replicator DB check
This version simply checks that the DB in question has a name that ends
in /_replicator (or is just _replicator). It allows for the possibility
that foo/_replicator is treated as a _replicator DB.
BugzID: 23315
Conflicts:
src/couch_replicator_manager.erl
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/commit/abd3d9d9
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/tree/abd3d9d9
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/diff/abd3d9d9
Branch: refs/heads/1843-feature-bigcouch
Commit: abd3d9d9aad01dac2937b5c17c9e9e71b39a30c1
Parents: afb00a3
Author: Adam Kocoloski <ad...@cloudant.com>
Authored: Tue Oct 15 17:23:45 2013 -0400
Committer: Robert Newson <rn...@apache.org>
Committed: Tue Apr 29 16:24:27 2014 +0100
----------------------------------------------------------------------
src/couch_replicator_manager.erl | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch-replicator/blob/abd3d9d9/src/couch_replicator_manager.erl
----------------------------------------------------------------------
diff --git a/src/couch_replicator_manager.erl b/src/couch_replicator_manager.erl
index b8a7447..99cf786 100644
--- a/src/couch_replicator_manager.erl
+++ b/src/couch_replicator_manager.erl
@@ -868,13 +868,14 @@ scan_all_dbs(Server) when is_pid(Server) ->
couch_db:close(Db).
is_replicator_db_fun() ->
- {ok, RegExp} = re:compile("^([a-z][a-z0-9\\_\\$()\\+\\-\\/]*/)?_replicator$"),
- fun
- (<<"shards/", _/binary>>=DbName) ->
- match =:= re:run(mem3:dbname(DbName), RegExp, [{capture,none}]);
- (DbName) ->
- LocalRepDb = ?l2b(config:get("replicator", "db", "_replicator")),
- DbName == LocalRepDb
+ fun(Name) ->
+ DbName = mem3:dbname(Name),
+ case lists:last(binary:split(DbName, <<"/">>, [global])) of
+ <<"_replicator">> ->
+ true;
+ _ ->
+ false
+ end
end.
get_json_value(Key, Props) ->