Skip to content

Instantly share code, notes, and snippets.

@ursm
Created September 15, 2008 15:59
Show Gist options
  • Save ursm/10884 to your computer and use it in GitHub Desktop.
Save ursm/10884 to your computer and use it in GitHub Desktop.
diff --git a/hgpushsvn.py b/hgpushsvn.py
--- a/hgpushsvn.py
+++ b/hgpushsvn.py
@@ -11,14 +11,18 @@
def shell_quote(s):
- return "'" + s.replace('¥¥', '¥¥¥¥').replace("'", "'¥"'¥"'") + "'"
+ if os.name == "nt":
+ q = '"'
+ else:
+ q = "'"
+ return q + s.replace('¥¥', '¥¥¥¥').replace("'", "'¥"'¥"'") + q
def run_command(cmd, args=()):
cmd += "".join(" " + shell_quote(a) for a in args)
print "*", cmd
- st, out = commands.getstatusoutput(cmd)
+ st = os.system(cmd)
if st != 0:
- raise RuntimeError("command failed with non-zero return code (%d): %s:¥n%s" % (st, cmd, out))
+ raise RuntimeError("command failed with non-zero return code (%d): %s" % (st, cmd))
return out
def map_svn_rev_to_hg(svn_rev, hg_rev="tip", local=False):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment