From 8e20460fed4f35b624b53f4a1ccb3dd48727d544 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sun, 14 Sep 2014 11:05:57 +0200 Subject: WIP --- .gitmodules | 3 +++ github.js | 10 +++++++--- snap.html | 1 + store.js | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index b3a70fb..a8706a9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ +[submodule "vkBeautify"] + path = vkBeautify + url = https://github.com/vkiryukhin/vkBeautify [submodule "octokat.js"] path = octokat.js url = https://github.com/philschatz/octokat.js diff --git a/github.js b/github.js index 3d46578..0dc6ab5 100644 --- a/github.js +++ b/github.js @@ -179,10 +179,14 @@ GitHubBackend.prototype.saveProject = function (commitMessage, parentCommitSha, // diff parent <-> local codePatch = dmp.patch_make(parentCode, localCode); notePatch = dmp.patch_make(parentNotes, localNotes); - console.log(dmp.patch_toText(codePatch));//DEBUG + console.log(JSON.stringify(codePatch));//DEBUG // patch (parent<->local) => head - localCode = dmp.patch_apply(codePatch, headCode)[0]; - localNotes = dmp.patch_apply(notePatch, headNotes)[0]; + localCode = dmp.patch_apply(codePatch, headCode); + localNotes = dmp.patch_apply(notePatch, headNotes); + console.log('Code patched successfully? ' + localCode[1]); + console.log('Notes patched successfully? ' + localNotes[1]); + localCode = localCode[0]; + localNotes = localNotes[0]; // perform a `git merge` // TODO TODO TODO 422 Not a fast-forward diff --git a/snap.html b/snap.html index 89e24aa..4ee8478 100755 --- a/snap.html +++ b/snap.html @@ -21,6 +21,7 @@ +