view tests/test-rebase-parameters.t @ 42044:bb271ec2fbfb

compression: introduce a `storage.revlog.zstd.level` configuration This option control the zstd compression level used when compressing revlog chunk. The usage of zstd for revlog compression has not graduated from experimental yet, but we intend to fix that soon. The option name for the compression level is more straight forward to pick, so this changesets comes first. Having a dedicated option for each compression engine is useful because they don't support the same range of values. I ran the same measurement as for the zlib compression level (in the parent changesets). The variation in repository size is stay mostly in the same (small) range. The "read/write" performance see smallish variation, but are overall much better than zlib. Write performance show the same tend of having better write performance for when reaching high-end compression. Again, we don't intend to change the default zstd compression level (currently: 3) in this series. However this is worth investigating in the future. The Performance comparison of zlib vs zstd is quite impressive. The repository size stay in the same range, but the performance are much better in all situations. Comparison summary ================== We are looking at: - performance range for zlib - performance range for zstd - comparison of default zstd (level-3) to default zlib (level 6) - comparison of the slowest zstd time to the fastest zlib time Read performance: ----------------- | zlib | zstd | cmp | f2s mercurial | 0.170159 - 0.189219 | 0.144127 - 0.149624 | 80% | 88% pypy | 2.679217 - 2.768691 | 1.532317 - 1.705044 | 60% | 63% netbeans | 122.477027 - 141.620281 | 72.996346 - 89.731560 | 58% | 73% mozilla | 147.867662 - 170.572118 | 91.700995 - 105.853099 | 56% | 71% Write performance: ------------------ | zlib | zstd | cmp | f2s mercurial | 53.250304 - 56.2936129 | 40.877025 - 45.677286 | 75% | 86% pypy | 460.721984 - 476.589918 | 270.545409 - 301.002219 | 63% | 65% netbeans | 520.560316 - 715.930400 | 370.356311 - 428.329652 | 55% | 82% mozilla | 739.803002 - 987.056093 | 505.152906 - 591.930683 | 57% | 80% Raw data -------- repo alg lvl .hg/store size 00manifest.d read write mercurial zlib 1 49,402,813 5,963,475 0.170159 53.250304 mercurial zlib 6 47,197,397 5,875,730 0.182820 56.264320 mercurial zlib 9 47,121,596 5,849,781 0.189219 56.293612 mercurial zstd 1 49,737,084 5,966,355 0.144127 40.877025 mercurial zstd 3 48,961,867 5,895,208 0.146376 42.268142 mercurial zstd 5 48,200,592 5,938,676 0.149624 43.162875 mercurial zstd 10 47,833,520 5,913,353 0.145185 44.012489 mercurial zstd 15 47,314,604 5,728,679 0.147686 45.677286 mercurial zstd 20 47,330,502 5,830,539 0.145789 45.025407 mercurial zstd 22 47,330,076 5,830,539 0.143996 44.690460 pypy zlib 1 370,830,572 28,462,425 2.679217 460.721984 pypy zlib 6 340,112,317 27,648,747 2.768691 467.537158 pypy zlib 9 338,360,736 27,639,003 2.763495 476.589918 pypy zstd 1 362,377,479 27,916,214 1.532317 270.545409 pypy zstd 3 354,137,693 27,905,988 1.686718 294.951509 pypy zstd 5 342,640,043 27,655,774 1.705044 301.002219 pypy zstd 10 334,224,327 27,164,493 1.567287 285.186239 pypy zstd 15 329,000,363 26,645,965 1.637729 299.561332 pypy zstd 20 324,534,039 26,199,547 1.526813 302.149827 pypy zstd 22 324,530,595 26,198,932 1.525718 307.821218 netbeans zlib 1 1,281,847,810 165,495,457 122.477027 520.560316 netbeans zlib 6 1,205,284,353 159,161,207 139.876147 715.930400 netbeans zlib 9 1,197,135,671 155,034,586 141.620281 678.297064 netbeans zstd 1 1,259,581,737 160,840,613 72.996346 370.356311 netbeans zstd 3 1,232,978,122 157,691,551 81.622317 396.733087 netbeans zstd 5 1,208,034,075 160,246,880 83.080549 364.342626 netbeans zstd 10 1,188,624,176 156,083,417 79.323935 403.594602 netbeans zstd 15 1,176,973,589 153,859,477 89.731560 428.329652 netbeans zstd 20 1,162,958,258 151,147,535 82.842667 392.335349 netbeans zstd 22 1,162,707,029 151,150,220 82.565695 402.840655 mozilla zlib 1 2,775,497,186 298,527,987 147.867662 751.263721 mozilla zlib 6 2,596,856,420 286,597,671 170.572118 987.056093 mozilla zlib 9 2,587,542,494 287,018,264 163.622338 739.803002 mozilla zstd 1 2,723,159,348 286,617,532 91.700995 570.042751 mozilla zstd 3 2,665,055,001 286,152,013 95.240155 561.412805 mozilla zstd 5 2,607,819,817 288,060,030 101.978048 505.152906 mozilla zstd 10 2,558,761,085 283,967,648 104.113481 497.771202 mozilla zstd 15 2,526,216,060 275,581,300 105.853099 591.930683 mozilla zstd 20 2,485,114,806 266,478,859 95.268795 576.515389 mozilla zstd 22 2,484,869,080 266,456,505 94.429282 572.785537
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 27 Mar 2019 18:35:59 +0100
parents 4edd427f34c1
children 8197b395710e
line wrap: on
line source

  $ cat >> $HGRCPATH <<EOF
  > [extensions]
  > rebase=
  > 
  > [phases]
  > publish=False
  > 
  > [alias]
  > tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n"
  > EOF


  $ hg init a
  $ cd a
  $ hg unbundle "$TESTDIR/bundles/rebase.hg"
  adding changesets
  adding manifests
  adding file changes
  added 8 changesets with 7 changes to 7 files (+2 heads)
  new changesets cd010b8cd998:02de42196ebe (8 drafts)
  (run 'hg heads' to see heads, 'hg merge' to merge)
  $ hg up tip
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved

  $ echo I > I
  $ hg ci -AmI
  adding I

  $ hg tglog
  @  8: e7ec4e813ba6 'I'
  |
  o  7: 02de42196ebe 'H'
  |
  | o  6: eea13746799a 'G'
  |/|
  o |  5: 24b6387c8c8c 'F'
  | |
  | o  4: 9520eea781bc 'E'
  |/
  | o  3: 32af7686d403 'D'
  | |
  | o  2: 5fddd98957c8 'C'
  | |
  | o  1: 42ccdea3bb16 'B'
  |/
  o  0: cd010b8cd998 'A'
  
  $ cd ..

