[PATCH 5 of 6] tests: add more tests for names rendering in `hg show work`

Gregory Szorc gregory.szorc at gmail.com
Sat Jun 24 18:13:51 EDT 2017


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1498340695 25200
#      Sat Jun 24 14:44:55 2017 -0700
# Node ID fca3aaf4880d79672d6301e3d40a94ec284dc548
# Parent  009938bcc518c07b8a077b28e6df01bae66de4fa
tests: add more tests for names rendering in `hg show work`

This demonstrates some missing features. This will also help
verify that a subsequent change has the intended effect.

diff --git a/tests/test-show-work.t b/tests/test-show-work.t
--- a/tests/test-show-work.t
+++ b/tests/test-show-work.t
@@ -166,3 +166,74 @@ Bookmark name appears in output
   ~
 
   $ cd ..
+
+Tags are rendered
+
+  $ hg init tags
+  $ cd tags
+  $ echo 0 > foo
+  $ hg -q commit -A -m 'commit 1'
+  $ echo 1 > foo
+  $ hg commit -m 'commit 2'
+  $ hg tag 0.1
+  $ hg phase --public -r .
+  $ echo 2 > foo
+  $ hg commit -m 'commit 3'
+  $ hg tag 0.2
+
+TODO tags aren't yet rendered
+  $ hg show work
+  @  37582 Added tag 0.2 for changeset 6379c25b76f1
+  o  6379c commit 3
+  o  a2ad9 Added tag 0.1 for changeset 6a75536ea0b1
+  |
+  ~
+
+  $ cd ..
+
+Multiple names on same changeset render properly
+
+  $ hg init multiplenames
+  $ cd multiplenames
+  $ echo 0 > foo
+  $ hg -q commit -A -m 'commit 1'
+  $ hg phase --public -r .
+  $ hg branch mybranch
+  marked working directory as branch mybranch
+  (branches are permanent and global, did you want a bookmark?)
+  $ hg bookmark mybook
+  $ echo 1 > foo
+  $ hg commit -m 'commit 2'
+
+  $ hg show work
+  @  34834 (mybranch) (mybook) commit 2
+  o  97fcc commit 1
+
+Multiple bookmarks on same changeset render properly
+
+  $ hg book mybook2
+  $ hg show work
+  @  34834 (mybranch) (mybook mybook2) commit 2
+  o  97fcc commit 1
+
+  $ cd ..
+
+Extra namespaces are rendered
+
+  $ hg init extranamespaces
+  $ cd extranamespaces
+  $ echo 0 > foo
+  $ hg -q commit -A -m 'commit 1'
+  $ hg phase --public -r .
+  $ echo 1 > foo
+  $ hg commit -m 'commit 2'
+  $ echo 2 > foo
+  $ hg commit -m 'commit 3'
+
+TODO don't yet render extra namespaces
+  $ hg --config extensions.revnames=$TESTDIR/revnamesext.py show work
+  @  32f3e commit 3
+  o  6a755 commit 2
+  o  97fcc commit 1
+
+  $ cd ..


More information about the Mercurial-devel mailing list