diff 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
line wrap: on
line diff
--- a/mercurial/chgserver.py	Sat Nov 11 16:46:41 2017 +0900
+++ b/mercurial/chgserver.py	Sat Nov 11 17:55:15 2017 +0900
@@ -235,6 +235,7 @@
     cwds = dispatch._earlygetopt(['--cwd'], args)
     cwd = cwds and os.path.realpath(cwds[-1]) or None
     rpath = dispatch._earlygetopt(["-R", "--repository", "--repo"], args)
+    rpath = rpath and rpath[-1] or ''
     path, newlui = dispatch._getlocal(newui, rpath, wd=cwd)
 
     return (newui, newlui)