diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-06-27 14:32:36 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-06-27 14:32:36 +0000 |
commit | 57326fb4942281109d21fef403f51867c8f984f7 (patch) | |
tree | e949498fa1f96b8394753bdb38c5dcefbffd7735 /src/couchdb/couch_httpd_db.erl | |
parent | 11e6db89380142ada9638d02614beea2952d9b86 (diff) |
removed some dead code found by Dialyzer, more to come
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@788979 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_httpd_db.erl')
-rw-r--r-- | src/couchdb/couch_httpd_db.erl | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/couchdb/couch_httpd_db.erl b/src/couchdb/couch_httpd_db.erl index d1d90c63..8c692f8d 100644 --- a/src/couchdb/couch_httpd_db.erl +++ b/src/couchdb/couch_httpd_db.erl @@ -637,19 +637,16 @@ db_doc_req(#httpd{method='COPY'}=Req, Db, SourceDocId) -> missing_rev -> nil; Rev -> Rev end, - {TargetDocId, TargetRevs} = parse_copy_destination_header(Req), - - % open revision Rev or Current + % open old doc Doc = couch_doc_open(Db, SourceDocId, SourceRev, []), % save new doc - case couch_db:update_doc(Db, Doc#doc{id=TargetDocId, revs=TargetRevs}, []) of - {ok, NewTargetRev} -> - send_json(Req, 201, [{"Etag", "\"" ++ ?b2l(couch_doc:rev_to_str(NewTargetRev)) ++ "\""}], - update_doc_result_to_json(TargetDocId, {ok, NewTargetRev})); - Error -> - throw(Error) - end; + {ok, NewTargetRev} = couch_db:update_doc(Db, + Doc#doc{id=TargetDocId, revs=TargetRevs}, []), + % respond + send_json(Req, 201, + [{"Etag", "\"" ++ ?b2l(couch_doc:rev_to_str(NewTargetRev)) ++ "\""}], + update_doc_result_to_json(TargetDocId, {ok, NewTargetRev})); db_doc_req(Req, _Db, _DocId) -> send_method_not_allowed(Req, "DELETE,GET,HEAD,POST,PUT,COPY"). |