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

login
register
mail settings
Submitter Gregory Szorc
Date June 24, 2017, 10:13 p.m.
Message ID <fca3aaf4880d79672d63.1498342431@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/21680/
State Accepted
Headers show

Comments

Gregory Szorc - June 24, 2017, 10:13 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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.

Patch

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 ..