cleanup of merge

This commit is contained in:
ekatek
2014-05-28 16:10:29 -07:00
parent 5ebbbdbc63
commit 831967dd60
4 changed files with 48 additions and 6 deletions

View File

@@ -14,6 +14,8 @@ var watch = require('./watch.js');
var files = require('./files.js');
var utils = require('./utils.js');
var baseCatalog = require('./catalog-base.js').BaseCatalog;
var files = require('./files.js');
var fiberHelpers = require('./fiber-helpers.js');
var catalog = exports;
@@ -53,11 +55,54 @@ _.extend(ServerCatalog.prototype, {
// The server catalog is always initialized.
self.initialized = true;
// This is set to an array while refresh() is running; if another refresh()
// call happens during a yield, instead of doing a second refresh it just
// waits for the first to finish.
self._refreshFutures = null;
},
// Refresh the packages in the catalog. Print a warning if we cannot connect
// to the package server.
//
// If a refresh is already in progress (which is yielding), it just waits for
// the in-progress refresh to finish.
refresh: function () {
var self = this;
self._requireInitialized();
if (self._refreshFutures) {
var f = new Future;
self._refreshFutures.push(f);
f.wait();
return;
}
self._refreshFutures = [];
var thrownError = null;
try {
self._refresh();
} catch (e) {
thrownError = e;
}
while (self._refreshFutures.length) {
var fut = self._refreshFutures.pop();
if (thrownError) {
// XXX is it really right to throw the same error multiple times?
fut.throw(thrownError);
} else {
fut.return();
}
}
self._refreshFutures = null;
},
// Refresh the packages in the catalog. Prints a warning if we cannot connect
// to the package server, and intend to.
refresh: function () {
_refresh: function () {
var self = this;
var localData = packageClient.loadCachedServerData();
@@ -232,7 +277,6 @@ _.extend(CompleteCatalog.prototype, {
// project root path has not been initialized, we are probably running
// outside of a project, and have nothing to look at for guidance.
if (opts.ignoreProjectDeps || !project.rootDir) {
console.log("ignore project deps & resolve");
return self.resolver.resolve(deps, constr, resolverOpts);
}

View File

@@ -511,7 +511,6 @@ main.registerCommand({
// OK, let's figure out what release fits with our package constraints!
<<<<<<< HEAD
// XXX this will actually be a loop over possible releases in the non-force
// case
// XXX better error checking on name
@@ -542,7 +541,6 @@ main.registerCommand({
// XXX did we have to change some package versions? we should probably
// mention that fact.
// XXX error handling.
=======
var releaseVersionsToTry;
if (release.forced) {
releaseVersionsToTry = [release.current.getReleaseVersion()];

View File

@@ -100,7 +100,6 @@ var Project = function () {
self._depsUpToDate = false;
};
<<<<<<< HEAD
_.extend(Project.prototype, {
// Set a given root directory as the project's root directory. Figure out all
// relevant file paths and read in data that is independent of the constraint

View File

@@ -70,7 +70,7 @@ exports.getHost = function () {
if (output) {
ret = output.trim();
}
}
};
if (archinfo.matches(archinfo.host(), 'os.osx')) {
// On OSX, to get the human-readable hostname that the user chose,
@@ -273,6 +273,7 @@ exports.isDirectory = function (dir) {
return false;
}
return stats.isDirectory();
};
// XXX from Underscore.String (http://epeli.github.com/underscore.string/)
exports.startsWith = function(str, starts) {