tests/test-show-work.t
branchstable
changeset 32058 0bb157bebb43
parent 31944 99bc93147d87
child 33049 0b42c7ba46a6
equal deleted inserted replaced
32057:e5ffc91a2276 32058:0bb157bebb43
       
     1   $ cat >> $HGRCPATH << EOF
       
     2   > [extensions]
       
     3   > show =
       
     4   > EOF
       
     5 
       
     6   $ hg init repo0
       
     7   $ cd repo0
       
     8 
       
     9 Command works on an empty repo
       
    10 
       
    11   $ hg show work
       
    12 
       
    13 Single draft changeset shown
       
    14 
       
    15   $ echo 0 > foo
       
    16   $ hg -q commit -A -m 'commit 0'
       
    17 
       
    18   $ hg show work
       
    19   @  9f171 commit 0
       
    20 
       
    21 Even when it isn't the wdir
       
    22 
       
    23   $ hg -q up null
       
    24 
       
    25   $ hg show work
       
    26   o  9f171 commit 0
       
    27 
       
    28 Single changeset is still there when public because it is a head
       
    29 
       
    30   $ hg phase --public -r 0
       
    31   $ hg show work
       
    32   o  9f171 commit 0
       
    33 
       
    34 A draft child will show both it and public parent
       
    35 
       
    36   $ hg -q up 0
       
    37   $ echo 1 > foo
       
    38   $ hg commit -m 'commit 1'
       
    39 
       
    40   $ hg show work
       
    41   @  181cc commit 1
       
    42   o  9f171 commit 0
       
    43 
       
    44 Multiple draft children will be shown
       
    45 
       
    46   $ echo 2 > foo
       
    47   $ hg commit -m 'commit 2'
       
    48 
       
    49   $ hg show work
       
    50   @  128c8 commit 2
       
    51   o  181cc commit 1
       
    52   o  9f171 commit 0
       
    53 
       
    54 Bumping first draft changeset to public will hide its parent
       
    55 
       
    56   $ hg phase --public -r 1
       
    57   $ hg show work
       
    58   @  128c8 commit 2
       
    59   o  181cc commit 1
       
    60   |
       
    61   ~
       
    62 
       
    63 Multiple DAG heads will be shown
       
    64 
       
    65   $ hg -q up -r 1
       
    66   $ echo 3 > foo
       
    67   $ hg commit -m 'commit 3'
       
    68   created new head
       
    69 
       
    70   $ hg show work
       
    71   @  f0abc commit 3
       
    72   | o  128c8 commit 2
       
    73   |/
       
    74   o  181cc commit 1
       
    75   |
       
    76   ~
       
    77 
       
    78 Even when wdir is something else
       
    79 
       
    80   $ hg -q up null
       
    81 
       
    82   $ hg show work
       
    83   o  f0abc commit 3
       
    84   | o  128c8 commit 2
       
    85   |/
       
    86   o  181cc commit 1
       
    87   |
       
    88   ~
       
    89 
       
    90 Draft child shows public head (multiple heads)
       
    91 
       
    92   $ hg -q up 0
       
    93   $ echo 4 > foo
       
    94   $ hg commit -m 'commit 4'
       
    95   created new head
       
    96 
       
    97   $ hg show work
       
    98   @  668ca commit 4
       
    99   | o  f0abc commit 3
       
   100   | | o  128c8 commit 2
       
   101   | |/
       
   102   | o  181cc commit 1
       
   103   |/
       
   104   o  9f171 commit 0
       
   105 
       
   106   $ cd ..
       
   107 
       
   108 Branch name appears in output
       
   109 
       
   110   $ hg init branches
       
   111   $ cd branches
       
   112   $ echo 0 > foo
       
   113   $ hg -q commit -A -m 'commit 0'
       
   114   $ echo 1 > foo
       
   115   $ hg commit -m 'commit 1'
       
   116   $ echo 2 > foo
       
   117   $ hg commit -m 'commit 2'
       
   118   $ hg phase --public -r .
       
   119   $ hg -q up -r 1
       
   120   $ hg branch mybranch
       
   121   marked working directory as branch mybranch
       
   122   (branches are permanent and global, did you want a bookmark?)
       
   123   $ echo 3 > foo
       
   124   $ hg commit -m 'commit 3'
       
   125   $ echo 4 > foo
       
   126   $ hg commit -m 'commit 4'
       
   127 
       
   128   $ hg show work
       
   129   @  f8dd3 (mybranch) commit 4
       
   130   o  90cfc (mybranch) commit 3
       
   131   | o  128c8 commit 2
       
   132   |/
       
   133   o  181cc commit 1
       
   134   |
       
   135   ~
       
   136 
       
   137   $ cd ..
       
   138 
       
   139 Bookmark name appears in output
       
   140 
       
   141   $ hg init bookmarks
       
   142   $ cd bookmarks
       
   143   $ echo 0 > foo
       
   144   $ hg -q commit -A -m 'commit 0'
       
   145   $ echo 1 > foo
       
   146   $ hg commit -m 'commit 1'
       
   147   $ echo 2 > foo
       
   148   $ hg commit -m 'commit 2'
       
   149   $ hg phase --public -r .
       
   150   $ hg bookmark @
       
   151   $ hg -q up -r 1
       
   152   $ echo 3 > foo
       
   153   $ hg commit -m 'commit 3'
       
   154   created new head
       
   155   $ echo 4 > foo
       
   156   $ hg commit -m 'commit 4'
       
   157   $ hg bookmark mybook
       
   158 
       
   159   $ hg show work
       
   160   @  cac82 (mybook) commit 4
       
   161   o  f0abc commit 3
       
   162   | o  128c8 (@) commit 2
       
   163   |/
       
   164   o  181cc commit 1
       
   165   |
       
   166   ~
       
   167 
       
   168   $ cd ..