# HG changeset patch # User Matt Mackall # Date 1310603094 18000 # Node ID 3a65e3f34b8cc42ddaaa5a34f0c35ba312520274 # Parent 647071c6dfcfc19a4dedb37c1e4c0b60378d953b# Parent ad6a58581ecd4712c5afbd9f5b48d829d7d7c02b merge with crew diff -r 647071c6dfcf -r 3a65e3f34b8c hgext/eol.py --- a/hgext/eol.py Wed Jul 13 19:23:33 2011 +0200 +++ b/hgext/eol.py Wed Jul 13 19:24:54 2011 -0500 @@ -330,7 +330,10 @@ 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 diff -r 647071c6dfcf -r 3a65e3f34b8c mercurial/commandserver.py --- a/mercurial/commandserver.py Wed Jul 13 19:23:33 2011 +0200 +++ b/mercurial/commandserver.py Wed Jul 13 19:24:54 2011 -0500 @@ -7,7 +7,7 @@ from i18n import _ import struct -import sys +import sys, os import dispatch, encoding, util logfile = None @@ -131,6 +131,7 @@ 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 @@ 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): diff -r 647071c6dfcf -r 3a65e3f34b8c mercurial/dispatch.py --- a/mercurial/dispatch.py Wed Jul 13 19:23:33 2011 +0200 +++ b/mercurial/dispatch.py Wed Jul 13 19:24:54 2011 -0500 @@ -633,7 +633,7 @@ 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: diff -r 647071c6dfcf -r 3a65e3f34b8c mercurial/scmutil.py --- a/mercurial/scmutil.py Wed Jul 13 19:23:33 2011 +0200 +++ b/mercurial/scmutil.py Wed Jul 13 19:24:54 2011 -0500 @@ -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''' diff -r 647071c6dfcf -r 3a65e3f34b8c mercurial/verify.py --- a/mercurial/verify.py Wed Jul 13 19:23:33 2011 +0200 +++ b/mercurial/verify.py Wed Jul 13 19:24:54 2011 -0500 @@ -168,6 +168,8 @@ 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 diff -r 647071c6dfcf -r 3a65e3f34b8c tests/test-commandserver.py --- a/tests/test-commandserver.py Wed Jul 13 19:23:33 2011 +0200 +++ b/tests/test-commandserver.py Wed Jul 13 19:24:54 2011 -0500 @@ -120,6 +120,15 @@ 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 @@ check(checkruncommand) check(inputeof) check(serverinput) + check(cwd) diff -r 647071c6dfcf -r 3a65e3f34b8c tests/test-commandserver.py.out --- a/tests/test-commandserver.py.out Wed Jul 13 19:23:33 2011 +0200 +++ b/tests/test-commandserver.py.out Wed Jul 13 19:24:54 2011 -0500 @@ -36,3 +36,5 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 +? bar +? foo/bar