# HG changeset patch # User Matt Mackall # Date 1310592568 18000 # Node ID ad6a58581ecd4712c5afbd9f5b48d829d7d7c02b # Parent 67add0f24f834dc59ae3a13357759177dcf8c2e4# Parent eb914541a95076eebbb2d85e2436e949daa2059a merge with stable diff -r 67add0f24f83 -r ad6a58581ecd hgext/eol.py --- a/hgext/eol.py Tue Jul 12 16:36:34 2011 -0500 +++ b/hgext/eol.py Wed Jul 13 16:29:28 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 67add0f24f83 -r ad6a58581ecd mercurial/commandserver.py --- a/mercurial/commandserver.py Tue Jul 12 16:36:34 2011 -0500 +++ b/mercurial/commandserver.py Wed Jul 13 16:29:28 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 67add0f24f83 -r ad6a58581ecd mercurial/dispatch.py --- a/mercurial/dispatch.py Tue Jul 12 16:36:34 2011 -0500 +++ b/mercurial/dispatch.py Wed Jul 13 16:29:28 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 67add0f24f83 -r ad6a58581ecd mercurial/scmutil.py --- a/mercurial/scmutil.py Tue Jul 12 16:36:34 2011 -0500 +++ b/mercurial/scmutil.py Wed Jul 13 16:29:28 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 67add0f24f83 -r ad6a58581ecd mercurial/verify.py --- a/mercurial/verify.py Tue Jul 12 16:36:34 2011 -0500 +++ b/mercurial/verify.py Wed Jul 13 16:29:28 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 67add0f24f83 -r ad6a58581ecd tests/test-commandserver.py --- a/tests/test-commandserver.py Tue Jul 12 16:36:34 2011 -0500 +++ b/tests/test-commandserver.py Wed Jul 13 16:29:28 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 67add0f24f83 -r ad6a58581ecd tests/test-commandserver.py.out --- a/tests/test-commandserver.py.out Tue Jul 12 16:36:34 2011 -0500 +++ b/tests/test-commandserver.py.out Wed Jul 13 16:29:28 2011 -0500 @@ -36,3 +36,5 @@ date: Thu Jan 01 00:00:00 1970 +0000 summary: 1 +? bar +? foo/bar