Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
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
nexedi
officejs
Commits
f5fefea0
Commit
f5fefea0
authored
Aug 20, 2012
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug: get method from conflict manager storage can return conflicts
parent
1a985dad
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
37 deletions
+56
-37
OfficeJS/lib/jio/jio.storage.js
OfficeJS/lib/jio/jio.storage.js
+24
-17
OfficeJS/lib/jio/jio.storage.min.js
OfficeJS/lib/jio/jio.storage.min.js
+2
-2
OfficeJS/src/jio.storage/conflictmanagerstorage.js
OfficeJS/src/jio.storage/conflictmanagerstorage.js
+23
-16
OfficeJS/test/jiotests.js
OfficeJS/test/jiotests.js
+7
-2
No files found.
OfficeJS/lib/jio/jio.storage.js
View file @
f5fefea0
/*! JIO Storage - v0.1.0 - 2012-08-
16
/*! JIO Storage - v0.1.0 - 2012-08-
20
* Copyright (c) 2012 Nexedi; Licensed */
* Copyright (c) 2012 Nexedi; Licensed */
(
function
(
LocalOrCookieStorage
,
$
,
Base64
,
sjcl
,
hex_sha256
,
Jio
)
{
(
function
(
LocalOrCookieStorage
,
$
,
Base64
,
sjcl
,
hex_sha256
,
Jio
)
{
...
@@ -1793,13 +1793,6 @@ var newConflictManagerStorage = function ( spec, my ) {
...
@@ -1793,13 +1793,6 @@ var newConflictManagerStorage = function ( spec, my ) {
doc
.
_creation_date
=
doc
.
_creation_date
=
metadata_file_content
[
current_revision
].
_creation_date
;
metadata_file_content
[
current_revision
].
_creation_date
;
doc
.
_rev
=
current_revision
;
doc
.
_rev
=
current_revision
;
if
(
command
.
getOption
(
'
revs
'
))
{
doc
.
_revisions
=
priv
.
_revs
(
metadata_file_content
,
current_revision
);
}
if
(
command
.
getOption
(
'
revs_info
'
))
{
doc
.
_revs_info
=
priv
.
_revs_info
(
metadata_file_content
);
}
if
(
metadata_only
)
{
if
(
metadata_only
)
{
am
.
call
(
o
,
'
success
'
);
am
.
call
(
o
,
'
success
'
);
}
else
{
}
else
{
...
@@ -1822,7 +1815,7 @@ var newConflictManagerStorage = function ( spec, my ) {
...
@@ -1822,7 +1815,7 @@ var newConflictManagerStorage = function ( spec, my ) {
);
);
};
};
o
.
checkForConflicts
=
function
()
{
o
.
checkForConflicts
=
function
()
{
if
(
metadata_file_content
[
current_revision
].
conflict
)
{
if
(
metadata_file_content
[
current_revision
].
_
conflict
)
{
on_conflict
=
true
;
on_conflict
=
true
;
conflict_object
=
conflict_object
=
priv
.
createConflictObject
(
priv
.
createConflictObject
(
...
@@ -1831,25 +1824,39 @@ var newConflictManagerStorage = function ( spec, my ) {
...
@@ -1831,25 +1824,39 @@ var newConflictManagerStorage = function ( spec, my ) {
current_revision
current_revision
);
);
}
}
if
(
command
.
getOption
(
'
conflicts
'
))
{
doc
.
_conflicts
=
conflict_object
;
}
am
.
call
(
o
,
'
success
'
);
am
.
call
(
o
,
'
success
'
);
};
};
o
.
success
=
function
(){
o
.
success
=
function
(){
am
.
neverCall
(
o
,
'
error
'
);
am
.
neverCall
(
o
,
'
error
'
);
am
.
neverCall
(
o
,
'
success
'
);
am
.
neverCall
(
o
,
'
success
'
);
if
(
command
.
getOption
(
'
revs
'
))
{
doc
.
_revisions
=
priv
.
_revs
(
metadata_file_content
,
current_revision
);
}
if
(
command
.
getOption
(
'
revs_info
'
))
{
doc
.
_revs_info
=
priv
.
_revs_info
(
metadata_file_content
);
}
if
(
command
.
getOption
(
'
conflicts
'
))
{
doc
.
_conflicts
=
conflict_object
;
}
that
.
success
(
doc
);
that
.
success
(
doc
);
};
};
o
.
error
=
function
(
error
){
o
.
error
=
function
(
error
)
{
var
gooderro
r
=
error
||
{
status
:
0
,
statusText
:
'
Unknown
'
,
var
er
r
=
error
||
{
status
:
0
,
statusText
:
'
Unknown
'
,
message
:
'
Unknown error.
'
};
message
:
'
Unknown error.
'
};
if
(
on_conflict
)
{
if
(
command
.
getOption
(
'
revs
'
))
{
gooderror
.
conflict_object
=
conflict_object
;
err
.
_revisions
=
priv
.
_revs
(
metadata_file_content
,
current_revision
);
}
if
(
command
.
getOption
(
'
revs_info
'
))
{
err
.
_revs_info
=
priv
.
_revs_info
(
metadata_file_content
);
}
if
(
command
.
getOption
(
'
conflicts
'
))
{
err
.
_conflicts
=
conflict_object
;
}
}
am
.
neverCall
(
o
,
'
error
'
);
am
.
neverCall
(
o
,
'
error
'
);
am
.
neverCall
(
o
,
'
success
'
);
am
.
neverCall
(
o
,
'
success
'
);
that
.
error
(
gooderro
r
);
that
.
error
(
er
r
);
};
};
am
.
call
(
o
,
'
getDistantMetadata
'
);
am
.
call
(
o
,
'
getDistantMetadata
'
);
};
};
...
...
OfficeJS/lib/jio/jio.storage.min.js
View file @
f5fefea0
This diff is collapsed.
Click to expand it.
OfficeJS/src/jio.storage/conflictmanagerstorage.js
View file @
f5fefea0
...
@@ -569,13 +569,6 @@ var newConflictManagerStorage = function ( spec, my ) {
...
@@ -569,13 +569,6 @@ var newConflictManagerStorage = function ( spec, my ) {
doc
.
_creation_date
=
doc
.
_creation_date
=
metadata_file_content
[
current_revision
].
_creation_date
;
metadata_file_content
[
current_revision
].
_creation_date
;
doc
.
_rev
=
current_revision
;
doc
.
_rev
=
current_revision
;
if
(
command
.
getOption
(
'
revs
'
))
{
doc
.
_revisions
=
priv
.
_revs
(
metadata_file_content
,
current_revision
);
}
if
(
command
.
getOption
(
'
revs_info
'
))
{
doc
.
_revs_info
=
priv
.
_revs_info
(
metadata_file_content
);
}
if
(
metadata_only
)
{
if
(
metadata_only
)
{
am
.
call
(
o
,
'
success
'
);
am
.
call
(
o
,
'
success
'
);
}
else
{
}
else
{
...
@@ -598,7 +591,7 @@ var newConflictManagerStorage = function ( spec, my ) {
...
@@ -598,7 +591,7 @@ var newConflictManagerStorage = function ( spec, my ) {
);
);
};
};
o
.
checkForConflicts
=
function
()
{
o
.
checkForConflicts
=
function
()
{
if
(
metadata_file_content
[
current_revision
].
conflict
)
{
if
(
metadata_file_content
[
current_revision
].
_
conflict
)
{
on_conflict
=
true
;
on_conflict
=
true
;
conflict_object
=
conflict_object
=
priv
.
createConflictObject
(
priv
.
createConflictObject
(
...
@@ -607,25 +600,39 @@ var newConflictManagerStorage = function ( spec, my ) {
...
@@ -607,25 +600,39 @@ var newConflictManagerStorage = function ( spec, my ) {
current_revision
current_revision
);
);
}
}
if
(
command
.
getOption
(
'
conflicts
'
))
{
doc
.
_conflicts
=
conflict_object
;
}
am
.
call
(
o
,
'
success
'
);
am
.
call
(
o
,
'
success
'
);
};
};
o
.
success
=
function
(){
o
.
success
=
function
(){
am
.
neverCall
(
o
,
'
error
'
);
am
.
neverCall
(
o
,
'
error
'
);
am
.
neverCall
(
o
,
'
success
'
);
am
.
neverCall
(
o
,
'
success
'
);
if
(
command
.
getOption
(
'
revs
'
))
{
doc
.
_revisions
=
priv
.
_revs
(
metadata_file_content
,
current_revision
);
}
if
(
command
.
getOption
(
'
revs_info
'
))
{
doc
.
_revs_info
=
priv
.
_revs_info
(
metadata_file_content
);
}
if
(
command
.
getOption
(
'
conflicts
'
))
{
doc
.
_conflicts
=
conflict_object
;
}
that
.
success
(
doc
);
that
.
success
(
doc
);
};
};
o
.
error
=
function
(
error
){
o
.
error
=
function
(
error
)
{
var
gooderro
r
=
error
||
{
status
:
0
,
statusText
:
'
Unknown
'
,
var
er
r
=
error
||
{
status
:
0
,
statusText
:
'
Unknown
'
,
message
:
'
Unknown error.
'
};
message
:
'
Unknown error.
'
};
if
(
on_conflict
)
{
if
(
command
.
getOption
(
'
revs
'
))
{
gooderror
.
conflict_object
=
conflict_object
;
err
.
_revisions
=
priv
.
_revs
(
metadata_file_content
,
current_revision
);
}
if
(
command
.
getOption
(
'
revs_info
'
))
{
err
.
_revs_info
=
priv
.
_revs_info
(
metadata_file_content
);
}
if
(
command
.
getOption
(
'
conflicts
'
))
{
err
.
_conflicts
=
conflict_object
;
}
}
am
.
neverCall
(
o
,
'
error
'
);
am
.
neverCall
(
o
,
'
error
'
);
am
.
neverCall
(
o
,
'
success
'
);
am
.
neverCall
(
o
,
'
success
'
);
that
.
error
(
gooderro
r
);
that
.
error
(
er
r
);
};
};
am
.
call
(
o
,
'
getDistantMetadata
'
);
am
.
call
(
o
,
'
getDistantMetadata
'
);
};
};
...
...
OfficeJS/test/jiotests.js
View file @
f5fefea0
...
@@ -1622,6 +1622,7 @@ test ('Revision Conflict', function() {
...
@@ -1622,6 +1622,7 @@ test ('Revision Conflict', function() {
o
.
rev
.
third
=
err
.
rev
;
o
.
rev
.
third
=
err
.
rev
;
err
.
rev
=
checkRev
(
err
.
rev
);
err
.
rev
=
checkRev
(
err
.
rev
);
if
(
err
.
conflicts
&&
err
.
conflicts
.
rows
)
{
if
(
err
.
conflicts
&&
err
.
conflicts
.
rows
)
{
o
.
tmp
=
err
.
conflicts
;
o
.
solveConflict
=
checkConflictRow
(
err
.
conflicts
.
rows
[
0
]);
o
.
solveConflict
=
checkConflictRow
(
err
.
conflicts
.
rows
[
0
]);
}
}
for
(
k
in
{
'
error
'
:
0
,
'
message
'
:
0
,
'
reason
'
:
0
,
'
statusText
'
:
0
})
{
for
(
k
in
{
'
error
'
:
0
,
'
message
'
:
0
,
'
reason
'
:
0
,
'
statusText
'
:
0
})
{
...
@@ -1654,11 +1655,15 @@ test ('Revision Conflict', function() {
...
@@ -1654,11 +1655,15 @@ test ('Revision Conflict', function() {
o
.
tick
(
o
);
o
.
tick
(
o
);
o
.
checkContent
(
'
file.doc.
'
+
o
.
rev
.
third
);
o
.
checkContent
(
'
file.doc.
'
+
o
.
rev
.
third
);
// loading test
// loading test
o
.
spy
(
o
,
'
value
'
,{
_id
:
'
file.doc
'
,
_rev
:
o
.
rev
.
third
,
content
:
'
content3
'
},
o
.
spy
(
o
,
'
value
'
,{
_id
:
'
file.doc
'
,
_rev
:
o
.
rev
.
third
,
content
:
'
content3
'
,
_conflicts
:
o
.
tmp
},
'
loading "file.doc" -> conflict!
'
);
'
loading "file.doc" -> conflict!
'
);
o
.
jio
.
get
(
'
file.doc
'
,
function
(
err
,
val
)
{
o
.
jio
.
get
(
'
file.doc
'
,
{
conflicts
:
true
},
function
(
err
,
val
)
{
var
k
;
var
k
;
if
(
val
)
{
if
(
val
)
{
if
(
val
.
_conflicts
&&
val
.
_conflicts
.
rows
)
{
checkConflictRow
(
val
.
_conflicts
.
rows
[
0
]);
}
for
(
k
in
{
'
_creation_date
'
:
0
,
'
_last_modified
'
:
0
})
{
for
(
k
in
{
'
_creation_date
'
:
0
,
'
_last_modified
'
:
0
})
{
if
(
val
[
k
])
{
if
(
val
[
k
])
{
delete
val
[
k
];
delete
val
[
k
];
...
...
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