Mercurial > evolve
annotate tests/killdaemons.py @ 742:760d01a549a6
amend: use core mechanism for amend
Evolve used its own code for amending. This was introduced before mercurial
includes commit --amend. The evolve code is now older and buggier. So we just
use the core cod when amend is called.
Message of the temporary commit is different, all test hash changed \o/.
Test change are been carefully checked.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Wed, 16 Oct 2013 00:37:29 +0200 |
parents | cc592295900f |
children | 88e61e45026d |
rev | line source |
---|---|
7
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
1 #!/usr/bin/env python |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
2 |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
3 import os, time, errno, signal |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
4 |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
5 # Kill off any leftover daemon processes |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
6 try: |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
7 fp = open(os.environ['DAEMON_PIDS']) |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
8 for line in fp: |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
9 try: |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
10 pid = int(line) |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
11 except ValueError: |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
12 continue |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
13 try: |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
14 os.kill(pid, 0) |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
15 os.kill(pid, signal.SIGTERM) |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
16 for i in range(10): |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
17 time.sleep(0.05) |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
18 os.kill(pid, 0) |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
19 os.kill(pid, signal.SIGKILL) |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
20 except OSError, err: |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
21 if err.errno != errno.ESRCH: |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
22 raise |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
23 fp.close() |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
24 except IOError: |
cc592295900f
Add write protocol support for private.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff
changeset
|
25 pass |