diff --git a/package.json b/package.json index 57480426..c66f7c61 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ "c9.ide.language.javascript.infer": "#b9c2e4bdb8", "c9.ide.language.jsonalyzer": "#72954f8da1", "c9.ide.language.codeintel": "#4e0a272229", - "c9.ide.collab": "#6bda028b24", + "c9.ide.collab": "#c8cab470b1", "c9.ide.local": "#9169fec157", "c9.ide.find": "#a2dfc3e306", "c9.ide.find.infiles": "#488db22ee1", diff --git a/plugins/c9.ide.watcher/gui.js b/plugins/c9.ide.watcher/gui.js index c82f0b98..96e4ec7c 100644 --- a/plugins/c9.ide.watcher/gui.js +++ b/plugins/c9.ide.watcher/gui.js @@ -154,6 +154,15 @@ define(function(require, exports, module) { } }); + collab.on("resolveConflict", function (e) { + var tab = tabManager.findTab(e.path); + if (tab) { + var doc = tab.document; + var path = tab.path + resolveConflict(doc, path); + } + }) + watcher.on("delete", function(e) { var tab = tabManager.findTab(e.path); if (tab) @@ -163,6 +172,12 @@ define(function(require, exports, module) { /***** Methods *****/ + function resolveConflict(doc, path) { + doc.tab.classList.remove("conflict"); + delete doc.meta.$merge; + delete changedPaths[path]; + } + function addChangedTab(tab, doubleCheckComparisonType) { // If we already have a dialog open, just update it, but mark the value dirty if (changedPaths[tab.path]) { @@ -178,6 +193,9 @@ define(function(require, exports, module) { return; } + var doc = tab.document; + var path = tab.path; + changedPaths[tab.path] = { tab: tab, resolve: resolve }; // If the terminal is currently focussed, lets wait until @@ -191,14 +209,10 @@ define(function(require, exports, module) { } function resolve() { - doc.tab.classList.remove("conflict"); - delete doc.meta.$merge; - delete changedPaths[path]; + collab.send({type: "RESOLVE_CONFLICT", data: {path: path}}); + resolveConflict(doc, path); } - var doc = tab.document; - var path = tab.path; - switch (doubleCheckComparisonType) { case comparisonType.TIMESTAMP_AND_CONTENTS: checkByStatOrContents();