Version with only two heads (to allow default destination to work)

  $ hg clone -q -u . a a2heads -r 3 -r 8

These fail:

  $ hg clone -q -u . a a0
  $ cd a0

  $ hg rebase -s 8 -d 7
  nothing to rebase
  [1]

  $ hg rebase --continue --abort
  abort: cannot use --abort with --continue
  [255]

  $ hg rebase --continue --collapse
  abort: cannot use collapse with continue or abort
  [255]

  $ hg rebase --continue --dest 4
  abort: abort and continue do not allow specifying revisions
  [255]

  $ hg rebase --base 5 --source 4
  abort: cannot specify both a source and a base
  [255]

  $ hg rebase --rev 5 --source 4
  abort: cannot specify both a revision and a source
  [255]
  $ hg rebase --base 5 --rev 4
  abort: cannot specify both a revision and a base
  [255]

  $ hg rebase --base 6
  abort: branch 'default' has 3 heads - please rebase to an explicit rev
  (run 'hg heads .' to see heads)
  [255]

  $ hg rebase --rev '1 & !1' --dest 8
  empty "rev" revision set - nothing to rebase
  [1]

  $ hg rebase --source '1 & !1' --dest 8
  empty "source" revision set - nothing to rebase
  [1]

  $ hg rebase --base '1 & !1' --dest 8
  empty "base" revision set - can't compute rebase set
  [1]

  $ hg rebase --dest 8
  nothing to rebase - working directory parent is also destination
  [1]

  $ hg rebase -b . --dest 8
  nothing to rebase - e7ec4e813ba6 is both "base" and destination
  [1]

  $ hg up -q 7

  $ hg rebase --dest 8 --traceback
  nothing to rebase - working directory parent is already an ancestor of destination e7ec4e813ba6
  [1]

  $ hg rebase --dest 8 -b.
  nothing to rebase - "base" 02de42196ebe is already an ancestor of destination e7ec4e813ba6
  [1]

  $ hg rebase --dest '1 & !1'
  abort: empty revision set
  [255]

