Show More
@@ -27,21 +27,22 b' A set of extension and shell functions e' | |||||
27 | > |
|
27 | > | |
28 | > def delaypush(orig, pushop): |
|
28 | > def delaypush(orig, pushop): | |
29 | > # notify we are done preparing |
|
29 | > # notify we are done preparing | |
30 | > readypath = pushop.repo.ui.config('delaypush', 'ready-path', None) |
|
30 | > ui = pushop.repo.ui | |
|
31 | > readypath = ui.config('delaypush', 'ready-path', None) | |||
31 | > if readypath is not None: |
|
32 | > if readypath is not None: | |
32 | > with open(readypath, 'w') as r: |
|
33 | > with open(readypath, 'w') as r: | |
33 | > r.write('foo') |
|
34 | > r.write('foo') | |
34 |
> |
|
35 | > ui.status('wrote ready: %s\n' % readypath) | |
35 | > # now wait for the other process to be done |
|
36 | > # now wait for the other process to be done | |
36 |
> watchpath = |
|
37 | > watchpath = ui.config('delaypush', 'release-path', None) | |
37 | > if watchpath is not None: |
|
38 | > if watchpath is not None: | |
38 |
> |
|
39 | > ui.status('waiting on: %s\n' % watchpath) | |
39 | > limit = 100 |
|
40 | > limit = 100 | |
40 | > while 0 < limit and not os.path.exists(watchpath): |
|
41 | > while 0 < limit and not os.path.exists(watchpath): | |
41 | > limit -= 1 |
|
42 | > limit -= 1 | |
42 | > time.sleep(0.1) |
|
43 | > time.sleep(0.1) | |
43 | > if limit <= 0: |
|
44 | > if limit <= 0: | |
44 |
> |
|
45 | > ui.warn('exiting without watchfile: %s' % watchpath) | |
45 | > else: |
|
46 | > else: | |
46 | > # delete the file at the end of the push |
|
47 | > # delete the file at the end of the push | |
47 | > def delete(): |
|
48 | > def delete(): |
General Comments 0
You need to be logged in to leave comments.
Login now