##// 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 235 cwds = dispatch._earlygetopt(['--cwd'], args)
236 236 cwd = cwds and os.path.realpath(cwds[-1]) or None
237 237 rpath = dispatch._earlygetopt(["-R", "--repository", "--repo"], args)
238 rpath = rpath and rpath[-1] or ''
238 239 path, newlui = dispatch._getlocal(newui, rpath, wd=cwd)
239 240
240 241 return (newui, newlui)
@@ -787,8 +787,8 b' def _getlocal(ui, rpath, wd=None):'
787 787 lui = ui.copy()
788 788 lui.readconfig(os.path.join(path, ".hg", "hgrc"), path)
789 789
790 if rpath and rpath[-1]:
791 path = lui.expandpath(rpath[-1])
790 if rpath:
791 path = lui.expandpath(rpath)
792 792 lui = ui.copy()
793 793 lui.readconfig(os.path.join(path, ".hg", "hgrc"), path)
794 794
@@ -829,10 +829,12 b' def _dispatch(req):'
829 829
830 830 # check for cwd
831 831 cwd = _earlygetopt(['--cwd'], args)
832 cwd = cwd and cwd[-1] or ''
832 833 if cwd:
833 os.chdir(cwd[-1])
834 os.chdir(cwd)
834 835
835 836 rpath = _earlygetopt(["-R", "--repository", "--repo"], args)
837 rpath = rpath and rpath[-1] or ''
836 838 path, lui = _getlocal(ui, rpath)
837 839
838 840 uis = {ui, lui}
@@ -971,7 +973,7 b' def _dispatch(req):'
971 973 except error.RequirementError:
972 974 raise
973 975 except error.RepoError:
974 if rpath and rpath[-1]: # invalid -R path
976 if rpath: # invalid -R path
975 977 raise
976 978 if not func.optionalrepo:
977 979 if func.inferrepo and args and not path:
General Comments 0
You need to be logged in to leave comments. Login now