These work:

Rebase with no arguments (from 3 onto 8):

  $ cd ..
  $ hg clone -q -u . a2heads a1
  $ cd a1
  $ hg up -q -C 3

  $ hg rebase
  rebasing 1:42ccdea3bb16 "B"
  rebasing 2:5fddd98957c8 "C"
  rebasing 3:32af7686d403 "D"
  saved backup bundle to $TESTTMP/a1/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg

  $ hg tglog
  @  6: ed65089c18f8 'D'
  |
  o  5: 7621bf1a2f17 'C'
  |
  o  4: 9430a62369c6 'B'
  |
  o  3: e7ec4e813ba6 'I'
  |
  o  2: 02de42196ebe 'H'
  |
  o  1: 24b6387c8c8c 'F'
  |
  o  0: cd010b8cd998 'A'
  
Try to rollback after a rebase (fail):

  $ hg rollback
  no rollback information available
  [1]

  $ cd ..

Rebase with base == '.' => same as no arguments (from 3 onto 8):

  $ hg clone -q -u 3 a2heads a2
  $ cd a2

  $ hg rebase --base .
  rebasing 1:42ccdea3bb16 "B"
  rebasing 2:5fddd98957c8 "C"
  rebasing 3:32af7686d403 "D"
  saved backup bundle to $TESTTMP/a2/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg

  $ hg tglog
  @  6: ed65089c18f8 'D'
  |
  o  5: 7621bf1a2f17 'C'
  |
  o  4: 9430a62369c6 'B'
  |
  o  3: e7ec4e813ba6 'I'
  |
  o  2: 02de42196ebe 'H'
  |
  o  1: 24b6387c8c8c 'F'
  |
  o  0: cd010b8cd998 'A'
  
  $ cd ..


Rebase with dest == branch(.) => same as no arguments (from 3 onto 8):

  $ hg clone -q -u 3 a a3
  $ cd a3

  $ hg rebase --dest 'branch(.)'
  rebasing 1:42ccdea3bb16 "B"
  rebasing 2:5fddd98957c8 "C"
  rebasing 3:32af7686d403 "D"
  saved backup bundle to $TESTTMP/a3/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg

  $ hg tglog
  @  8: ed65089c18f8 'D'
  |
  o  7: 7621bf1a2f17 'C'
  |
  o  6: 9430a62369c6 'B'
  |
  o  5: e7ec4e813ba6 'I'
  |
  o  4: 02de42196ebe 'H'
  |
  | o  3: eea13746799a 'G'
  |/|
  o |  2: 24b6387c8c8c 'F'
  | |
  | o  1: 9520eea781bc 'E'
  |/
  o  0: cd010b8cd998 'A'
  
  $ cd ..


Specify only source (from 2 onto 8):

  $ hg clone -q -u . a2heads a4
  $ cd a4

  $ hg rebase --source 'desc("C")'
  rebasing 2:5fddd98957c8 "C"
  rebasing 3:32af7686d403 "D"
  saved backup bundle to $TESTTMP/a4/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg

  $ hg tglog
  o  6: 7726e9fd58f7 'D'
  |
  o  5: 72c8333623d0 'C'
  |
  @  4: e7ec4e813ba6 'I'
  |
  o  3: 02de42196ebe 'H'
  |
  o  2: 24b6387c8c8c 'F'
  |
  | o  1: 42ccdea3bb16 'B'
  |/
  o  0: cd010b8cd998 'A'
  
  $ cd ..


