##// END OF EJS Templates
configitems: register the test config in 'test-push-race.t'
Boris Feld -
r34768:6338e23c default
parent child Browse files
Show More
@@ -22,18 +22,29 b' A set of extension and shell functions e'
22 > from mercurial import (
22 > from mercurial import (
23 > exchange,
23 > exchange,
24 > extensions,
24 > extensions,
25 > registrar,
26 > )
27 >
28 > configtable = {}
29 > configitem = registrar.configitem(configtable)
30 >
31 > configitem('delaypush', 'ready-path',
32 > default=None,
33 > )
34 > configitem('delaypush', 'release-path',
35 > default=None,
25 > )
36 > )
26 >
37 >
27 > def delaypush(orig, pushop):
38 > def delaypush(orig, pushop):
28 > # notify we are done preparing
39 > # notify we are done preparing
29 > ui = pushop.repo.ui
40 > ui = pushop.repo.ui
30 > readypath = ui.config('delaypush', 'ready-path', None)
41 > readypath = ui.config('delaypush', 'ready-path')
31 > if readypath is not None:
42 > if readypath is not None:
32 > with open(readypath, 'w') as r:
43 > with open(readypath, 'w') as r:
33 > r.write('foo')
44 > r.write('foo')
34 > ui.status('wrote ready: %s\n' % readypath)
45 > ui.status('wrote ready: %s\n' % readypath)
35 > # now wait for the other process to be done
46 > # now wait for the other process to be done
36 > watchpath = ui.config('delaypush', 'release-path', None)
47 > watchpath = ui.config('delaypush', 'release-path')
37 > if watchpath is not None:
48 > if watchpath is not None:
38 > ui.status('waiting on: %s\n' % watchpath)
49 > ui.status('waiting on: %s\n' % watchpath)
39 > limit = 100
50 > limit = 100
General Comments 0
You need to be logged in to leave comments. Login now