comparison mercurial/dispatch.py @ 45783:88a47cbf063c

config: add a .hg/hgrc-not-shared which won't be shared in share-safe mode Previous patches add a safe mode for sharing repositories which involve sharing of source requirements and config files. In certain situations we might need to add a config to source repository which we does not want to share. For this, we add a `.hg/hgrc-not-shared` which won't be shared. This also adds a `--non-shared` flag to `hg config` command to see the non-shared config. Differential Revision: https://phab.mercurial-scm.org/D8673
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 01 Jul 2020 15:14:59 +0530
parents fd1de908f2b4
children 4b4160a83303
comparison
equal deleted inserted replaced
45782:fd1de908f2b4 45783:88a47cbf063c
985 else: 985 else:
986 lui = ui.copy() 986 lui = ui.copy()
987 if rcutil.use_repo_hgrc(): 987 if rcutil.use_repo_hgrc():
988 _readsharedsourceconfig(lui, path) 988 _readsharedsourceconfig(lui, path)
989 lui.readconfig(os.path.join(path, b".hg", b"hgrc"), path) 989 lui.readconfig(os.path.join(path, b".hg", b"hgrc"), path)
990 lui.readconfig(os.path.join(path, b".hg", b"hgrc-not-shared"), path)
990 991
991 if rpath: 992 if rpath:
992 path = lui.expandpath(rpath) 993 path = lui.expandpath(rpath)
993 lui = ui.copy() 994 lui = ui.copy()
994 if rcutil.use_repo_hgrc(): 995 if rcutil.use_repo_hgrc():
995 _readsharedsourceconfig(lui, path) 996 _readsharedsourceconfig(lui, path)
996 lui.readconfig(os.path.join(path, b".hg", b"hgrc"), path) 997 lui.readconfig(os.path.join(path, b".hg", b"hgrc"), path)
998 lui.readconfig(os.path.join(path, b".hg", b"hgrc-not-shared"), path)
997 999
998 return path, lui 1000 return path, lui
999 1001
1000 1002
1001 def _checkshellalias(lui, ui, args): 1003 def _checkshellalias(lui, ui, args):