Specify only dest (from 3 onto 6):

  $ hg clone -q -u 3 a a5
  $ cd a5

  $ hg rebase --dest 6
  rebasing 1:42ccdea3bb16 "B"
  rebasing 2:5fddd98957c8 "C"
  rebasing 3:32af7686d403 "D"
  saved backup bundle to $TESTTMP/a5/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg

  $ hg tglog
  @  8: 8eeb3c33ad33 'D'
  |
  o  7: 2327fea05063 'C'
  |
  o  6: e4e5be0395b2 'B'
  |
  | o  5: e7ec4e813ba6 'I'
  | |
  | o  4: 02de42196ebe 'H'
  | |
  o |  3: eea13746799a 'G'
  |\|
  | o  2: 24b6387c8c8c 'F'
  | |
  o |  1: 9520eea781bc 'E'
  |/
  o  0: cd010b8cd998 'A'
  
  $ cd ..


Specify only base (from 1 onto 8):

  $ hg clone -q -u . a2heads a6
  $ cd a6

  $ hg rebase --base 'desc("D")'
  rebasing 1:42ccdea3bb16 "B"
  rebasing 2:5fddd98957c8 "C"
  rebasing 3:32af7686d403 "D"
  saved backup bundle to $TESTTMP/a6/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg

  $ hg tglog
  o  6: ed65089c18f8 'D'
  |
  o  5: 7621bf1a2f17 'C'
  |
  o  4: 9430a62369c6 'B'
  |
  @  3: e7ec4e813ba6 'I'
  |
  o  2: 02de42196ebe 'H'
  |
  o  1: 24b6387c8c8c 'F'
  |
  o  0: cd010b8cd998 'A'
  
  $ cd ..


Specify source and dest (from 2 onto 7):

  $ hg clone -q -u . a a7
  $ cd a7

  $ hg rebase --source 2 --dest 7
  rebasing 2:5fddd98957c8 "C"
  rebasing 3:32af7686d403 "D"
  saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg

  $ hg tglog
  o  8: 668acadedd30 'D'
  |
  o  7: 09eb682ba906 'C'
  |
  | @  6: e7ec4e813ba6 'I'
  |/
  o  5: 02de42196ebe 'H'
  |
  | o  4: eea13746799a 'G'
  |/|
  o |  3: 24b6387c8c8c 'F'
  | |
  | o  2: 9520eea781bc 'E'
  |/
  | o  1: 42ccdea3bb16 'B'
  |/
  o  0: cd010b8cd998 'A'
  
  $ cd ..


Specify base and dest (from 1 onto 7):

  $ hg clone -q -u . a a8
  $ cd a8

  $ hg rebase --base 3 --dest 7
  rebasing 1:42ccdea3bb16 "B"
  rebasing 2:5fddd98957c8 "C"
  rebasing 3:32af7686d403 "D"
  saved backup bundle to $TESTTMP/a8/.hg/strip-backup/42ccdea3bb16-3cb021d3-rebase.hg

  $ hg tglog
  o  8: 287cc92ba5a4 'D'
  |
  o  7: 6824f610a250 'C'
  |
  o  6: 7c6027df6a99 'B'
  |
  | @  5: e7ec4e813ba6 'I'
  |/
  o  4: 02de42196ebe 'H'
  |
  | o  3: eea13746799a 'G'
  |/|
  o |  2: 24b6387c8c8c 'F'
  | |
  | o  1: 9520eea781bc 'E'
  |/
  o  0: cd010b8cd998 'A'
  
  $ cd ..


