Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Junming
jio
Commits
7110ea18
Commit
7110ea18
authored
Dec 26, 2012
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revisionstorage.js post method replace empty docid to an uuid
parent
f1c3480d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
src/jio.storage/revisionstorage.js
src/jio.storage/revisionstorage.js
+11
-6
No files found.
src/jio.storage/revisionstorage.js
View file @
7110ea18
...
...
@@ -260,12 +260,13 @@ jIO.addStorageType('revision', function (spec, my) {
* @param {object} command The JIO command
*/
that
.
post
=
function
(
command
)
{
var
f
=
{},
doctree
,
revs_info
,
doc
;
var
f
=
{},
doctree
,
revs_info
,
doc
,
docid
;
doc
=
command
.
cloneDoc
();
docid
=
command
.
getDocId
();
if
(
typeof
doc
.
_rev
===
"
string
"
&&
priv
.
checkRevisionFormat
(
doc
.
_rev
))
{
that
.
error
({
"
status
"
:
3
0
,
"
status
"
:
3
1
,
"
statusText
"
:
"
Wrong Revision Format
"
,
"
error
"
:
"
wrong_revision_format
"
,
"
message
"
:
"
The document previous revision does not match
"
+
...
...
@@ -274,6 +275,10 @@ jIO.addStorageType('revision', function (spec, my) {
});
return
;
}
if
(
typeof
docid
!==
"
string
"
)
{
doc
.
_id
=
priv
.
generateUuid
();
docid
=
doc
.
_id
;
}
f
.
getDocumentTree
=
function
()
{
var
option
=
command
.
cloneOption
();
if
(
option
[
"
max_retry
"
]
===
0
)
{
...
...
@@ -282,7 +287,7 @@ jIO.addStorageType('revision', function (spec, my) {
that
.
addJob
(
"
get
"
,
priv
.
substorage
,
command
.
getDocId
()
+
priv
.
doctree_suffix
,
docid
+
priv
.
doctree_suffix
,
option
,
function
(
response
)
{
doctree
=
response
;
...
...
@@ -303,7 +308,7 @@ jIO.addStorageType('revision', function (spec, my) {
};
f
.
postDocument
=
function
(
doctree_update_method
)
{
revs_info
=
priv
.
postToDocumentTree
(
doctree
,
doc
);
doc
.
_id
=
command
.
getDocId
()
+
"
.
"
+
revs_info
[
0
].
rev
;
doc
.
_id
=
docid
+
"
.
"
+
revs_info
[
0
].
rev
;
that
.
addJob
(
"
post
"
,
priv
.
substorage
,
...
...
@@ -326,7 +331,7 @@ jIO.addStorageType('revision', function (spec, my) {
);
};
f
.
sendDocumentTree
=
function
(
method
)
{
doctree
.
_id
=
command
.
getDocId
()
+
priv
.
doctree_suffix
;
doctree
.
_id
=
docid
+
priv
.
doctree_suffix
;
that
.
addJob
(
method
,
priv
.
substorage
,
...
...
@@ -335,7 +340,7 @@ jIO.addStorageType('revision', function (spec, my) {
function
(
response
)
{
that
.
success
({
"
ok
"
:
true
,
"
id
"
:
command
.
getDocId
()
,
"
id
"
:
docid
,
"
rev
"
:
revs_info
[
0
].
rev
})
},
function
(
err
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment