Show More
@@ -43,17 +43,19 b' class connectionpool(object):' | |||
|
43 | 43 | |
|
44 | 44 | if conn is None: |
|
45 | 45 | |
|
46 | def _cleanup(orig): | |
|
47 | # close pipee first so peer.cleanup reading it won't deadlock, | |
|
48 | # if there are other processes with pipeo open (i.e. us). | |
|
49 | peer = orig.im_self | |
|
50 | if util.safehasattr(peer, 'pipee'): | |
|
51 | peer.pipee.close() | |
|
52 | return orig() | |
|
46 | peer = hg.peer(self._repo.ui, {}, path) | |
|
47 | if util.safehasattr(peer, '_cleanup'): | |
|
53 | 48 | |
|
54 | peer = hg.peer(self._repo.ui, {}, path) | |
|
55 | if util.safehasattr(peer, 'cleanup'): | |
|
56 | extensions.wrapfunction(peer, b'cleanup', _cleanup) | |
|
49 | class mypeer(peer.__class__): | |
|
50 | def _cleanup(self): | |
|
51 | # close pipee first so peer.cleanup reading it won't | |
|
52 | # deadlock, if there are other processes with pipeo | |
|
53 | # open (i.e. us). | |
|
54 | if util.safehasattr(self, 'pipee'): | |
|
55 | self.pipee.close() | |
|
56 | return super(mypeer, self)._cleanup() | |
|
57 | ||
|
58 | peer.__class__ = mypeer | |
|
57 | 59 | |
|
58 | 60 | conn = connection(pathpool, peer) |
|
59 | 61 |
General Comments 0
You need to be logged in to leave comments.
Login now