tests/test-show-work.t
changeset 34203 e6b5e7329ff2
parent 33062 0a507da7d8ea
child 34877 eb24f1d1b50b
equal deleted inserted replaced
34202:4441c1113eb2 34203:e6b5e7329ff2
    14 
    14 
    15   $ echo 0 > foo
    15   $ echo 0 > foo
    16   $ hg -q commit -A -m 'commit 0'
    16   $ hg -q commit -A -m 'commit 0'
    17 
    17 
    18   $ hg show work
    18   $ hg show work
    19   @  9f171 commit 0
    19   @  9f17 commit 0
    20 
    20 
    21 Even when it isn't the wdir
    21 Even when it isn't the wdir
    22 
    22 
    23   $ hg -q up null
    23   $ hg -q up null
    24 
    24 
    25   $ hg show work
    25   $ hg show work
    26   o  9f171 commit 0
    26   o  9f17 commit 0
    27 
    27 
    28 Single changeset is still there when public because it is a head
    28 Single changeset is still there when public because it is a head
    29 
    29 
    30   $ hg phase --public -r 0
    30   $ hg phase --public -r 0
    31   $ hg show work
    31   $ hg show work
    32   o  9f171 commit 0
    32   o  9f17 commit 0
    33 
    33 
    34 A draft child will show both it and public parent
    34 A draft child will show both it and public parent
    35 
    35 
    36   $ hg -q up 0
    36   $ hg -q up 0
    37   $ echo 1 > foo
    37   $ echo 1 > foo
    38   $ hg commit -m 'commit 1'
    38   $ hg commit -m 'commit 1'
    39 
    39 
    40   $ hg show work
    40   $ hg show work
    41   @  181cc commit 1
    41   @  181c commit 1
    42   o  9f171 commit 0
    42   o  9f17 commit 0
    43 
    43 
    44 Multiple draft children will be shown
    44 Multiple draft children will be shown
    45 
    45 
    46   $ echo 2 > foo
    46   $ echo 2 > foo
    47   $ hg commit -m 'commit 2'
    47   $ hg commit -m 'commit 2'
    48 
    48 
    49   $ hg show work
    49   $ hg show work
    50   @  128c8 commit 2
    50   @  128c commit 2
    51   o  181cc commit 1
    51   o  181c commit 1
    52   o  9f171 commit 0
    52   o  9f17 commit 0
    53 
    53 
    54 Bumping first draft changeset to public will hide its parent
    54 Bumping first draft changeset to public will hide its parent
    55 
    55 
    56   $ hg phase --public -r 1
    56   $ hg phase --public -r 1
    57   $ hg show work
    57   $ hg show work
    58   @  128c8 commit 2
    58   @  128c commit 2
    59   o  181cc commit 1
    59   o  181c commit 1
    60   |
    60   |
    61   ~
    61   ~
    62 
    62 
    63 Multiple DAG heads will be shown
    63 Multiple DAG heads will be shown
    64 
    64 
    66   $ echo 3 > foo
    66   $ echo 3 > foo
    67   $ hg commit -m 'commit 3'
    67   $ hg commit -m 'commit 3'
    68   created new head
    68   created new head
    69 
    69 
    70   $ hg show work
    70   $ hg show work
    71   @  f0abc commit 3
    71   @  f0ab commit 3
    72   | o  128c8 commit 2
    72   | o  128c commit 2
    73   |/
    73   |/
    74   o  181cc commit 1
    74   o  181c commit 1
    75   |
    75   |
    76   ~
    76   ~
    77 
    77 
    78 Even when wdir is something else
    78 Even when wdir is something else
    79 
    79 
    80   $ hg -q up null
    80   $ hg -q up null
    81 
    81 
    82   $ hg show work
    82   $ hg show work
    83   o  f0abc commit 3
    83   o  f0ab commit 3
    84   | o  128c8 commit 2
    84   | o  128c commit 2
    85   |/
    85   |/
    86   o  181cc commit 1
    86   o  181c commit 1
    87   |
    87   |
    88   ~
    88   ~
    89 
    89 
    90 Draft child shows public head (multiple heads)
    90 Draft child shows public head (multiple heads)
    91 
    91 
    93   $ echo 4 > foo
    93   $ echo 4 > foo
    94   $ hg commit -m 'commit 4'
    94   $ hg commit -m 'commit 4'
    95   created new head
    95   created new head
    96 
    96 
    97   $ hg show work
    97   $ hg show work
    98   @  668ca commit 4
    98   @  668c commit 4
    99   | o  f0abc commit 3
    99   | o  f0ab commit 3
   100   | | o  128c8 commit 2
   100   | | o  128c commit 2
   101   | |/
   101   | |/
   102   | o  181cc commit 1
   102   | o  181c commit 1
   103   |/
   103   |/
   104   o  9f171 commit 0
   104   o  9f17 commit 0
   105 
   105 
   106   $ cd ..
   106   $ cd ..
   107 
   107 
   108 Branch name appears in output
   108 Branch name appears in output
   109 
   109 
   124   $ hg commit -m 'commit 3'
   124   $ hg commit -m 'commit 3'
   125   $ echo 4 > foo
   125   $ echo 4 > foo
   126   $ hg commit -m 'commit 4'
   126   $ hg commit -m 'commit 4'
   127 
   127 
   128   $ hg show work
   128   $ hg show work
   129   @  f8dd3 (mybranch) commit 4
   129   @  f8dd (mybranch) commit 4
   130   o  90cfc (mybranch) commit 3
   130   o  90cf (mybranch) commit 3
   131   | o  128c8 commit 2
   131   | o  128c commit 2
   132   |/
   132   |/
   133   o  181cc commit 1
   133   o  181c commit 1
   134   |
   134   |
   135   ~
   135   ~
   136 
   136 
   137   $ cd ..
   137   $ cd ..
   138 
   138 
   155   $ echo 4 > foo
   155   $ echo 4 > foo
   156   $ hg commit -m 'commit 4'
   156   $ hg commit -m 'commit 4'
   157   $ hg bookmark mybook
   157   $ hg bookmark mybook
   158 
   158 
   159   $ hg show work
   159   $ hg show work
   160   @  cac82 (mybook) commit 4
   160   @  cac8 (mybook) commit 4
   161   o  f0abc commit 3
   161   o  f0ab commit 3
   162   | o  128c8 (@) commit 2
   162   | o  128c (@) commit 2
   163   |/
   163   |/
   164   o  181cc commit 1
   164   o  181c commit 1
   165   |
   165   |
   166   ~
   166   ~
   167 
   167 
   168   $ cd ..
   168   $ cd ..
   169 
   169 
   180   $ echo 2 > foo
   180   $ echo 2 > foo
   181   $ hg commit -m 'commit 3'
   181   $ hg commit -m 'commit 3'
   182   $ hg tag 0.2
   182   $ hg tag 0.2
   183 
   183 
   184   $ hg show work
   184   $ hg show work
   185   @  37582 Added tag 0.2 for changeset 6379c25b76f1
   185   @  3758 Added tag 0.2 for changeset 6379c25b76f1
   186   o  6379c (0.2) commit 3
   186   o  6379 (0.2) commit 3
   187   o  a2ad9 Added tag 0.1 for changeset 6a75536ea0b1
   187   o  a2ad Added tag 0.1 for changeset 6a75536ea0b1
   188   |
   188   |
   189   ~
   189   ~
   190 
   190 
   191   $ cd ..
   191   $ cd ..
   192 
   192 
   203   $ hg bookmark mybook
   203   $ hg bookmark mybook
   204   $ echo 1 > foo
   204   $ echo 1 > foo
   205   $ hg commit -m 'commit 2'
   205   $ hg commit -m 'commit 2'
   206 
   206 
   207   $ hg show work
   207   $ hg show work
   208   @  34834 (mybook) (mybranch) commit 2
   208   @  3483 (mybook) (mybranch) commit 2
   209   o  97fcc commit 1
   209   o  97fc commit 1
   210 
   210 
   211 Multiple bookmarks on same changeset render properly
   211 Multiple bookmarks on same changeset render properly
   212 
   212 
   213   $ hg book mybook2
   213   $ hg book mybook2
   214   $ hg show work
   214   $ hg show work
   215   @  34834 (mybook mybook2) (mybranch) commit 2
   215   @  3483 (mybook mybook2) (mybranch) commit 2
   216   o  97fcc commit 1
   216   o  97fc commit 1
   217 
   217 
   218   $ cd ..
   218   $ cd ..
   219 
   219 
   220 Extra namespaces are rendered
   220 Extra namespaces are rendered
   221 
   221 
   228   $ hg commit -m 'commit 2'
   228   $ hg commit -m 'commit 2'
   229   $ echo 2 > foo
   229   $ echo 2 > foo
   230   $ hg commit -m 'commit 3'
   230   $ hg commit -m 'commit 3'
   231 
   231 
   232   $ hg --config extensions.revnames=$TESTDIR/revnamesext.py show work
   232   $ hg --config extensions.revnames=$TESTDIR/revnamesext.py show work
   233   @  32f3e (r2) commit 3
   233   @  32f3 (r2) commit 3
   234   o  6a755 (r1) commit 2
   234   o  6a75 (r1) commit 2
   235   o  97fcc (r0) commit 1
   235   o  97fc (r0) commit 1
   236 
   236 
   237   $ cd ..
   237   $ cd ..
       
   238 
       
   239 Prefix collision on hashes increases shortest node length
       
   240 
       
   241   $ hg init hashcollision
       
   242   $ cd hashcollision
       
   243   $ echo 0 > a
       
   244   $ hg -q commit -Am 0
       
   245   $ for i in 17 1057 2857 4025; do
       
   246   >   hg -q up 0
       
   247   >   echo $i > a
       
   248   >   hg -q commit -m $i
       
   249   >   echo 0 > a
       
   250   >   hg commit -m "$i commit 2"
       
   251   > done
       
   252 
       
   253   $ hg show work
       
   254   @  cfd04 4025 commit 2
       
   255   o  c562d 4025
       
   256   | o  08048 2857 commit 2
       
   257   | o  c5623 2857
       
   258   |/
       
   259   | o  6a6b6 1057 commit 2
       
   260   | o  c5625 1057
       
   261   |/
       
   262   | o  96b4e 17 commit 2
       
   263   | o  11424 17
       
   264   |/
       
   265   o  b4e73 0
       
   266 
       
   267   $ cd ..