Show More
@@ -201,17 +201,17 b' def uisetup(ui):' | |||||
201 | '''use closure to save diff command to use''' |
|
201 | '''use closure to save diff command to use''' | |
202 | def mydiff(ui, repo, *pats, **opts): |
|
202 | def mydiff(ui, repo, *pats, **opts): | |
203 | return dodiff(ui, repo, path, diffopts, pats, opts) |
|
203 | return dodiff(ui, repo, path, diffopts, pats, opts) | |
204 |
mydiff.__doc__ = '''use %(path) |
|
204 | mydiff.__doc__ = '''use %(path)s to diff repository (or selected files) | |
205 |
|
205 | |||
206 | Show differences between revisions for the specified |
|
206 | Show differences between revisions for the specified | |
207 |
files, using the %(path) |
|
207 | files, using the %(path)s program. | |
208 |
|
208 | |||
209 | When two revision arguments are given, then changes are |
|
209 | When two revision arguments are given, then changes are | |
210 | shown between those revisions. If only one revision is |
|
210 | shown between those revisions. If only one revision is | |
211 | specified then that revision is compared to the working |
|
211 | specified then that revision is compared to the working | |
212 | directory, and, when no revisions are specified, the |
|
212 | directory, and, when no revisions are specified, the | |
213 | working directory files are compared to its parent.''' % { |
|
213 | working directory files are compared to its parent.''' % { | |
214 | 'path': path, |
|
214 | 'path': util.uirepr(path), | |
215 | } |
|
215 | } | |
216 | return mydiff |
|
216 | return mydiff | |
217 | cmdtable[cmd] = (save(cmd, path, diffopts), |
|
217 | cmdtable[cmd] = (save(cmd, path, diffopts), |
@@ -35,7 +35,7 b' class sshrepository(remoterepository):' | |||||
35 | cmd = cmd % (sshcmd, args, remotecmd, self.path) |
|
35 | cmd = cmd % (sshcmd, args, remotecmd, self.path) | |
36 |
|
36 | |||
37 | ui.note('running %s\n' % cmd) |
|
37 | ui.note('running %s\n' % cmd) | |
38 |
res = |
|
38 | res = util.system(cmd) | |
39 | if res != 0: |
|
39 | if res != 0: | |
40 | self.raise_(repo.RepoError(_("could not create remote repo"))) |
|
40 | self.raise_(repo.RepoError(_("could not create remote repo"))) | |
41 |
|
41 | |||
@@ -51,6 +51,7 b' class sshrepository(remoterepository):' | |||||
51 | cmd = '%s %s "%s -R %s serve --stdio"' |
|
51 | cmd = '%s %s "%s -R %s serve --stdio"' | |
52 | cmd = cmd % (sshcmd, args, remotecmd, self.path) |
|
52 | cmd = cmd % (sshcmd, args, remotecmd, self.path) | |
53 |
|
53 | |||
|
54 | cmd = util.quotecommand(cmd) | |||
54 | ui.note('running %s\n' % cmd) |
|
55 | ui.note('running %s\n' % cmd) | |
55 | self.pipeo, self.pipei, self.pipee = os.popen3(cmd, 'b') |
|
56 | self.pipeo, self.pipei, self.pipee = os.popen3(cmd, 'b') | |
56 |
|
57 |
@@ -1001,6 +1001,12 b" if os.name == 'nt':" | |||||
1001 | _quotere = re.compile(r'(\\*)("|\\$)') |
|
1001 | _quotere = re.compile(r'(\\*)("|\\$)') | |
1002 | return '"%s"' % _quotere.sub(r'\1\1\\\2', s) |
|
1002 | return '"%s"' % _quotere.sub(r'\1\1\\\2', s) | |
1003 |
|
1003 | |||
|
1004 | def quotecommand(cmd): | |||
|
1005 | """Build a command string suitable for os.popen* calls.""" | |||
|
1006 | # The extra quotes are needed because popen* runs the command | |||
|
1007 | # through the current COMSPEC. cmd.exe suppress enclosing quotes. | |||
|
1008 | return '"' + cmd + '"' | |||
|
1009 | ||||
1004 | def explain_exit(code): |
|
1010 | def explain_exit(code): | |
1005 | return _("exited with status %d") % code, code |
|
1011 | return _("exited with status %d") % code, code | |
1006 |
|
1012 | |||
@@ -1154,6 +1160,9 b' else:' | |||||
1154 | else: |
|
1160 | else: | |
1155 | return "'%s'" % s.replace("'", "'\\''") |
|
1161 | return "'%s'" % s.replace("'", "'\\''") | |
1156 |
|
1162 | |||
|
1163 | def quotecommand(cmd): | |||
|
1164 | return cmd | |||
|
1165 | ||||
1157 | def testpid(pid): |
|
1166 | def testpid(pid): | |
1158 | '''return False if pid dead, True if running or not sure''' |
|
1167 | '''return False if pid dead, True if running or not sure''' | |
1159 | if os.sys.platform == 'OpenVMS': |
|
1168 | if os.sys.platform == 'OpenVMS': | |
@@ -1681,3 +1690,7 b' def drop_scheme(scheme, path):' | |||||
1681 | if path.startswith('//'): |
|
1690 | if path.startswith('//'): | |
1682 | path = path[2:] |
|
1691 | path = path[2:] | |
1683 | return path |
|
1692 | return path | |
|
1693 | ||||
|
1694 | def uirepr(s): | |||
|
1695 | # Avoid double backslash in Windows path repr() | |||
|
1696 | return repr(s).replace('\\\\', '\\') |
General Comments 0
You need to be logged in to leave comments.
Login now