tests/test-rebase-dest.t
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Mon, 10 Apr 2017 16:51:06 +0200
changeset 31966 8b98acaefc55
parent 31733 ae6bab095c66
child 33332 3b7cb3d17137
permissions -rw-r--r--
obsolescence: add test case C-2 for obsolescence markers exchange About 3 years ago, in August 2014, the logic to select what markers to select on push was ported from the evolve extension to Mercurial core. However, for some unclear reasons, the tests for that logic were not ported alongside. I realised it a couple of weeks ago while working on another push related issue. I've made a clean up pass on the tests and they are now ready to integrate the core test suite. This series of changesets do not change any logic. I just adds test for logic that has been around for about 10 versions of Mercurial. They are a patch for each test case. It makes it easier to review and postpone one with documentation issues without rejecting the wholes series. This patch introduce C-2: Pruned changeset on precursors Each test case comes it in own test file. It help parallelism and does not introduce a significant overhead from having a single unified giant test file. Here are timing to support this claim. # Multiple test files version: # run-tests.py --local -j 1 test-exchange-*.t 53.40s user 6.82s system 85% cpu 1:10.76 total 52.79s user 6.97s system 85% cpu 1:09.97 total 52.94s user 6.82s system 85% cpu 1:09.69 total # Single test file version: # run-tests.py --local -j 1 test-exchange-obsmarkers.t 52.97s user 6.85s system 85% cpu 1:10.10 total 52.64s user 6.79s system 85% cpu 1:09.63 total 53.70s user 7.00s system 85% cpu 1:11.17 total
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31729
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     1
Require a destination
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     2
  $ cat >> $HGRCPATH <<EOF
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     3
  > [extensions]
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     4
  > rebase =
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     5
  > [commands]
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     6
  > rebase.requiredest = True
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     7
  > EOF
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     8
  $ hg init repo
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
     9
  $ cd repo
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    10
  $ echo a >> a
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    11
  $ hg commit -qAm aa
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    12
  $ echo b >> b
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    13
  $ hg commit -qAm bb
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    14
  $ hg up ".^"
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    15
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    16
  $ echo c >> c
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    17
  $ hg commit -qAm cc
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    18
  $ hg rebase
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    19
  abort: you must specify a destination
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    20
  (use: hg rebase -d REV)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    21
  [255]
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    22
  $ hg rebase -d 1
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    23
  rebasing 2:5db65b93a12b "cc" (tip)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    24
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/5db65b93a12b-4fb789ec-backup.hg (glob)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    25
  $ hg rebase -d 0 -r . -q
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    26
  $ HGPLAIN=1 hg rebase
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    27
  rebasing 2:889b0bc6a730 "cc" (tip)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    28
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/889b0bc6a730-41ec4f81-backup.hg (glob)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    29
  $ hg rebase -d 0 -r . -q
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    30
  $ hg --config commands.rebase.requiredest=False rebase
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    31
  rebasing 2:279de9495438 "cc" (tip)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    32
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/279de9495438-ab0a5128-backup.hg (glob)
c069c4e271e3 rebase: move destination test to new test file
Ryan McElroy <rmcelroy@fb.com>
parents:
diff changeset
    33
31730
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    34
Requiring dest should not break continue or other rebase options
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    35
  $ hg up 1 -q
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    36
  $ echo d >> c
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    37
  $ hg commit -qAm dc
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    38
  $ hg log -G -T '{rev} {desc}'
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    39
  @  3 dc
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    40
  |
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    41
  | o  2 cc
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    42
  |/
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    43
  o  1 bb
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    44
  |
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    45
  o  0 aa
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    46
  
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    47
  $ hg rebase -d 2
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    48
  rebasing 3:0537f6b50def "dc" (tip)
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    49
  merging c
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    50
  warning: conflicts while merging c! (edit, then use 'hg resolve --mark')
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    51
  unresolved conflicts (see hg resolve, then hg rebase --continue)
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    52
  [1]
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    53
  $ echo d > c
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    54
  $ hg resolve --mark --all
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    55
  (no more unresolved files)
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    56
  continue: hg rebase --continue
6931c3346551 rebase: test to show brokenness with requiredest
Ryan McElroy <rmcelroy@fb.com>
parents: 31729
diff changeset
    57
  $ hg rebase --continue
31731
b5afec71c1f9 rebase: allow destination-free continue and abort (issue5513)
Ryan McElroy <rmcelroy@fb.com>
parents: 31730
diff changeset
    58
  rebasing 3:0537f6b50def "dc" (tip)
b5afec71c1f9 rebase: allow destination-free continue and abort (issue5513)
Ryan McElroy <rmcelroy@fb.com>
parents: 31730
diff changeset
    59
  saved backup bundle to $TESTTMP/repo/.hg/strip-backup/0537f6b50def-be4c7386-backup.hg (glob)
31732
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    60
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    61
  $ cd ..
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    62
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    63
Check rebase.requiredest interaction with pull --rebase
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    64
  $ hg clone repo clone
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    65
  updating to branch default
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    66
  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    67
  $ cd repo
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    68
  $ echo e > e
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    69
  $ hg commit -qAm ee
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    70
  $ cd ..
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    71
  $ cd clone
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    72
  $ echo f > f
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    73
  $ hg commit -qAm ff
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    74
  $ hg pull --rebase
31733
ae6bab095c66 rebase: abort hg pull --rebase if rebase.requiredest is set (issue5514)
Ryan McElroy <rmcelroy@fb.com>
parents: 31732
diff changeset
    75
  abort: rebase destination required by configuration
ae6bab095c66 rebase: abort hg pull --rebase if rebase.requiredest is set (issue5514)
Ryan McElroy <rmcelroy@fb.com>
parents: 31732
diff changeset
    76
  (use hg pull followed by hg rebase -d DEST)
31732
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    77
  [255]
9ddf875183b0 rebase: demonstrate behavior with requiredest and pull --rebase
Ryan McElroy <rmcelroy@fb.com>
parents: 31731
diff changeset
    78