summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-02-07 19:54:42 -0500
committerKris Maglione <maglione.k@gmail.com>2011-02-07 19:54:42 -0500
commite9a18c1a5a61f68578ead11600284b9560169471 (patch)
tree5f3dc2bb2bf27c715165e13569d48f97d09347b3
parentee03cbd2ce56b0f00f44c2a461adbd300c1ff943 (diff)
downloadpentadactyl-e9a18c1a5a61f68578ead11600284b9560169471.tar.gz
Bake hg version into install.rdf on XPI build. Warn users who are running in a testing branch.
--HG-- branch : groups
-rw-r--r--common/Makefile19
-rw-r--r--common/content/buffer.js6
-rw-r--r--common/content/mow.js6
-rw-r--r--common/modules/config.jsm30
-rw-r--r--common/modules/overlay.jsm1
5 files changed, 48 insertions, 14 deletions
diff --git a/common/Makefile b/common/Makefile
index 40012c05..c551ec66 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -32,7 +32,7 @@ CHROME = $(MANGLE)/
JAR = $(CHROME)$(NAME).jar
XPI_BASES = $(JAR_BASES) $(TOP)/..
-XPI_FILES = bootstrap.js install.rdf TODO AUTHORS Donors NEWS LICENSE.txt
+XPI_FILES = bootstrap.js TODO AUTHORS Donors NEWS LICENSE.txt
XPI_DIRS = components $(MANGLE) defaults
XPI_TEXTS = js jsm $(JAR_TEXTS)
XPI_BINS = $(JAR_BINS)
@@ -49,6 +49,9 @@ BUILD_DIR = build.$(VERSION).$(OS)
AWK ?= awk
B64ENCODE ?= base64
CURL ?= curl
+SED := $(shell if [ "xoo" = x$$(echo foo | sed -E 's/f(o)/\1/' 2>/dev/null) ]; \
+ then echo sed -E; else echo sed -r; \
+ fi)
.SILENT:
@@ -174,11 +177,19 @@ test: xpi
xpi: $(CHROME)
@echo "Building XPI..."
mkdir -p "$(XPI_PATH)"
-
+
$(AWK) -v 'name=$(NAME)' -v 'suffix=$(MANGLE)' \
-f $(BASE)/process_manifest.awk \
- $(TOP)/chrome.manifest >"$(XPI_PATH)/chrome.manifest"
-
+ "$(TOP)/chrome.manifest" >"$(XPI_PATH)/chrome.manifest"
+
+ version="$(VERSION)"; \
+ hg root >/dev/null 2>&1 && \
+ case "$$version" in \
+ *pre) version="$$version-hg$$(hg log -r . --template '{rev}')-$$(hg branch)";; \
+ esac; \
+ $(SED) -e 's/(em:version(>|="))([^"<]+)/\1'"$$version/" \
+ <"$(TOP)/install.rdf" >"$(XPI_PATH)/install.rdf"
+
$(MAKE_JAR) "$(XPI)" "$(XPI_BASES)" "$(XPI_DIRS)" "$(XPI_TEXTS)" "$(XPI_BINS)" "$(XPI_FILES)"
rm -r -- $(CHROME)
@echo "Built XPI: $(XPI)"
diff --git a/common/content/buffer.js b/common/content/buffer.js
index 4b691261..c919b517 100644
--- a/common/content/buffer.js
+++ b/common/content/buffer.js
@@ -259,8 +259,6 @@ var Buffer = Module("buffer", {
* @property {Object} The document loading progress listener.
*/
progressListener: {
- dactylLoadCount: 0,
-
// XXX: function may later be needed to detect a canceled synchronous openURL()
onStateChange: util.wrapCallback(function onStateChange(webProgress, request, flags, status) {
onStateChange.superapply(this, arguments);
@@ -273,10 +271,6 @@ var Buffer = Module("buffer", {
statusline.progress = 0;
buffer._triggerLoadAutocmd("PageLoadPre", webProgress.DOMWindow.document);
-
- if (document.commandDispatcher.focusedWindow == webProgress.DOMWindow && this.dactylLoadCount++)
- util.timeout(function () { modes.reset(false); },
- modes.main == modes.HINTS ? 500 : 0);
}
else if (flags & Ci.nsIWebProgressListener.STATE_STOP) {
// Workaround for bugs 591425 and 606877, dactyl bug #81
diff --git a/common/content/mow.js b/common/content/mow.js
index 24d65da3..9fdd6cee 100644
--- a/common/content/mow.js
+++ b/common/content/mow.js
@@ -80,8 +80,8 @@ var MOW = Module("mow", {
widgets: Class.memoize(function () commandline.widgets),
body: Class.memoize(function () this.widget.contentDocument.documentElement),
- document: Class.memoize(function () this.widget.contentDocument),
- window: Class.memoize(function () this.widget.contentWindow),
+ get document() this.widget.contentDocument,
+ get window() this.widget.contentWindow,
/**
* Display a multi-line message.
@@ -90,6 +90,8 @@ var MOW = Module("mow", {
* @param {string} highlightGroup
*/
echo: function echo(data, highlightGroup, silent) {
+ this.document;
+ util.dump(String(this.widget), String(this.window), String(this.document));
let body = this.document.body;
this.widgets.message = null;
diff --git a/common/modules/config.jsm b/common/modules/config.jsm
index 4da97e04..ea88bbc1 100644
--- a/common/modules/config.jsm
+++ b/common/modules/config.jsm
@@ -115,6 +115,23 @@ var ConfigBase = Class("ConfigBase", {
.nth(function (l) set.has(langs, l), 0);
},
+ haveHg: Class.memoize(function () {
+ if (/pre$/.test(this.addon.version)) {
+ let uri = this.addon.getResourceURI("../.hg");
+ if (uri instanceof Ci.nsIFileURL &&
+ uri.QueryInterface(Ci.nsIFileURL).file.exists() &&
+ io.pathSearch("hg"))
+ return ["hg", "-R", uri.file.parent.path];
+ }
+ return null;
+ }),
+
+ branch: Class.memoize(function () {
+ if (this.haveHg)
+ return io.system(this.haveHg.concat(["branch"])).output;
+ return (/pre-hg\d+-(.*)$/.exec(this.version) || [])[1];
+ }),
+
/** @property {string} The Dactyl version string. */
version: Class.memoize(function () {
if (/pre$/.test(this.addon.version)) {
@@ -124,11 +141,11 @@ var ConfigBase = Class("ConfigBase", {
io.pathSearch("hg")) {
return io.system(["hg", "-R", uri.file.parent.path,
"log", "-r.",
- "--template=hg{rev} ({date|isodate})"]).output;
+ "--template=hg{rev}-" + this.branch + " ({date|isodate})"]).output;
}
}
let version = this.addon.version;
- if ("@DATE" !== "@" + "DATE@")
+ if ("@DATE@" !== "@" + "DATE@")
version += " (created: @DATE@)";
return version;
}),
@@ -723,6 +740,15 @@ config.INIT = update(Object.create(config.INIT), config.INIT, {
{"}"}</>);
img = null;
};
+ },
+
+ load: function load(dactyl, modules, window) {
+ load.superapply(this, arguments);
+
+ if (this.branch && this.branch !== "default" &&
+ modules.yes_i_know_i_should_not_report_errors_in_these_branches_thanks.indexOf(this.branch) === -1)
+ dactyl.warn("You are running " + config.appName + " from a testing branch: " + this.branch + ". " +
+ "Please do not report errors which do not also occur in the default branch.");
}
});
diff --git a/common/modules/overlay.jsm b/common/modules/overlay.jsm
index 957e7773..af88c6be 100644
--- a/common/modules/overlay.jsm
+++ b/common/modules/overlay.jsm
@@ -102,6 +102,7 @@ var Overlay = Module("Overlay", {
const jsmodules = { NAME: "jsmodules" };
const modules = update(create(jsmodules), {
+ yes_i_know_i_should_not_report_errors_in_these_branches_thanks: [],
jsmodules: jsmodules,