Commits

Friedrich Kastner-Masilko committed b559597

Fixed problem with subprocess.Popen - instead util.popen is used.

Comments (0)

Files changed (1)

 # of the GNU General Public License, incorporated herein by reference.
 
 from mercurial.i18n import _
-import subprocess
+from subprocess import Popen, PIPE
+from mercurial import util
 
 def hook(ui, repo, hooktype, url=None, source=None, **kwargs):
     '''hook for pushing changes to proxy repositories'''
                 else:
                     cmd=ui.config('autosync','cmd')
                     if not cmd: cmd='out'
-                    cmd='hg '+cmd+' "'+remoteUrl+'"'
-                    subprocess.Popen(cmd, cwd=repo.root)
+                    cmd='hg -R "'+repo.root+'" '+cmd+' "'+remoteUrl+'"'
+                    ui.debug(_('autosync command is \''))
+                    ui.debug(cmd)
+                    ui.debug(_('\'\n'))
+                    util.popen(cmd, 'w')
+                    ui.status(_('autosync to \''))
+                    ui.status(remoteUrl)
+                    ui.status(_('\' initiated\n'))
         else:
             ui.debug(_('hook-source not in list, no autosync applied.\n'))
-    return False