Patchwork [1,of,4] tests: add test showing broken extension loading in case of share-safe

login
register
mail settings
Submitter Pulkit Goyal
Date Oct. 16, 2020, 7:56 a.m.
Message ID <90e0e681dc5b94b16364.1602834991@workspace>
Download mbox | patch
Permalink /patch/47484/
State New
Headers show

Comments

Pulkit Goyal - Oct. 16, 2020, 7:56 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1600430302 -19800
#      Fri Sep 18 17:28:22 2020 +0530
# Node ID 90e0e681dc5b94b1636417b7f5da75762a88572f
# Parent  94f681b84c7016289763937cde633cb1d8c831b1
# EXP-Topic share-safe
tests: add test showing broken extension loading in case of share-safe

When we are using share-safe and loading source repository config, we are still
not loading the extensions which are enabled in the source repository.

This patch demonstrates the bug. Meanwhile it also shows how unreliable `hg
debugextensions` is.

Differential Revision: https://phab.mercurial-scm.org/D9046

Patch

diff --git a/tests/test-share-safe.t b/tests/test-share-safe.t
--- a/tests/test-share-safe.t
+++ b/tests/test-share-safe.t
@@ -81,6 +81,43 @@  Check that config of the source reposito
   $ hg showconfig ui.curses
   true
 
+Test that extensions of source repository are also loaded
+
+  $ hg debugextensions
+  share
+  $ hg extdiff -p echo
+  hg: unknown command 'extdiff'
+  'extdiff' is provided by the following extension:
+  
+      extdiff       command to allow external programs to compare revisions
+  
+  (use 'hg help extensions' for information on enabling extensions)
+  [255]
+
+  $ echo "[extensions]" >> ../source/.hg/hgrc
+  $ echo "extdiff=" >> ../source/.hg/hgrc
+
+  $ hg debugextensions -R ../source
+  extdiff
+  share
+  $ hg extdiff -R ../source -p echo
+
+BROKEN: the command below does not work but debugextensions says that extension
+is loaded
+  $ hg debugextensions
+  extdiff
+  share
+
+BROKEN: extdiff command should work here
+  $ hg extdiff -p echo
+  hg: unknown command 'extdiff'
+  'extdiff' is provided by the following extension:
+  
+      extdiff       command to allow external programs to compare revisions
+  
+  (use 'hg help extensions' for information on enabling extensions)
+  [255]
+
 However, local .hg/hgrc should override the config set by share source
 
   $ echo "[ui]" >> .hg/hgrc
@@ -92,6 +129,8 @@  However, local .hg/hgrc should override 
   $ HGEDITOR=cat hg config --shared
   [ui]
   curses=true
+  [extensions]
+  extdiff=
 
   $ HGEDITOR=cat hg config --local
   [ui]