##// END OF EJS Templates
dispatch: convert non-list option parsed by _earlygetopt() to string...
Yuya Nishihara -
r35062:d3d35a55 stable
parent child Browse files
Show More
@@ -235,6 +235,7 b' def _loadnewui(srcui, args):'
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)
@@ -787,8 +787,8 b' def _getlocal(ui, rpath, wd=None):'
787 lui = ui.copy()
787 lui = ui.copy()
788 lui.readconfig(os.path.join(path, ".hg", "hgrc"), path)
788 lui.readconfig(os.path.join(path, ".hg", "hgrc"), path)
789
789
790 if rpath and rpath[-1]:
790 if rpath:
791 path = lui.expandpath(rpath[-1])
791 path = lui.expandpath(rpath)
792 lui = ui.copy()
792 lui = ui.copy()
793 lui.readconfig(os.path.join(path, ".hg", "hgrc"), path)
793 lui.readconfig(os.path.join(path, ".hg", "hgrc"), path)
794
794
@@ -829,10 +829,12 b' def _dispatch(req):'
829
829
830 # check for cwd
830 # check for cwd
831 cwd = _earlygetopt(['--cwd'], args)
831 cwd = _earlygetopt(['--cwd'], args)
832 cwd = cwd and cwd[-1] or ''
832 if cwd:
833 if cwd:
833 os.chdir(cwd[-1])
834 os.chdir(cwd)
834
835
835 rpath = _earlygetopt(["-R", "--repository", "--repo"], args)
836 rpath = _earlygetopt(["-R", "--repository", "--repo"], args)
837 rpath = rpath and rpath[-1] or ''
836 path, lui = _getlocal(ui, rpath)
838 path, lui = _getlocal(ui, rpath)
837
839
838 uis = {ui, lui}
840 uis = {ui, lui}
@@ -971,7 +973,7 b' def _dispatch(req):'
971 except error.RequirementError:
973 except error.RequirementError:
972 raise
974 raise
973 except error.RepoError:
975 except error.RepoError:
974 if rpath and rpath[-1]: # invalid -R path
976 if rpath: # invalid -R path
975 raise
977 raise
976 if not func.optionalrepo:
978 if not func.optionalrepo:
977 if func.inferrepo and args and not path:
979 if func.inferrepo and args and not path:
General Comments 0
You need to be logged in to leave comments. Login now