Specify only revs (from 2 onto 8)

  $ hg clone -q -u . a2heads a9
  $ cd a9

  $ hg rebase --rev 'desc("C")::'
  rebasing 2:5fddd98957c8 "C"
  rebasing 3:32af7686d403 "D"
  saved backup bundle to $TESTTMP/a9/.hg/strip-backup/5fddd98957c8-f9244fa1-rebase.hg

  $ hg tglog
  o  6: 7726e9fd58f7 'D'
  |
  o  5: 72c8333623d0 'C'
  |
  @  4: e7ec4e813ba6 'I'
  |
  o  3: 02de42196ebe 'H'
  |
  o  2: 24b6387c8c8c 'F'
  |
  | o  1: 42ccdea3bb16 'B'
  |/
  o  0: cd010b8cd998 'A'
  
  $ cd ..

Rebasing both a single revision and a merge in one command

  $ hg clone -q -u . a aX
  $ cd aX
  $ hg rebase -r 3 -r 6 --dest 8
  rebasing 3:32af7686d403 "D"
  rebasing 6:eea13746799a "G"
  saved backup bundle to $TESTTMP/aX/.hg/strip-backup/eea13746799a-ad273fd6-rebase.hg
  $ cd ..

Test --tool parameter:

  $ hg init b
  $ cd b

  $ echo c1 > c1
  $ hg ci -Am c1
  adding c1

  $ echo c2 > c2
  $ hg ci -Am c2
  adding c2

  $ hg up -q 0
  $ echo c2b > c2
  $ hg ci -Am c2b
  adding c2
  created new head

  $ cd ..

  $ hg clone -q -u . b b1
  $ cd b1

  $ hg rebase -s 2 -d 1 --tool internal:local
  rebasing 2:e4e3f3546619 "c2b" (tip)
  note: not rebasing 2:e4e3f3546619 "c2b" (tip), its destination already has all its changes
  saved backup bundle to $TESTTMP/b1/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg

  $ hg cat c2
  c2

  $ cd ..


  $ hg clone -q -u . b b2
  $ cd b2

  $ hg rebase -s 2 -d 1 --tool internal:other
  rebasing 2:e4e3f3546619 "c2b" (tip)
  saved backup bundle to $TESTTMP/b2/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg

  $ hg cat c2
  c2b

  $ cd ..


  $ hg clone -q -u . b b3
  $ cd b3

  $ hg rebase -s 2 -d 1 --tool internal:fail
  rebasing 2:e4e3f3546619 "c2b" (tip)
  unresolved conflicts (see hg resolve, then hg rebase --continue)
  [1]

  $ hg summary
  parent: 1:56daeba07f4b 
   c2
  parent: 2:e4e3f3546619 tip
   c2b
  branch: default
  commit: 1 modified, 1 unresolved (merge)
  update: (current)
  phases: 3 draft
  rebase: 0 rebased, 1 remaining (rebase --continue)

  $ hg resolve -l
  U c2

  $ hg resolve -m c2
  (no more unresolved files)
  continue: hg rebase --continue
  $ hg graft --continue
  abort: no graft in progress
  (continue: hg rebase --continue)
  [255]
  $ hg rebase -c --tool internal:fail
  rebasing 2:e4e3f3546619 "c2b" (tip)
  note: not rebasing 2:e4e3f3546619 "c2b" (tip), its destination already has all its changes
  saved backup bundle to $TESTTMP/b3/.hg/strip-backup/e4e3f3546619-b0841178-rebase.hg

  $ hg rebase -i
  abort: interactive history editing is supported by the 'histedit' extension (see "hg --config extensions.histedit= help -e histedit")
  [255]

  $ hg rebase --interactive
  abort: interactive history editing is supported by the 'histedit' extension (see "hg --config extensions.histedit= help -e histedit")
  [255]

  $ cd ..

No common ancestor

  $ hg init separaterepo
  $ cd separaterepo
  $ touch a
  $ hg commit -Aqm a
  $ hg up -q null
  $ touch b
  $ hg commit -Aqm b
  $ hg rebase -d 0
  nothing to rebase from d7486e00c6f1 to 3903775176ed
  [1]
  $ cd ..