tests/test-stack.t
author Gregory Szorc <gregory.szorc@gmail.com>
Thu, 30 Nov 2017 21:19:46 -0500
branchstable
changeset 37833 6614cac550ae
parent 37004 68fcc5503ec5
permissions -rw-r--r--
filelog: don't crash on invalid copy metadata (issue5748) "copy" and "copyrev" are both supposed to appear next to each other. However, a user report demonstrated a crash that indicates that something in the wild is producing "copy" without "copyrev" (probably `hg convert`). While we should definitely fix the source of the bad metadata, the bad code causing the crash is already in the wild and who knows how many repositories are impacted. So let's be more defensive when accessing the file revision metadata.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37001
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     1
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     2
This test test the low-level definition of stack, agnostic from all formatting
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     3
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     4
Initial setup
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     5
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     6
  $ cat << EOF >> $HGRCPATH
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     7
  > [ui]
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     8
  > logtemplate = {rev} {branch} {phase} {desc|firstline}\n
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
     9
  > [extensions]
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    10
  > rebase=
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    11
  > [experimental]
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    12
  > evolution=createmarkers,exchange,allowunstable
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    13
  > EOF
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    14
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    15
  $ hg init main
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    16
  $ cd main
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    17
  $ hg branch other
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    18
  marked working directory as branch other
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    19
  (branches are permanent and global, did you want a bookmark?)
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    20
  $ echo aaa > aaa
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    21
  $ hg add aaa
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    22
  $ hg commit -m c_a
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    23
  $ echo aaa > bbb
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    24
  $ hg add bbb
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    25
  $ hg commit -m c_b
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    26
  $ hg branch foo
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    27
  marked working directory as branch foo
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    28
  $ echo aaa > ccc
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    29
  $ hg add ccc
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    30
  $ hg commit -m c_c
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    31
  $ echo aaa > ddd
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    32
  $ hg add ddd
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    33
  $ hg commit -m c_d
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    34
  $ echo aaa > eee
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    35
  $ hg add eee
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    36
  $ hg commit -m c_e
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    37
  $ echo aaa > fff
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    38
  $ hg add fff
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    39
  $ hg commit -m c_f
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    40
  $ hg log -G
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    41
  @  5 foo draft c_f
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    42
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    43
  o  4 foo draft c_e
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    44
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    45
  o  3 foo draft c_d
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    46
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    47
  o  2 foo draft c_c
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    48
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    49
  o  1 other draft c_b
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    50
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    51
  o  0 other draft c_a
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    52
  
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    53
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    54
Check that stack doesn't include public changesets
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    55
--------------------------------------------------
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    56
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    57
  $ hg up other
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    58
  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    59
  $ hg log -G -r "stack()"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    60
  @  1 other draft c_b
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    61
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    62
  o  0 other draft c_a
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    63
  
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    64
  $ hg phase --public 'branch("other")'
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    65
  $ hg log -G -r "stack()"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    66
  $ hg up foo
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    67
  4 files updated, 0 files merged, 0 files removed, 0 files unresolved
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    68
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    69
Simple test
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    70
-----------
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    71
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    72
'stack()' list all changeset in the branch
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    73
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    74
  $ hg branch
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    75
  foo
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    76
  $ hg log -G -r "stack()"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    77
  @  5 foo draft c_f
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    78
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    79
  o  4 foo draft c_e
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    80
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    81
  o  3 foo draft c_d
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    82
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    83
  o  2 foo draft c_c
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    84
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    85
  ~
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    86
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    87
Case with some of the branch unstable
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    88
------------------------------------
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    89
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    90
  $ hg up 3
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    91
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    92
  $ echo bbb > ddd
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    93
  $ hg commit --amend
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    94
  2 new orphan changesets
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    95
  $ hg log -G
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    96
  @  6 foo draft c_d
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    97
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    98
  | *  5 foo draft c_f
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
    99
  | |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   100
  | *  4 foo draft c_e
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   101
  | |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   102
  | x  3 foo draft c_d
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   103
  |/
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   104
  o  2 foo draft c_c
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   105
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   106
  o  1 other public c_b
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   107
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   108
  o  0 other public c_a
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   109
  
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   110
  $ hg log -G -r "stack()"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   111
  @  6 foo draft c_d
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   112
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   113
  ~
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   114
  $ hg up -r "desc(c_e)"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   115
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   116
  $ hg log -G -r "stack()"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   117
  @  4 foo draft c_e
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   118
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   119
  x  3 foo draft c_d
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   120
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   121
  ~
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   122
  $ hg up -r "desc(c_d)"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   123
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   124
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   125
  $ hg log -G -r "stack()"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   126
  @  6 foo draft c_d
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   127
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   128
  ~
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   129
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   130
Case with multiple topological heads
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   131
------------------------------------
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   132
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   133
Make things linear again
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   134
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   135
  $ hg rebase -s 'desc(c_e)' -d 'desc(c_d) - obsolete()'
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   136
  rebasing 4:4f2a69f6d380 "c_e"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   137
  rebasing 5:913c298d8b0a "c_f"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   138
  $ hg log -G
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   139
  o  8 foo draft c_f
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   140
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   141
  o  7 foo draft c_e
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   142
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   143
  @  6 foo draft c_d
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   144
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   145
  o  2 foo draft c_c
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   146
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   147
  o  1 other public c_b
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   148
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   149
  o  0 other public c_a
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   150
  
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   151
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   152
Create the second branch
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   153
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   154
  $ hg up 'desc(c_d)'
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   155
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   156
  $ echo aaa > ggg
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   157
  $ hg add ggg
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   158
  $ hg commit -m c_g
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   159
  created new head
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   160
  $ echo aaa > hhh
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   161
  $ hg add hhh
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   162
  $ hg commit -m c_h
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   163
  $ hg log -G
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   164
  @  10 foo draft c_h
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   165
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   166
  o  9 foo draft c_g
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   167
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   168
  | o  8 foo draft c_f
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   169
  | |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   170
  | o  7 foo draft c_e
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   171
  |/
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   172
  o  6 foo draft c_d
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   173
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   174
  o  2 foo draft c_c
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   175
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   176
  o  1 other public c_b
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   177
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   178
  o  0 other public c_a
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   179
  
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   180
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   181
Test output
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   182
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   183
  $ hg log -G -r "stack(10)"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   184
  @  10 foo draft c_h
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   185
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   186
  o  9 foo draft c_g
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   187
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   188
  ~
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   189
  $ hg log -G -r "stack(8)"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   190
  o  8 foo draft c_f
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   191
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   192
  o  7 foo draft c_e
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   193
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   194
  ~
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   195
  $ hg log -G -r "stack(head())"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   196
  @  10 foo draft c_h
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   197
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   198
  o  9 foo draft c_g
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   199
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   200
  ~
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   201
  o  8 foo draft c_f
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   202
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   203
  o  7 foo draft c_e
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   204
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   205
  ~
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   206
Check the stack order
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   207
  $ hg log -r "first(stack())"
