dav/sync.c

changeset 616
0b61755f2852
parent 615
ab669d21f82a
child 617
1c995e93bf40
equal deleted inserted replaced
615:ab669d21f82a 616:0b61755f2852
949 949
950 DavBool issplit = dav_get_property(res, "idav:split") ? TRUE : FALSE; 950 DavBool issplit = dav_get_property(res, "idav:split") ? TRUE : FALSE;
951 if(issplit) { 951 if(issplit) {
952 util_remove_trailing_pathseparator(res->path); 952 util_remove_trailing_pathseparator(res->path);
953 } 953 }
954 DavBool iscollection = res->iscollection && !issplit;
954 955
955 RemoteChangeType type = cmd_getoption(a, "conflict") ? 956 RemoteChangeType type = cmd_getoption(a, "conflict") ?
956 REMOTE_CHANGE_MODIFIED : REMOTE_CHANGE_CONFLICT_LOCAL_MODIFIED; 957 REMOTE_CHANGE_MODIFIED : REMOTE_CHANGE_CONFLICT_LOCAL_MODIFIED;
957 958
958 LocalResource *local = ucx_map_cstr_get(db->resources, res->path); 959 LocalResource *local = ucx_map_cstr_get(db->resources, res->path);
971 } 972 }
972 exists = 0; 973 exists = 0;
973 } 974 }
974 975
975 RemoteChangeType ret = REMOTE_NO_CHANGE; 976 RemoteChangeType ret = REMOTE_NO_CHANGE;
976 if(res->iscollection && !issplit) { 977 if(iscollection) {
977 if(!exists) { 978 if(!exists) {
978 ret = REMOTE_CHANGE_MKDIR; 979 ret = REMOTE_CHANGE_MKDIR;
980 } else if(local && S_ISDIR(s.st_mode)) {
981 local->isdirectory = 1; // make sure isdirectory is set
982 } else {
983 // TODO: conflict
984 ret = REMOTE_NO_CHANGE;
979 } 985 }
980 } else if(local) { 986 } else if(local) {
981 DavBool nochange = FALSE; 987 DavBool nochange = FALSE;
982 char *content_hash = sync_get_content_hash(res); 988 char *content_hash = sync_get_content_hash(res);
983 989

mercurial