configitems: register the test config in 'test-push-race.t'
authorBoris Feld <boris.feld@octobus.net>
Wed, 11 Oct 2017 23:33:59 +0200
changeset 34767 6338e23c887d
parent 34766 d957d4475a64
child 34768 2b954c9c5395
configitems: register the test config in 'test-push-race.t'
tests/test-push-race.t
--- a/tests/test-push-race.t	Wed Oct 11 04:33:00 2017 +0200
+++ b/tests/test-push-race.t	Wed Oct 11 23:33:59 2017 +0200
@@ -22,18 +22,29 @@
   > from mercurial import (
   >     exchange,
   >     extensions,
+  >     registrar,
+  > )
+  > 
+  > configtable = {}
+  > configitem = registrar.configitem(configtable)
+  > 
+  > configitem('delaypush', 'ready-path',
+  >     default=None,
+  > )
+  > configitem('delaypush', 'release-path',
+  >     default=None,
   > )
   > 
   > def delaypush(orig, pushop):
   >     # notify we are done preparing
   >     ui = pushop.repo.ui
-  >     readypath = ui.config('delaypush', 'ready-path', None)
+  >     readypath = ui.config('delaypush', 'ready-path')
   >     if readypath is not None:
   >         with open(readypath, 'w') as r:
   >             r.write('foo')
   >         ui.status('wrote ready: %s\n' % readypath)
   >     # now wait for the other process to be done
-  >     watchpath = ui.config('delaypush', 'release-path', None)
+  >     watchpath = ui.config('delaypush', 'release-path')
   >     if watchpath is not None:
   >         ui.status('waiting on: %s\n' % watchpath)
   >         limit = 100