Commit e8d2f9de authored by Matthias Putz's avatar Matthias Putz

--amend

parent c0bbe1bf
...@@ -225,6 +225,7 @@ class GitCommand(object): ...@@ -225,6 +225,7 @@ class GitCommand(object):
if ssh_proxy: if ssh_proxy:
_add_ssh_client(p) _add_ssh_client(p)
portable.SUBPROCESSES.append(p)
self.process = p self.process = p
self.stdin = p.stdin self.stdin = p.stdin
...@@ -233,6 +234,7 @@ class GitCommand(object): ...@@ -233,6 +234,7 @@ class GitCommand(object):
p = self.process p = self.process
(self.stdout, self.stderr) = p.communicate() (self.stdout, self.stderr) = p.communicate()
rc = p.returncode rc = p.returncode
portable.SUBPROCESSES.remove(p)
finally: finally:
_remove_ssh_client(p) _remove_ssh_client(p)
return rc return rc
...@@ -25,6 +25,7 @@ import sys ...@@ -25,6 +25,7 @@ import sys
import traceback import traceback
import time import time
import urllib.request import urllib.request
import signal
import portable import portable
from repo_trace import SetTrace from repo_trace import SetTrace
from git_command import git, GitCommand from git_command import git, GitCommand
...@@ -424,6 +425,8 @@ def _WindowsPager(repo): ...@@ -424,6 +425,8 @@ def _WindowsPager(repo):
def _Main(argv): def _Main(argv):
result = 0 result = 0
signal.signal(signal.SIGTERM, portable.terminateHandle())
opt = optparse.OptionParser(usage="repo wrapperinfo -- ...") opt = optparse.OptionParser(usage="repo wrapperinfo -- ...")
opt.add_option("--repo-dir", dest="repodir", opt.add_option("--repo-dir", dest="repodir",
help="path to .repo/") help="path to .repo/")
......
...@@ -9,6 +9,12 @@ import platform ...@@ -9,6 +9,12 @@ import platform
import subprocess import subprocess
SYNC_REPO_PROGRAM = False SYNC_REPO_PROGRAM = False
SUBPROCESSES = []
def terminateHandle():
for cmd in SUBPROCESSES:
if cmd:
cmd.terminate()
def stream2str(stream): def stream2str(stream):
return str(stream, encoding='UTF-8') return str(stream, encoding='UTF-8')
...@@ -44,7 +50,7 @@ def os_link(src, dst): ...@@ -44,7 +50,7 @@ def os_link(src, dst):
dst = toWindowsPath(dst) dst = toWindowsPath(dst)
# symlink does create soft links in windows for directories => use mklink # symlink does create soft links in windows for directories => use mklink
# call windows cmd tool 'mklink' from git bash (mingw) # call windows cmd tool 'mklink' from git bash (mingw)
subprocess.Popen('cmd /c mklink /J %s %s' % (dst, src)) subprocess.Popen('cmd /c mklink /J %s %s' % (dst, src), stdout=subprocess.PIPE)
else: else:
# requires paths in relation to current dir (not in relation to target file) # requires paths in relation to current dir (not in relation to target file)
src = toUnixPath(src) src = toUnixPath(src)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment