comparison mercurial/chgserver.py @ 34985:d3d35a55e03b stable

dispatch: convert non-list option parsed by _earlygetopt() to string So we can easily compare it with the corresponding getopt() result. There's a minor behavior change. Before, "hg --cwd ''" failed with ENOENT. But with this patch, an empty cwd is silently ignored. "hg -R ''" has always worked as such, so -R has no BC.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 11 Nov 2017 17:55:15 +0900
parents 7bf7544fd6cc
children c9740b69b9b7
comparison
equal deleted inserted replaced
34984:cd235d6f851b 34985:d3d35a55e03b
233 233
234 # load wd and repo config, copied from dispatch.py 234 # load wd and repo config, copied from dispatch.py
235 cwds = dispatch._earlygetopt(['--cwd'], args) 235 cwds = dispatch._earlygetopt(['--cwd'], args)
236 cwd = cwds and os.path.realpath(cwds[-1]) or None 236 cwd = cwds and os.path.realpath(cwds[-1]) or None
237 rpath = dispatch._earlygetopt(["-R", "--repository", "--repo"], args) 237 rpath = dispatch._earlygetopt(["-R", "--repository", "--repo"], args)
238 rpath = rpath and rpath[-1] or ''
238 path, newlui = dispatch._getlocal(newui, rpath, wd=cwd) 239 path, newlui = dispatch._getlocal(newui, rpath, wd=cwd)
239 240
240 return (newui, newlui) 241 return (newui, newlui)
241 242
242 class channeledsystem(object): 243 class channeledsystem(object):