Mercurial > evolve
comparison hgext/simple4server.py @ 1450:5f6e78aea094 stable
merge with stable
Test are updated to run with current mercurial stable (3.4.1)
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 25 Jun 2015 16:55:27 -0700 |
parents | 5e82d78f5872 |
children | 4229d1dae5ad |
comparison
equal
deleted
inserted
replaced
1438:3295353b1363 | 1450:5f6e78aea094 |
---|---|
10 | 10 |
11 testedwith = '3.3.3 3.4-rc' | 11 testedwith = '3.3.3 3.4-rc' |
12 buglink = 'http://bz.selenic.com/' | 12 buglink = 'http://bz.selenic.com/' |
13 | 13 |
14 import mercurial.obsolete | 14 import mercurial.obsolete |
15 mercurial.obsolete._enabled = True | |
16 | 15 |
17 import struct | 16 import struct |
18 from mercurial import util | 17 from mercurial import util |
19 from mercurial import wireproto | 18 from mercurial import wireproto |
20 from mercurial import extensions | 19 from mercurial import extensions |
29 _pack = struct.pack | 28 _pack = struct.pack |
30 | 29 |
31 gboptslist = gboptsmap = None | 30 gboptslist = gboptsmap = None |
32 try: | 31 try: |
33 from mercurial import obsolete | 32 from mercurial import obsolete |
34 if not obsolete._enabled: | |
35 obsolete._enabled = True | |
36 from mercurial import wireproto | 33 from mercurial import wireproto |
37 gboptslist = getattr(wireproto, 'gboptslist', None) | 34 gboptslist = getattr(wireproto, 'gboptslist', None) |
38 gboptsmap = getattr(wireproto, 'gboptsmap', None) | 35 gboptsmap = getattr(wireproto, 'gboptsmap', None) |
39 except (ImportError, AttributeError): | 36 except (ImportError, AttributeError): |
40 raise util.Abort('Your Mercurial is too old for this version of Evolve\n' | 37 raise util.Abort('Your Mercurial is too old for this version of Evolve\n' |
245 # from evolve extension: 3249814dabd1 | 242 # from evolve extension: 3249814dabd1 |
246 def capabilities(orig, repo, proto): | 243 def capabilities(orig, repo, proto): |
247 """wrapper to advertise new capability""" | 244 """wrapper to advertise new capability""" |
248 caps = orig(repo, proto) | 245 caps = orig(repo, proto) |
249 advertise = repo.ui.configbool('__temporary__', 'advertiseobsolete', True) | 246 advertise = repo.ui.configbool('__temporary__', 'advertiseobsolete', True) |
250 if obsolete._enabled and advertise: | 247 if obsolete.isenabled(repo, obsolete.exchangeopt) and advertise: |
251 caps += ' _evoext_pushobsmarkers_0' | 248 caps += ' _evoext_pushobsmarkers_0' |
252 caps += ' _evoext_pullobsmarkers_0' | 249 caps += ' _evoext_pullobsmarkers_0' |
253 caps += ' _evoext_obshash_0' | 250 caps += ' _evoext_obshash_0' |
254 caps += ' _evoext_obshash_1' | 251 caps += ' _evoext_obshash_1' |
255 caps += ' _evoext_getbundle_obscommon' | 252 caps += ' _evoext_getbundle_obscommon' |
300 wireproto.commands['evoext_obshash1'] = (srv_obshash1, 'nodes') | 297 wireproto.commands['evoext_obshash1'] = (srv_obshash1, 'nodes') |
301 # specific simple4server content | 298 # specific simple4server content |
302 extensions.wrapfunction(pushkey, '_nslist', _nslist) | 299 extensions.wrapfunction(pushkey, '_nslist', _nslist) |
303 pushkey._namespaces['namespaces'] = (lambda *x: False, pushkey._nslist) | 300 pushkey._namespaces['namespaces'] = (lambda *x: False, pushkey._nslist) |
304 | 301 |
302 def reposetup(ui, repo): | |
303 evolveopts = ui.configlist('experimental', 'evolution') | |
304 if not evolveopts: | |
305 evolveopts = 'all' | |
306 ui.setconfig('experimental', 'evolution', evolveopts) |