From 037b79a0c64735d944eb23fb5cfad2675322fdf9 Mon Sep 17 00:00:00 2001 From: oleg Date: Sun, 22 Nov 2015 14:08:24 +0300 Subject: [PATCH] throw away workspace changes on repository update --- README.md | 1 + lib/scm/base.js | 2 +- lib/scm/git.js | 2 +- lib/scm/mercurial.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ee6c1dd..1e14a60 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ work in progress... * ~~Compile client for production~~ * Semantic versioning and plugins * ~~Complete uncompleted builds on server start~~ +* ~~Throw away workspace changes on repository update~~ Ui fixes diff --git a/lib/scm/base.js b/lib/scm/base.js index ad1c89d..222182a 100644 --- a/lib/scm/base.js +++ b/lib/scm/base.js @@ -52,7 +52,7 @@ Scm.prototype.getRev = function(rev, callback) { }; /** - * Updates to revision + * Updates to revision and throw away all local changes */ Scm.prototype.update = function(rev, callback) { }; diff --git a/lib/scm/git.js b/lib/scm/git.js index 3b5e717..dc864bc 100644 --- a/lib/scm/git.js +++ b/lib/scm/git.js @@ -154,5 +154,5 @@ Scm.prototype.getChanges = function(rev1, rev2, callback) { }; Scm.prototype.update = function(rev, callback) { - this.run({cmd: 'git', args: ['checkout', rev]}, callback); + this.run({cmd: 'git', args: ['checkout', '-f', rev]}, callback); }; diff --git a/lib/scm/mercurial.js b/lib/scm/mercurial.js index e58ab30..2cf50c7 100644 --- a/lib/scm/mercurial.js +++ b/lib/scm/mercurial.js @@ -113,5 +113,5 @@ Scm.prototype.getChanges = function(rev1, rev2, callback) { }; Scm.prototype.update = function(rev, callback) { - this.run({cmd: 'hg', args: ['up', rev]}, callback); + this.run({cmd: 'hg', args: ['up', '-C', rev]}, callback); };