~ubuntu-branches/ubuntu/lucid/couchdb/lucid

« back to all changes in this revision

Viewing changes to src/couchdb/couch_rep_missing_revs.erl

  • Committer: Bazaar Package Importer
  • Author(s): Chad Miller, Ken VanDine
  • Date: 2009-09-25 19:18:26 UTC
  • mfrom: (1.2.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090925191826-km9018omfgxosvah
Tags: 0.10.0~svn818859-0ubuntu1
* Import code from pre-release branch.  (LP: #427860, #408909)
        + Build and System Integration:
          * Changed `couchdb` script configuration options.
          * Added default.d and local.d configuration directories to load
      sequence.
        + HTTP Interface:
          * Added optional cookie-based authentication handler.
          * Added optional two-legged OAuth authentication handler.
* Packaging of couchdb-bin must replace pre-split couchdb.
  (LP: #432219)
* Move all of /etc and /var out of the couchdb-bin package, to the
  couchdb package. 
* /etc/couchdb must be in couchdb-bin, as config files are needed
  by all servers.
  + So the couchdb user must be managed by couchdb-bin.
  + Split postinst/postrm files to manage different files.
  + Set Replaces of couchdb-bin by couchdb so that config files
    migrate.
* Update the version number in postrm.  (!)
* Use the new "Breaks" field in control file to help split pkg.

[Ken VanDine]
* debian/couchdb.install:
  - removed /var
* debian/rules:
  - removed bootstrap 
* debian/couchdb.postinst:
  - Added the debhelper tag

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
        {noreply, State#state{complete=true, changes_loop=nil}}
132
132
    end;
133
133
handle_changes_loop_exit(Reason, State) ->
134
 
    ?LOG_ERROR("changes_loop died with reason ~p", [Reason]),
135
 
    {stop, changes_loop_died, State#state{changes_loop=nil}}.
 
134
    {stop, Reason, State#state{changes_loop=nil}}.
136
135
 
137
136
changes_loop(OurServer, SourceChangesServer, Target) ->
138
137
    case couch_rep_changes_feed:next(SourceChangesServer) of
156
155
        body = {IdRevsList}
157
156
    },
158
157
    {Resp} = couch_rep_httpc:request(Request),
159
 
    {MissingRevs} = proplists:get_value(<<"missing_revs">>, Resp),
160
 
    X = [{Id, dict:fetch(Id, SeqDict), couch_doc:parse_revs(RevStrs)} ||
161
 
        {Id,RevStrs} <- MissingRevs],
162
 
    {HighSeq, X};
163
 
        
 
158
    case proplists:get_value(<<"missing_revs">>, Resp) of
 
159
    {MissingRevs} ->
 
160
        X = [{Id, dict:fetch(Id, SeqDict), couch_doc:parse_revs(RevStrs)} ||
 
161
            {Id,RevStrs} <- MissingRevs],
 
162
        {HighSeq, X};
 
163
    _ ->
 
164
        exit({target_error, proplists:get_value(<<"error">>, Resp)})
 
165
    end;
 
166
 
164
167
get_missing_revs(Target, Changes) ->
165
168
    Transform = fun({[{<<"seq">>,_}, {<<"id">>,Id}, {<<"changes">>,C}]}) ->
166
169
        {Id, [R || {[{<<"rev">>, R}]} <- C]} end,