Created
September 15, 2008 15:59
-
-
Save ursm/10884 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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