37004
68fcc5503ec5 stack: return a sorted smartrev by default
Boris Feld <boris.feld@octobus.net>
parents: 37001
diff changeset
   208
  9 foo draft c_g
37001
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   209
  $ hg log -r "first(stack(10))"
37004
68fcc5503ec5 stack: return a sorted smartrev by default
Boris Feld <boris.feld@octobus.net>
parents: 37001
diff changeset
   210
  9 foo draft c_g
37001
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   211
  $ hg log -r "first(stack(8))"
37004
68fcc5503ec5 stack: return a sorted smartrev by default
Boris Feld <boris.feld@octobus.net>
parents: 37001
diff changeset
   212
  7 foo draft c_e
37001
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   213
  $ hg log -r "first(stack(head()))"
37004
68fcc5503ec5 stack: return a sorted smartrev by default
Boris Feld <boris.feld@octobus.net>
parents: 37001
diff changeset
   214
  7 foo draft c_e
37001
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   215
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   216
Case with multiple heads with unstability involved
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   217
--------------------------------------------------
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   218
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   219
We amend the message to make sure the display base pick the right changeset
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   220
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   221
  $ hg up 'desc(c_d)'
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   222
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   223
  $ echo ccc > ddd
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   224
  $ hg commit --amend -m 'c_D'
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   225
  4 new orphan changesets
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   226
  $ hg rebase -d . -s 'desc(c_g)'
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   227
  rebasing 9:2ebb6e48ab8a "c_g"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   228
  rebasing 10:634f38e27a1d "c_h"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   229
  $ hg log -G
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   230
  o  13 foo draft c_h
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   231
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   232
  o  12 foo draft c_g
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   233
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   234
  @  11 foo draft c_D
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   235
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   236
  | *  8 foo draft c_f
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   237
  | |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   238
  | *  7 foo draft c_e
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   239
  | |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   240
  | x  6 foo draft c_d
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   241
  |/
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   242
  o  2 foo draft c_c
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   243
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   244
  o  1 other public c_b
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   245
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   246
  o  0 other public c_a
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   247
  
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   248
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   249
We should improve stack definition to also show 12 and 13 here
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   250
  $ hg log -G -r "stack()"
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   251
  @  11 foo draft c_D
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   252
  |
407934a97bc7 stack: import Evolve stack test file
Boris Feld <boris.feld@octobus.net>
parents:
diff changeset
   253
  ~