--- a/hgext/mq.py Mon Dec 10 10:26:42 2007 -0600
+++ b/hgext/mq.py Mon Dec 17 13:45:30 2007 +0100
@@ -34,7 +34,7 @@
from mercurial import repair
import os, sys, re, errno
-commands.norepo += " qclone qversion"
+commands.norepo += " qclone"
# Patch names looks like unix-file names.
# They must be joinable with queue directory and result in the patch path.
--- a/hgext/patchbomb.py Mon Dec 10 10:26:42 2007 -0600
+++ b/hgext/patchbomb.py Mon Dec 17 13:45:30 2007 +0100
@@ -115,16 +115,12 @@
'''
def prompt(prompt, default = None, rest = ': ', empty_ok = False):
- try:
- # readline gives raw_input editing capabilities, but is not
- # present on windows
- import readline
- except ImportError: pass
-
+ if not ui.interactive:
+ return default
if default: prompt += ' [%s]' % default
prompt += rest
while True:
- r = raw_input(prompt)
+ r = ui.prompt(prompt, default=default)
if r: return r
if default is not None: return default
if empty_ok: return r
--- a/mercurial/sshrepo.py Mon Dec 10 10:26:42 2007 -0600
+++ b/mercurial/sshrepo.py Mon Dec 17 13:45:30 2007 +0100
@@ -24,12 +24,11 @@
self.port = m.group(5)
self.path = m.group(7) or "."
- args = self.user and ("%s@%s" % (self.user, self.host)) or self.host
- args = self.port and ("%s -p %s") % (args, self.port) or args
-
sshcmd = self.ui.config("ui", "ssh", "ssh")
remotecmd = self.ui.config("ui", "remotecmd", "hg")
+ args = util.sshargs(sshcmd, self.host, self.user, self.port)
+
if create:
cmd = '%s %s "%s init %s"'
cmd = cmd % (sshcmd, args, remotecmd, self.path)
--- a/mercurial/util.py Mon Dec 10 10:26:42 2007 -0600
+++ b/mercurial/util.py Mon Dec 17 13:45:30 2007 +0100
@@ -919,7 +919,15 @@
def write(self, s):
try:
- return self.fp.write(s)
+ # This is workaround for "Not enough space" error on
+ # writing large size of data to console.
+ limit = 16000
+ l = len(s)
+ start = 0
+ while start < l:
+ end = start + limit
+ self.fp.write(s[start:end])
+ start = end
except IOError, inst:
if inst.errno != 0: raise
self.close()
@@ -960,6 +968,12 @@
pf = pf[1:-1] # Remove the quotes
return pf
+ def sshargs(sshcmd, host, user, port):
+ '''Build argument list for ssh or Plink'''
+ pflag = 'plink' in sshcmd.lower() and '-P' or '-p'
+ args = user and ("%s@%s" % (user, host)) or host
+ return port and ("%s %s %s" % (args, pflag, port)) or args
+
def testpid(pid):
'''return False if pid dead, True if running or not known'''
return True
@@ -1102,6 +1116,11 @@
pf = pf[1:-1] # Remove the quotes
return pf
+ def sshargs(sshcmd, host, user, port):
+ '''Build argument list for ssh'''
+ args = user and ("%s@%s" % (user, host)) or host
+ return port and ("%s -p %s" % (args, port)) or args
+
def is_exec(f):
"""check whether a file is executable"""
return (os.lstat(f).st_mode & 0100 != 0)