merge with stable

This commit is contained in:
Matt Mackall 2011-07-13 16:29:28 -05:00
commit 4773ae257d
7 changed files with 27 additions and 5 deletions

View File

@ -330,7 +330,10 @@ def reposetup(ui, repo):
for f in sorted(ctx.added() + ctx.modified()):
if not self._eolfile(f):
continue
data = ctx[f].data()
try:
data = ctx[f].data()
except IOError:
continue
if util.binary(data):
# We should not abort here, since the user should
# be able to say "** = native" to automatically

View File

@ -7,7 +7,7 @@
from i18n import _
import struct
import sys
import sys, os
import dispatch, encoding, util
logfile = None
@ -131,6 +131,7 @@ class server(object):
based stream to stdout.
"""
def __init__(self, ui, repo, mode):
self.cwd = os.getcwd()
self.ui = ui
logpath = ui.config("cmdserver", "log", None)
@ -183,11 +184,15 @@ class server(object):
self.repo.baseui = copiedui
self.repo.ui = self.repo.dirstate._ui = self.repoui.copy()
req = dispatch.request(args, copiedui, self.repo, self.cin,
req = dispatch.request(args[:], copiedui, self.repo, self.cin,
self.cout, self.cerr)
ret = dispatch.dispatch(req) or 0 # might return None
# restore old cwd
if '--cwd' in args:
os.chdir(self.cwd)
self.cresult.write(struct.pack('>i', int(ret)))
def getencoding(self):

View File

@ -633,7 +633,7 @@ def _dispatch(req):
cmdpats = args[:]
if cmd not in commands.norepo.split():
# use the repo from the request only if we don't have -R
if not rpath:
if not rpath and not cwd:
repo = req.repo
if repo:

View File

@ -8,7 +8,7 @@
from i18n import _
import util, error, osutil, revset, similar
import match as matchmod
import os, errno, stat, sys, glob
import os, errno, re, stat, sys, glob
def checkfilename(f):
'''Check that the filename f is an acceptable filename for a tracked file'''

View File

@ -168,6 +168,8 @@ def _verify(repo):
for c, m in sorted([(c, m) for m in mflinkrevs
for c in mflinkrevs[m]]):
count += 1
if m == nullid:
continue
ui.progress(_('crosschecking'), count, total=total)
err(c, _("changeset refers to unknown manifest %s") % short(m))
mflinkrevs = None # del is bad here due to scope issues

View File

@ -120,6 +120,15 @@ diff -r 000000000000 -r c103a3dec114 a
runcommand(server, ['import', '-'], input=cStringIO.StringIO(patch))
runcommand(server, ['log'])
def cwd(server):
""" check that --cwd doesn't persist between requests """
readchannel(server)
os.mkdir('foo')
open('foo/bar', 'w').write('a')
runcommand(server, ['--cwd', 'foo', 'st', 'bar'])
runcommand(server, ['st', 'foo/bar'])
os.remove('foo/bar')
if __name__ == '__main__':
os.system('hg init')
@ -128,3 +137,4 @@ if __name__ == '__main__':
check(checkruncommand)
check(inputeof)
check(serverinput)
check(cwd)

View File

@ -36,3 +36,5 @@ user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 1
? bar
? foo/bar