Mercurial > wow > ouroloot
comparison core.lua @ 62:d5fe3482db67
Be smarter about revision checking. ALL the revision checking.
author | Farmbuyer of US-Kilrogg <farmbuyer@gmail.com> |
---|---|
date | Fri, 20 Apr 2012 03:29:24 +0000 |
parents | 99ab21f0755f |
children | 00bf6d4f9238 |
comparison
equal
deleted
inserted
replaced
61:99ab21f0755f | 62:d5fe3482db67 |
---|---|
103 OuroLootSV_log = {} | 103 OuroLootSV_log = {} |
104 | 104 |
105 | 105 |
106 ------ Constants | 106 ------ Constants |
107 local option_defaults = { | 107 local option_defaults = { |
108 ['datarev'] = 16, -- cheating, this isn't actually an option | 108 ['datarev'] = 17, -- cheating, this isn't actually an option |
109 ['popup_on_join'] = true, | 109 ['popup_on_join'] = true, |
110 ['register_slashloot'] = true, | 110 ['register_slashloot'] = true, |
111 ['scroll_to_bottom'] = true, | 111 ['scroll_to_bottom'] = true, |
112 ['chatty_on_kill'] = false, | 112 ['chatty_on_kill'] = false, |
113 ['no_tracking_wipes'] = false, | 113 ['no_tracking_wipes'] = false, |
264 -- | 264 -- |
265 -- This makes/reinforces an assumption that revision_large of release packages | 265 -- This makes/reinforces an assumption that revision_large of release packages |
266 -- (e.g., 2016001) will always be higher than those of development packages | 266 -- (e.g., 2016001) will always be higher than those of development packages |
267 -- (e.g., 87), due to the tagging system versus subversion file revs. This | 267 -- (e.g., 87), due to the tagging system versus subversion file revs. This |
268 -- is good, as local dev code will never trigger a false positive update | 268 -- is good, as local dev code will never trigger a false positive update |
269 -- warning for other users. The downside is that additional decimal places | 269 -- warning for other users. |
270 -- in the Version field for bugfixes (e.g., "2.16.4.1") imposes a high-water | |
271 -- mark, as subsequent shorter strings ("2.16.5", "2.17") will never be larger. | |
272 -- Will need to redo this so it's not quite so dumb. | |
273 do | 270 do |
274 local r = 0 | 271 local r = 0 |
275 for d in addon.revision:gmatch("%d+") do | 272 for d in addon.revision:gmatch("%d+") do |
276 r = 1000*r + d | 273 r = 1000*r + d |
274 end | |
275 -- If it's a big enough number to obviously be a release, then make | |
276 -- sure it's big enough to overcome many small point releases. | |
277 while r > 2000 and r < 2000000 do | |
278 r = 1000*r | |
277 end | 279 end |
278 revision_large = math.max(r,1) | 280 revision_large = math.max(r,1) |
279 end | 281 end |
280 | 282 |
281 -- Hypertext support, inspired by DBM broadcast pizza timers | 283 -- Hypertext support, inspired by DBM broadcast pizza timers |
566 end | 568 end |
567 end | 569 end |
568 stored_datarev = 17 | 570 stored_datarev = 17 |
569 end | 571 end |
570 if dirty then self:Print("Saved data has been massaged into shape.") end | 572 if dirty then self:Print("Saved data has been massaged into shape.") end |
573 assert(stored_datarev==opts.datarev) | |
571 end | 574 end |
572 | 575 |
573 _init(self) | 576 _init(self) |
574 self.dprint('flow', "version strings:", revision_large, self.status_text) | 577 self.dprint('flow', "version strings:", revision_large, self.status_text) |
575 self.OnInitialize = nil | 578 self.OnInitialize = nil |