Friedrich Kastner-Masilko  committed b559597

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

  • Participants
  • Parent commits 5ccbffc
  • Branches default

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'''
                     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'))
             ui.debug(_('hook-source not in list, no autosync applied.\n'))
-    return False