test-obsmarker-template: run mkcommit in subshell to isolate envvars stable
authorYuya Nishihara <yuya@tcha.org>
Sat, 28 Jul 2018 15:52:03 +0900
branchstable
changeset 38748 18df1c6c080f
parent 38747 2b7ce7b55514
child 38749 0c5d131fa428
test-obsmarker-template: run mkcommit in subshell to isolate envvars I don't know if it is a feature or a bug, but it appears that environment variables passed to a shell function persist on /bin/sh.
tests/test-obsmarker-template.t
--- a/tests/test-obsmarker-template.t	Sat Jul 28 15:49:51 2018 +0900
+++ b/tests/test-obsmarker-template.t	Sat Jul 28 15:52:03 2018 +0900
@@ -2598,7 +2598,7 @@
   >    f.write(b't\xe8st2') and None
   > EOF
   $ mkcommit ROOT
-  $ HGENCODING=latin-1 HGUSER="`cat test1`" mkcommit A0
+  $ ( HGENCODING=latin-1 HGUSER="`cat test1`" mkcommit A0 )
   $ echo 42 >> A0
   $ HGENCODING=latin-1 hg amend -m "A1" --note "`cat test2`"
   $ HGENCODING=latin-1 hg amend -m "A2" \
@@ -2611,31 +2611,31 @@
 local encoding since the command is supposed to show unmodified content:
 
   $ HGENCODING=latin-1 hg debugobsolete
-  5f66a482f0bb2fcaccfc215554ad5eb9f40b50f5 718c0d00cee1429bdb73064e0d88908c601507a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'note': 't\xc3\xa8st2', 'operation': 'amend', 'user': 't\xc3\xa8st1'}
+  5f66a482f0bb2fcaccfc215554ad5eb9f40b50f5 718c0d00cee1429bdb73064e0d88908c601507a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'note': 't\xc3\xa8st2', 'operation': 'amend', 'user': 'test'}
   718c0d00cee1429bdb73064e0d88908c601507a8 1132562159b35bb27e1d6b80c80ee94a1659a4da 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 't\xc3\xa8st2'}
-  e1724525bc3bec4472d7915a02811b938004a7a2 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 't\xc3\xa8st2'}
+  8f82db6f991db367fdbb3b6dba5e187ecc3ebd96 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 't\xc3\xa8st2'}
 
 metadata should be converted back to local encoding when displaying:
 
   $ HGENCODING=latin-1 hg fatelog --hidden
-  @  e1724525bc3b
+  @  8f82db6f991d
   |    Obsfate: pruned by t\xe8st2 (at 1970-01-01 00:00 +0000); (esc)
   o  1132562159b3
   |
   | x  718c0d00cee1
   |/     Obsfate: rewritten using amend as 3:1132562159b3 by t\xe8st2 (at 1970-01-01 00:00 +0000); (esc)
   | x  5f66a482f0bb
-  |/     Obsfate: rewritten using amend as 2:718c0d00cee1 by t\xe8st1 (at 1970-01-01 00:00 +0000); (esc)
+  |/     Obsfate: rewritten using amend as 2:718c0d00cee1 by test (at 1970-01-01 00:00 +0000);
   o  ea207398892e
   
   $ HGENCODING=utf-8 hg fatelog --hidden
-  @  e1724525bc3b
+  @  8f82db6f991d
   |    Obsfate: pruned by t\xc3\xa8st2 (at 1970-01-01 00:00 +0000); (esc)
   o  1132562159b3
   |
   | x  718c0d00cee1
   |/     Obsfate: rewritten using amend as 3:1132562159b3 by t\xc3\xa8st2 (at 1970-01-01 00:00 +0000); (esc)
   | x  5f66a482f0bb
-  |/     Obsfate: rewritten using amend as 2:718c0d00cee1 by t\xc3\xa8st1 (at 1970-01-01 00:00 +0000); (esc)
+  |/     Obsfate: rewritten using amend as 2:718c0d00cee1 by test (at 1970-01-01 00:00 +0000);
   o  ea207398892e