mercurial/util.py
changeset 10239 8e4be44a676f
parent 10199 c2e2a5e6c36b
child 10240 3af4b39afe2a
--- a/mercurial/util.py	Wed Jan 06 21:11:58 2010 +0100
+++ b/mercurial/util.py	Wed Jan 06 21:11:58 2010 +0100
@@ -1274,3 +1274,14 @@
 
 def expandpath(path):
     return os.path.expanduser(os.path.expandvars(path))
+
+def hgcmd():
+    """Return the command used to execute current hg
+
+    This is different from hgexecutable() because on Windows we want
+    to avoid things opening new shell windows like batch files, so we
+    get either the python call or current executable.
+    """
+    if main_is_frozen():
+        return [sys.executable]
+    return gethgcmd()