tests/test-show-stack.t
author Gregory Szorc <gregory.szorc@gmail.com>
Sat, 20 Jan 2018 22:55:42 -0800
changeset 35793 4fb2bb61597c
parent 34191 e6b5e7329ff2
permissions -rw-r--r--
bundle2: increase payload part chunk size to 32kb Bundle2 payload parts are framed chunks. Esentially, we obtain data in equal size chunks of size `preferedchunksize` and emit those to a generator. That generator is fed into a compressor (which can be the no-op compressor, which just re-emits the generator). And the output from the compressor likely goes to a file descriptor or socket. What this means is that small chunk sizes create more Python objects and Python function calls than larger chunk sizes. And as we know, Python object and function call overhead in performance sensitive code matters (at least with CPython). This commit increases the bundle2 part payload chunk size from 4k to 32k. Practically speaking, this means that the chunks we feed into a compressor (implemented in C code) or feed directly into a file handle or socket write() are larger. It's possible the chunks might be larger than what the receiver can handle in one logical operation. But at that point, we're in C code, which is much more efficient at dealing with splitting up the chunk and making multiple function calls than Python is. A downside to larger chunks is that the receiver has to wait for that much data to arrive (either raw or from a decompressor) before it can process the chunk. But 32kb still feels like a small buffer to have to wait for. And in many cases, the client will convert from 8 read(4096) to 1 read(32768). That's happening in Python land. So we cut down on the number of Python objects and function calls, making the client faster as well. I don't think there are any significant concerns to increasing the payload chunk size to 32kb. The impact of this change on performance significant. Using `curl` to obtain a stream clone bundle2 payload from a server on localhost serving the mozilla-unified repository: before: 20.78 user; 7.71 system; 80.5 MB/s after: 13.90 user; 3.51 system; 132 MB/s legacy: 9.72 user; 8.16 system; 132 MB/s bundle2 stream clone generation is still more resource intensive than legacy stream clone (that's likely because of the use of a util.chunkbuffer). But the throughput is the same. We might be in territory we're this is effectively a benchmark of the networking stack or Python's syscall throughput. From the client perspective, `hg clone -U --stream`: before: 33.50 user; 7.95 system; 53.3 MB/s after: 22.82 user; 7.33 system; 72.7 MB/s legacy: 29.96 user; 7.94 system; 58.0 MB/s And for `hg clone --stream` with a working directory update of ~230k files: after: 119.55 user; 26.47 system; 0:57.08 wall legacy: 126.98 user; 26.94 system; 1:05.56 wall So, it appears that bundle2's stream clone is now definitively faster than legacy stream clone! Differential Revision: https://phab.mercurial-scm.org/D1932
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     1
  $ cat >> $HGRCPATH << EOF
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     2
  > [extensions]
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     3
  > show =
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     4
  > EOF
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     5
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     6
  $ hg init repo0
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     7
  $ cd repo0
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     8
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
     9
Empty repo / no checkout results in error
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    10
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    11
  $ hg show stack
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    12
  abort: stack view only available when there is a working directory
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    13
  [255]
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    14
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    15
Stack displays single draft changeset as root revision
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    16
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    17
  $ echo 0 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    18
  $ hg -q commit -A -m 'commit 0'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    19
  $ hg show stack
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    20
    @  9f17 commit 0
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    21
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    22
Stack displays multiple draft changesets
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    23
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    24
  $ echo 1 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    25
  $ hg commit -m 'commit 1'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    26
  $ echo 2 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    27
  $ hg commit -m 'commit 2'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    28
  $ echo 3 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    29
  $ hg commit -m 'commit 3'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    30
  $ echo 4 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    31
  $ hg commit -m 'commit 4'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    32
  $ hg show stack
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    33
    @  2737 commit 4
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    34
    o  d1a6 commit 3
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    35
    o  128c commit 2
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    36
    o  181c commit 1
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    37
    o  9f17 commit 0
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    38
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    39
Public parent of draft base is displayed, separated from stack
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    40
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    41
  $ hg phase --public -r 0
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    42
  $ hg show stack
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    43
    @  2737 commit 4
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    44
    o  d1a6 commit 3
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    45
    o  128c commit 2
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    46
    o  181c commit 1
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    47
   /   (stack base)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    48
  o  9f17 commit 0
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    49
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    50
  $ hg phase --public -r 1
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    51
  $ hg show stack
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    52
    @  2737 commit 4
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    53
    o  d1a6 commit 3
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    54
    o  128c commit 2
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    55
   /   (stack base)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    56
  o  181c commit 1
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    57
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    58
Draft descendants are shown
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    59
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    60
  $ hg -q up 2
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    61
  $ hg show stack
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    62
    o  2737 commit 4
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    63
    o  d1a6 commit 3
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    64
    @  128c commit 2
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    65
   /   (stack base)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    66
  o  181c commit 1
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    67
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    68
  $ hg -q up 3
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    69
  $ hg show stack
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    70
    o  2737 commit 4
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    71
    @  d1a6 commit 3
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    72
    o  128c commit 2
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    73
   /   (stack base)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    74
  o  181c commit 1
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    75
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    76
working dir on public changeset should display special message
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    77
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    78
  $ hg -q up 1
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    79
  $ hg show stack
33208
9e7efe421395 show: tweak warning message
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33197
diff changeset
    80
  (empty stack; working directory parent is a published changeset)
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    81
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    82
Branch point in descendants displayed at top of graph
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    83
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    84
  $ hg -q up 3
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    85
  $ echo b > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    86
  $ hg commit -m 'commit 5 (new dag branch)'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    87
  created new head
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    88
  $ hg -q up 2
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    89
  $ hg show stack
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    90
   \ /  (multiple children)
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    91
    |
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    92
    o  d1a6 commit 3
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    93
    @  128c commit 2
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    94
   /   (stack base)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
    95
  o  181c commit 1
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    96
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    97
  $ cd ..
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    98
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    99
Base is stopped at merges
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   100
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   101
  $ hg init merge-base
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   102
  $ cd merge-base
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   103
  $ echo 0 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   104
  $ hg -q commit -A -m initial
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   105
  $ echo h1 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   106
  $ hg commit -m 'head 1'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   107
  $ hg -q up 0
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   108
  $ echo h2 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   109
  $ hg -q commit -m 'head 2'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   110
  $ hg phase --public -r 0:tip
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   111
  $ hg -q up 1
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   112
  $ hg merge -t :local 2
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   113
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   114
  (branch merge, don't forget to commit)
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   115
  $ hg commit -m 'merge heads'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   116
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   117
TODO doesn't yet handle case where wdir is a draft merge
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   118
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   119
  $ hg show stack
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   120
    @  8ee9 merge heads
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   121
   /   (stack base)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   122
  o  5947 head 1
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   123
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   124
  $ echo d1 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   125
  $ hg commit -m 'draft 1'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   126
  $ echo d2 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   127
  $ hg commit -m 'draft 2'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   128
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   129
  $ hg show stack
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   130
    @  430d draft 2
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   131
    o  787b draft 1
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   132
   /   (stack base)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   133
  o  8ee9 merge heads
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   134
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   135
  $ cd ..
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   136
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   137
Now move on to stacks when there are more commits after the base branchpoint
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   138
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   139
  $ hg init public-rebase
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   140
  $ cd public-rebase
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   141
  $ echo 0 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   142
  $ hg -q commit -A -m 'base'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   143
  $ hg phase --public -r .
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   144
  $ echo d1 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   145
  $ hg commit -m 'draft 1'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   146
  $ echo d2 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   147
  $ hg commit -m 'draft 2'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   148
  $ hg -q up 0
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   149
  $ echo 1 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   150
  $ hg commit -m 'new 1'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   151
  created new head
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   152
  $ echo 2 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   153
  $ hg commit -m 'new 2'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   154
  $ hg -q up 2
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   155
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   156
Newer draft heads don't impact output
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   157
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   158
  $ hg show stack
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   159
    @  eaff draft 2
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   160
    o  2b21 draft 1
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   161
   /   (stack base)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   162
  o  b66b base
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   163
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   164
Newer public heads are rendered
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   165
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   166
  $ hg phase --public -r '::tip'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   167
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   168
  $ hg show stack
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   169
    o  baa4 new 2
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   170
   /    (2 commits ahead)
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   171
  :
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   172
  :    (stack head)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   173
  : @  eaff draft 2
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   174
  : o  2b21 draft 1
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   175
  :/   (stack base)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   176
  o  b66b base
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   177
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   178
If rebase is available, we show a hint how to rebase to that head
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   179
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   180
  $ hg --config extensions.rebase= show stack
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   181
    o  baa4 new 2
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   182
   /    (2 commits ahead; hg rebase --source 2b21 --dest baa4)
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   183
  :
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   184
  :    (stack head)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   185
  : @  eaff draft 2
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   186
  : o  2b21 draft 1
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   187
  :/   (stack base)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   188
  o  b66b base
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   189
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   190
Similar tests but for multiple heads
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   191
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   192
  $ hg -q up 0
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   193
  $ echo h2 > foo
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   194
  $ hg -q commit -m 'new head 2'
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   195
  $ hg phase --public -r .
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   196
  $ hg -q up 2
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   198
  $ hg show stack
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   199
    o  baa4 new 2
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   200
   /    (2 commits ahead)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   201
  : o  9a84 new head 2
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   202
  :/    (1 commits ahead)
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   203
  :
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   204
  :    (stack head)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   205
  : @  eaff draft 2
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   206
  : o  2b21 draft 1
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   207
  :/   (stack base)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   208
  o  b66b base
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   209
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   210
  $ hg --config extensions.rebase= show stack
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   211
    o  baa4 new 2
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   212
   /    (2 commits ahead; hg rebase --source 2b21 --dest baa4)
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   213
  : o  9a84 new head 2
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   214
  :/    (1 commits ahead; hg rebase --source 2b21 --dest 9a84)
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   215
  :
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   216
  :    (stack head)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   217
  : @  eaff draft 2
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   218
  : o  2b21 draft 1
33197
c5a07a3abe7d show: implement "stack" view
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
   219
  :/   (stack base)
34191
e6b5e7329ff2 show: use consistent (and possibly shorter) node lengths
Gregory Szorc <gregory.szorc@gmail.com>
parents: 33208
diff changeset
   220
  o  b66b base