LEFT | RIGHT |
1 # HG changeset patch | 1 # HG changeset patch |
2 # User Felix Dahlke <felix@adblockplus.org> | 2 # User Felix Dahlke <felix@adblockplus.org> |
3 # Date 1431547667 -7200 | 3 # Date 1431547667 -7200 |
4 # Wed May 13 22:07:47 2015 +0200 | 4 # Wed May 13 22:07:47 2015 +0200 |
5 # Node ID 76ddc7678a914cbcdcc2cd8132c09e8bcdd10125 | 5 # Node ID 7e0cd0610aecdfe47450a26ae6e13c81fcb60d81 |
6 # Parent ae1c968784024553c3a2eaf4c446757798be7e13 | 6 # Parent ae1c968784024553c3a2eaf4c446757798be7e13 |
7 Issue 2510 - Support Adblock Browser | 7 Issue 2510 - Support Adblock Browser |
8 | 8 |
9 diff -r ae1c96878402 -r 76ddc7678a91 chrome.manifest | 9 diff -r ae1c96878402 -r 7e0cd0610aec chrome.manifest |
10 --- a/chrome.manifest Tue May 12 23:01:08 2015 +0200 | 10 --- a/chrome.manifest Tue May 12 23:01:08 2015 +0200 |
11 +++ b/chrome.manifest Wed May 13 22:07:47 2015 +0200 | 11 +++ b/chrome.manifest Wed May 13 22:07:47 2015 +0200 |
12 @@ -3,4 +3,4 @@ | 12 @@ -3,4 +3,4 @@ |
13 locale adblockplus {{LOCALE}} chrome/locale/{{LOCALE}}/ | 13 locale adblockplus {{LOCALE}} chrome/locale/{{LOCALE}}/ |
14 | 14 |
15 # fennec settings | 15 # fennec settings |
16 -override chrome://adblockplus/content/ui/settings.xul chrome://adblockplus/cont
ent/ui/fennecSettings.xul application={a23983c0-fd0e-11dc-95ff-0800200c9a66} app
lication={aa3c5121-dab2-40e2-81ca-7ea25febc110} | 16 -override chrome://adblockplus/content/ui/settings.xul chrome://adblockplus/cont
ent/ui/fennecSettings.xul application={a23983c0-fd0e-11dc-95ff-0800200c9a66} app
lication={aa3c5121-dab2-40e2-81ca-7ea25febc110} |
17 +override chrome://adblockplus/content/ui/settings.xul chrome://adblockplus/cont
ent/ui/fennecSettings.xul application={a23983c0-fd0e-11dc-95ff-0800200c9a66} app
lication={aa3c5121-dab2-40e2-81ca-7ea25febc110} application={55aba3ac-94d3-41a8-
9e25-5c21fe874539} | 17 +override chrome://adblockplus/content/ui/settings.xul chrome://adblockplus/cont
ent/ui/fennecSettings.xul application={a23983c0-fd0e-11dc-95ff-0800200c9a66} app
lication={aa3c5121-dab2-40e2-81ca-7ea25febc110} application={55aba3ac-94d3-41a8-
9e25-5c21fe874539} |
18 diff -r ae1c96878402 -r 76ddc7678a91 dependencies | 18 diff -r ae1c96878402 -r 7e0cd0610aec dependencies |
19 --- a/dependencies Tue May 12 23:01:08 2015 +0200 | 19 --- a/dependencies Tue May 12 23:01:08 2015 +0200 |
20 +++ b/dependencies Wed May 13 22:07:47 2015 +0200 | 20 +++ b/dependencies Wed May 13 22:07:47 2015 +0200 |
21 @@ -1,4 +1,4 @@ | 21 @@ -1,4 +1,4 @@ |
22 _root = hg:https://hg.adblockplus.org/ git:https://github.com/adblockplus/ | 22 _root = hg:https://hg.adblockplus.org/ git:https://github.com/adblockplus/ |
23 _self = buildtools/ensure_dependencies.py | 23 _self = buildtools/ensure_dependencies.py |
24 -buildtools = buildtools hg:97e2e12af6e8 git:ef69bbc | 24 -buildtools = buildtools hg:97e2e12af6e8 git:ef69bbc |
25 +buildtools = buildtools hg:f9f01a4c16af git: | 25 +buildtools = buildtools hg:f9f01a4c16af git: |
26 adblockplusui = adblockplusui hg:75a50600e10a git:7ebacdc | 26 adblockplusui = adblockplusui hg:75a50600e10a git:7ebacdc |
27 diff -r ae1c96878402 -r 76ddc7678a91 lib/appSupport.js | 27 diff -r ae1c96878402 -r 7e0cd0610aec ensure_dependencies.py |
| 28 --- a/ensure_dependencies.py» Tue May 12 23:01:08 2015 +0200 |
| 29 +++ b/ensure_dependencies.py» Wed May 13 22:07:47 2015 +0200 |
| 30 @@ -34,6 +34,10 @@ |
| 31 buildtools = buildtools hg:016d16f7137b git:f3f8692f82e5 |
| 32 """ |
| 33 |
| 34 +SKIP_DEPENDENCY_UPDATES = os.environ.get( |
| 35 + "SKIP_DEPENDENCY_UPDATES", "" |
| 36 +).lower() not in ("", "0", "false") |
| 37 + |
| 38 class Mercurial(): |
| 39 def istype(self, repodir): |
| 40 return os.path.exists(os.path.join(repodir, ".hg")) |
| 41 @@ -97,7 +101,20 @@ |
| 42 return subprocess.check_output(command, cwd=repo).strip() |
| 43 |
| 44 def pull(self, repo): |
| 45 + # Fetch tracked branches, new tags and the list of available remote branche
s |
| 46 subprocess.check_call(["git", "fetch", "--quiet", "--all", "--tags"], cwd=r
epo) |
| 47 + # Next we need to ensure all remote branches are tracked |
| 48 + newly_tracked = False |
| 49 + remotes = subprocess.check_output(["git", "branch", "--remotes"], cwd=repo) |
| 50 + for match in re.finditer(r"^\s*(origin/(\S+))$", remotes, re.M): |
| 51 + remote, local = match.groups() |
| 52 + with open(os.devnull, "wb") as devnull: |
| 53 + if subprocess.call(["git", "branch", "--track", local, remote], |
| 54 + cwd=repo, stdout=devnull, stderr=devnull) == 0: |
| 55 + newly_tracked = True |
| 56 + # Finally fetch any newly tracked remote branches |
| 57 + if newly_tracked: |
| 58 + subprocess.check_call(["git", "fetch", "--quiet", "origin"], cwd=repo) |
| 59 |
| 60 def update(self, repo, rev): |
| 61 subprocess.check_call(["git", "checkout", "--quiet", rev], cwd=repo) |
| 62 @@ -167,7 +184,7 @@ |
| 63 |
| 64 def safe_join(path, subpath): |
| 65 # This has been inspired by Flask's safe_join() function |
| 66 - forbidden = set([os.sep, os.altsep]) - set([posixpath.sep, None]) |
| 67 + forbidden = {os.sep, os.altsep} - {posixpath.sep, None} |
| 68 if any(sep in subpath for sep in forbidden): |
| 69 raise Exception("Illegal directory separator in dependency path %s" % subpa
th) |
| 70 |
| 71 @@ -188,6 +205,11 @@ |
| 72 if os.path.exists(target): |
| 73 return |
| 74 |
| 75 + if SKIP_DEPENDENCY_UPDATES: |
| 76 + logging.warning("SKIP_DEPENDENCY_UPDATES environment variable set, " |
| 77 + "%s not cloned", target) |
| 78 + return |
| 79 + |
| 80 parenttype = get_repo_type(parentrepo) |
| 81 type = None |
| 82 for key in roots: |
| 83 @@ -227,15 +249,21 @@ |
| 84 return |
| 85 |
| 86 resolved_revision = repo_types[type].get_revision_id(target, revision) |
| 87 - if not resolved_revision: |
| 88 - logging.info("Revision %s is unknown, downloading remote changes" % revisio
n) |
| 89 - repo_types[type].pull(target) |
| 90 - resolved_revision = repo_types[type].get_revision_id(target, revision) |
| 91 + current_revision = repo_types[type].get_revision_id(target) |
| 92 + |
| 93 + if resolved_revision != current_revision: |
| 94 + if SKIP_DEPENDENCY_UPDATES: |
| 95 + logging.warning("SKIP_DEPENDENCY_UPDATES environment variable set, " |
| 96 + "%s not checked out to %s", target, revision) |
| 97 + return |
| 98 + |
| 99 if not resolved_revision: |
| 100 - raise Exception("Failed to resolve revision %s" % revision) |
| 101 + logging.info("Revision %s is unknown, downloading remote changes" % revis
ion) |
| 102 + repo_types[type].pull(target) |
| 103 + resolved_revision = repo_types[type].get_revision_id(target, revision) |
| 104 + if not resolved_revision: |
| 105 + raise Exception("Failed to resolve revision %s" % revision) |
| 106 |
| 107 - current_revision = repo_types[type].get_revision_id(target) |
| 108 - if resolved_revision != current_revision: |
| 109 logging.info("Updating repository %s to revision %s" % (target, resolved_re
vision)) |
| 110 repo_types[type].update(target, resolved_revision) |
| 111 |
| 112 @@ -247,6 +275,7 @@ |
| 113 return |
| 114 if level >= 10: |
| 115 logging.warning("Too much subrepository nesting, ignoring %s" % repo) |
| 116 + return |
| 117 |
| 118 if overrideroots is not None: |
| 119 config["_root"] = overrideroots |
| 120 diff -r ae1c96878402 -r 7e0cd0610aec lib/appSupport.js |
28 --- a/lib/appSupport.js Tue May 12 23:01:08 2015 +0200 | 121 --- a/lib/appSupport.js Tue May 12 23:01:08 2015 +0200 |
29 +++ b/lib/appSupport.js Wed May 13 22:07:47 2015 +0200 | 122 +++ b/lib/appSupport.js Wed May 13 22:07:47 2015 +0200 |
30 @@ -690,6 +690,7 @@ | 123 @@ -690,6 +690,7 @@ |
31 } | 124 } |
32 | 125 |
33 case "fennec2": | 126 case "fennec2": |
34 + case "adblockbrowser": | 127 + case "adblockbrowser": |
35 { | 128 { |
36 exports.isKnownWindow = (window) => window.document.documentElement.id == "
main-window"; | 129 exports.isKnownWindow = (window) => window.document.documentElement.id == "
main-window"; |
37 | 130 |
38 diff -r ae1c96878402 -r 76ddc7678a91 lib/objectTabs.js | 131 diff -r ae1c96878402 -r 7e0cd0610aec lib/objectTabs.js |
39 --- a/lib/objectTabs.js Tue May 12 23:01:08 2015 +0200 | 132 --- a/lib/objectTabs.js Tue May 12 23:01:08 2015 +0200 |
40 +++ b/lib/objectTabs.js Wed May 13 22:07:47 2015 +0200 | 133 +++ b/lib/objectTabs.js Wed May 13 22:07:47 2015 +0200 |
41 @@ -178,7 +178,8 @@ | 134 @@ -178,7 +178,8 @@ |
42 { | 135 { |
43 // Object tabs aren't usable in Fennec | 136 // Object tabs aren't usable in Fennec |
44 let {application} = require("info"); | 137 let {application} = require("info"); |
45 - if (application == "fennec" || application == "fennec2") | 138 - if (application == "fennec" || application == "fennec2") |
46 + if (application == "fennec" || application == "fennec2" || | 139 + if (application == "fennec" || application == "fennec2" || |
47 + application == "adblockbrowser") | 140 + application == "adblockbrowser") |
48 return; | 141 return; |
49 | 142 |
50 let {Prefs} = require("prefs"); | 143 let {Prefs} = require("prefs"); |
51 diff -r ae1c96878402 -r 76ddc7678a91 metadata.gecko | 144 diff -r ae1c96878402 -r 7e0cd0610aec metadata.gecko |
52 --- a/metadata.gecko Tue May 12 23:01:08 2015 +0200 | 145 --- a/metadata.gecko Tue May 12 23:01:08 2015 +0200 |
53 +++ b/metadata.gecko Wed May 13 22:07:47 2015 +0200 | 146 +++ b/metadata.gecko Wed May 13 22:07:47 2015 +0200 |
54 @@ -34,6 +34,7 @@ | 147 @@ -34,6 +34,7 @@ |
55 thunderbird=29.0/39.0 | 148 thunderbird=29.0/39.0 |
56 seamonkey=2.26/2.36 | 149 seamonkey=2.26/2.36 |
57 toolkit=29.0/39.0 | 150 toolkit=29.0/39.0 |
58 +adblockbrowser=1.0/1.0 | 151 +adblockbrowser=1.0/1.0 |
59 | 152 |
60 [mapping] | 153 [mapping] |
61 chrome/content/ui/firstRun.html = adblockplusui/firstRun.html | 154 chrome/content/ui/firstRun.html = adblockplusui/firstRun.html |
LEFT | RIGHT |