tests/test-evolve-obshistory.t
changeset 5174 9b8d4403b735
parent 5173 dbbb48d93f18
child 5262 678a9223aad3
--- a/tests/test-evolve-obshistory.t	Tue Feb 25 18:07:30 2020 +0700
+++ b/tests/test-evolve-obshistory.t	Fri Mar 06 21:37:28 2020 +0700
@@ -177,3 +177,47 @@
   |  rewritten using amend
   @  471f378eab4c 1 A0
      rewritten using amend
+
+Test output with non-local changesets and various templates
+===========================================================
+
+  $ hg init $TESTTMP/obslog-non-local-templates
+  $ cd $TESTTMP/obslog-non-local-templates
+  $ cat << EOF >> .hg/hgrc
+  > [templates]
+  > fancy = '{desc|firstline}\n{markers % "{verb} using {operations} by {users} ({join(notes, "; ")})"}'
+  > fancier = '{desc|firstline}\n{markers % "{join(users, ", ")} had {verb} this commit using {join(operations, "/")} and said: {join(notes % "\"{note}\"", ", ")})"}'
+  > EOF
+
+  $ mkcommit A0
+  $ hg metaedit -m 'A1' -n 'note1' -d '42 0' --config devel.default-date='1 0' -q
+  $ HGUSER=alice hg amend -m 'A2' -n 'note2'
+  $ HGUSER=bob hg amend -m 'A3' -n 'note3'
+
+  $ hg debugobsolete
+  6ffd04c870fe2b73e7c885e508c4f1213a75c4d4 e481355d236800802337be3e637bd820870b04d2 0 (Thu Jan 01 00:00:01 1970 +0000) {'ef1': '33', 'note': 'note1', 'operation': 'metaedit', 'user': 'test'}
+  e481355d236800802337be3e637bd820870b04d2 65835bf83412a950e6a47f023690d5e6ae09718d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'note': 'note2', 'operation': 'amend', 'user': 'alice'}
+  65835bf83412a950e6a47f023690d5e6ae09718d 41985e02b792daac8907f6b30b513bbf6e8e034d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'note': 'note3', 'operation': 'amend', 'user': 'bob'}
+
+  $ hg strip 'desc(A1) + desc(A2)' --hidden --quiet --config extensions.strip=
+
+  $ hg obslog -f
+  @  41985e02b792 (1) A3
+  |
+  x  6ffd04c870fe (0) A0
+       rewritten(description, date) as 41985e02b792 using amend, metaedit by alice, bob, test (between Thu Jan 01 00:00:00 1970 +0000 and Thu Jan 01 00:00:01 1970 +0000)
+         note: note1
+         note: note2
+         note: note3
+  
+  $ hg obslog -f -T fancy
+  @  A3
+  |
+  x  A0
+     rewritten using amend, metaedit by alice, bob, test (note1; note2; note3)
+
+  $ hg obslog -f -T fancier
+  @  A3
+  |
+  x  A0
+     alice, bob, test had rewritten this commit using amend/metaedit and said: "note1", "note2", "note3")