diff tests/test-share-safe.t @ 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 8d72e29ad1e0
line wrap: on
line diff
--- a/tests/test-share-safe.t	Fri Sep 18 18:52:38 2020 +0530
+++ b/tests/test-share-safe.t	Wed Jul 01 15:14:59 2020 +0530
@@ -253,6 +253,25 @@
   date:        Thu Jan 01 00:00:00 1970 +0000
   summary:     added c
   
+
+Testing that nonsharedrc is loaded for source and not shared
+
+  $ cd ../source
+  $ touch .hg/hgrc-not-shared
+  $ echo "[ui]" >> .hg/hgrc-not-shared
+  $ echo "traceback=true" >> .hg/hgrc-not-shared
+
+  $ hg showconfig ui.traceback
+  true
+
+  $ HGEDITOR=cat hg config --non-shared
+  [ui]
+  traceback=true
+
+  $ cd ../shared1
+  $ hg showconfig ui.traceback
+  [1]
+
 Unsharing works
 
   $ hg unshare