tests/test-import-merge.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 02 Oct 2019 17:53:47 -0400
changeset 43257 675c776fbcd1
parent 39506 f1186c292d03
child 49920 2f2682f40ea0
permissions -rw-r--r--
sidedatacopies: directly fetch copies information from sidedata When using the sidedata mode, we don't need a complicated and expensive `context` object. Instead we directly fetch copies information from the sidedata (through a changelogrevision object). More optimisations coming. revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29 filelog: ! wall 3.679613 comb 3.680000 user 3.580000 sys 0.100000 (median of 3) base: ! wall 8.884369 comb 8.880000 user 8.850000 sys 0.030000 (median of 3) before: ! wall 4.681985 comb 4.680000 user 4.640000 sys 0.040000 (median of 3) after: ! wall 3.955894 comb 3.950000 user 3.940000 sys 0.010000 (median of 3) revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2 filelog: ! wall 0.003357 comb 0.010000 user 0.010000 sys 0.000000 (median of 781) base: ! wall 12.398524 comb 12.400000 user 12.330000 sys 0.070000 (median of 3) before: ! wall 6.459592 comb 6.470000 user 6.390000 sys 0.080000 (median of 3) after: ! wall 5.505774 comb 5.500000 user 5.410000 sys 0.090000 (median of 3) revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0 filelog: ! wall 2.754687 comb 2.760000 user 2.650000 sys 0.110000 (median of 4) base: ! wall 1.423166 comb 1.420000 user 1.400000 sys 0.020000 (median of 8) before: ! wall 0.961048 comb 0.960000 user 0.940000 sys 0.020000 (median of 11) after: ! wall 0.882950 comb 0.880000 user 0.880000 sys 0.000000 (median of 11) revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f filelog: ! wall 1.552293 comb 1.550000 user 1.510000 sys 0.040000 (median of 6 base: ! wall 0.022662 comb 0.020000 user 0.020000 sys 0.000000 (median of 128) before: ! wall 0.021649 comb 0.020000 user 0.020000 sys 0.000000 (median of 135) after: ! wall 0.020951 comb 0.020000 user 0.020000 sys 0.000000 (median of 141) revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63 filelog: ! wall 1.500983 comb 1.500000 user 1.420000 sys 0.080000 (median of 7) base: ! wall 0.006956 comb 0.010000 user 0.010000 sys 0.000000 (median of 392) before: ! wall 0.004022 comb 0.000000 user 0.000000 sys 0.000000 (median of 735) after: ! wall 0.003988 comb 0.000000 user 0.000000 sys 0.000000 (median of 736) revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e filelog: ! wall 0.011745 comb 0.020000 user 0.020000 sys 0.000000 (median of 250) base: ! wall 0.000156 comb 0.000000 user 0.000000 sys 0.000000 (median of 17180) before: ! wall 0.000118 comb 0.000000 user 0.000000 sys 0.000000 (median of 19170) after: ! wall 0.000097 comb 0.000000 user 0.000000 sys 0.000000 (median of 27276) revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe filelog: ! wall 3.228230 comb 3.230000 user 3.110000 sys 0.120000 (median of 4) base: ! wall 0.997640 comb 1.000000 user 0.980000 sys 0.020000 (median of 10) before: ! wall 0.679500 comb 0.680000 user 0.680000 sys 0.000000 (median of 15) after: ! wall 0.596779 comb 0.600000 user 0.600000 sys 0.000000 (median of 17) revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d filelog: ! wall 1.052501 comb 1.060000 user 1.040000 sys 0.020000 (median of 10 base: ! wall 0.214519 comb 0.220000 user 0.220000 sys 0.000000 (median of 45) before: ! wall 0.149675 comb 0.150000 user 0.150000 sys 0.000000 (median of 66) after: ! wall 0.130786 comb 0.130000 user 0.130000 sys 0.000000 (median of 75) Differential Revision: https://phab.mercurial-scm.org/D7072
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15511
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     1
  $ echo "[extensions]" >> $HGRCPATH
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     2
  $ echo "mq=" >> $HGRCPATH
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     3
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     4
  $ tipparents() {
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     5
  > hg parents --template "{rev}:{node|short} {desc|firstline}\n" -r tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     6
  > }
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     7
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     8
Test import and merge diffs
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     9
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    10
  $ hg init repo
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    11
  $ cd repo
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    12
  $ echo a > a
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    13
  $ hg ci -Am adda
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    14
  adding a
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    15
  $ echo a >> a
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    16
  $ hg ci -m changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    17
  $ echo c > c
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    18
  $ hg ci -Am addc
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    19
  adding c
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    20
  $ hg up 0
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    21
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    22
  $ echo b > b
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    23
  $ hg ci -Am addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    24
  adding b
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    25
  created new head
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    26
  $ hg up 1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    27
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    28
  $ hg merge 3
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    29
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    30
  (branch merge, don't forget to commit)
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    31
  $ hg ci -m merge
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    32
  $ hg export . > ../merge.diff
22250
f3200bf460a8 import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
    33
  $ grep -v '^merge$' ../merge.diff > ../merge.nomsg.diff
15511
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    34
  $ cd ..
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    35
  $ hg clone -r2 repo repo2
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    36
  adding changesets
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    37
  adding manifests
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    38
  adding file changes
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    39
  added 3 changesets with 3 changes to 2 files
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 22305
diff changeset
    40
  new changesets 07f494440405:890ecaa90481
15511
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    41
  updating to branch default
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    42
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    43
  $ cd repo2
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    44
  $ hg pull -r3 ../repo
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    45
  pulling from ../repo
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    46
  searching for changes
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    47
  adding changesets
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    48
  adding manifests
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    49
  adding file changes
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    50
  added 1 changesets with 1 changes to 1 files (+1 heads)
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 22305
diff changeset
    51
  new changesets 102a90ea7b4a
15511
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    52
  (run 'hg heads' to see heads, 'hg merge' to merge)
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    53
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    54
Test without --exact and diff.p1 == workingdir.p1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    55
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    56
  $ hg up 1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    57
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
22250
f3200bf460a8 import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
    58
  $ cat > $TESTTMP/editor.sh <<EOF
f3200bf460a8 import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
    59
  > env | grep HGEDITFORM
f3200bf460a8 import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
    60
  > echo merge > \$1
f3200bf460a8 import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
    61
  > EOF
f3200bf460a8 import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
    62
  $ HGEDITOR="sh $TESTTMP/editor.sh" hg import --edit ../merge.nomsg.diff
f3200bf460a8 import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
    63
  applying ../merge.nomsg.diff
f3200bf460a8 import: change "editform" to distinguish merge commits from others
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
    64
  HGEDITFORM=import.normal.merge
15511
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    65
  $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    66
  1:540395c44225 changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    67
  3:102a90ea7b4a addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    68
  $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    69
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    70
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    71
Test without --exact and diff.p1 != workingdir.p1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    72
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    73
  $ hg up 2
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    74
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    75
  $ hg import ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    76
  applying ../merge.diff
22303
0c838e7459a5 import: show the warning message for failure of merging
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
    77
  warning: import the patch as a normal revision
0c838e7459a5 import: show the warning message for failure of merging
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
    78
  (use --exact to import the patch as a merge)
15511
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    79
  $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    80
  2:890ecaa90481 addc
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    81
  $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    82
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    83
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    84
Test with --exact
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    85
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    86
  $ hg import --exact ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    87
  applying ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    88
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    89
  $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    90
  1:540395c44225 changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    91
  3:102a90ea7b4a addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    92
  $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    93
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    94
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    95
Test with --bypass and diff.p1 == workingdir.p1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    96
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    97
  $ hg up 1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    98
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    99
  $ hg import --bypass ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   100
  applying ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   101
  $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   102
  1:540395c44225 changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   103
  3:102a90ea7b4a addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   104
  $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   105
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   106
Test with --bypass and diff.p1 != workingdir.p1
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   107
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   108
  $ hg up 2
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   109
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   110
  $ hg import --bypass ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   111
  applying ../merge.diff
22303
0c838e7459a5 import: show the warning message for failure of merging
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
   112
  warning: import the patch as a normal revision
0c838e7459a5 import: show the warning message for failure of merging
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents: 20303
diff changeset
   113
  (use --exact to import the patch as a merge)
15511
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   114
  $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   115
  2:890ecaa90481 addc
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   116
  $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   117
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   118
Test with --bypass and --exact
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   119
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   120
  $ hg import --bypass --exact ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   121
  applying ../merge.diff
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   122
  $ tipparents
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   123
  1:540395c44225 changea
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   124
  3:102a90ea7b4a addb
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   125
  $ hg strip --no-backup tip
6cae68a361ed import: fix parent selection when importing merges
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
   126
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15511
diff changeset
   127
  $ cd ..
18656
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   128
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   129
Test that --exact on a bad header doesn't corrupt the repo (issue3616)
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   130
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   131
  $ hg init repo3
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   132
  $ cd repo3
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   133
  $ echo a>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   134
  $ hg ci -Aqm0
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   135
  $ echo a>>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   136
  $ hg ci -m1
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   137
  $ echo a>>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   138
  $ hg ci -m2
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   139
  $ echo a>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   140
  $ echo b>>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   141
  $ echo a>>a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   142
  $ hg ci -m3
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   143
  $ hg export 2 | head -7 > ../a.patch
19628
3193b23eec61 solaris: tests can't use tail -n
Danek Duvall <danek.duvall@oracle.com>
parents: 18656
diff changeset
   144
  $ hg export tip > out
20303
3a3731a60354 test-import-merge: mangle file in binary mode
Matt Mackall <mpm@selenic.com>
parents: 19628
diff changeset
   145
  >>> apatch = open("../a.patch", "ab")
38119
b95a6fb7ae66 py3: fix .write() calls in few tests
Pulkit Goyal <7895pulkit@gmail.com>
parents: 34661
diff changeset
   146
  >>> apatch.write(b"".join(open("out", 'rb').readlines()[7:])) and None
18656
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   147
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   148
  $ cd ..
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   149
  $ hg clone -qr0 repo3 repo3-clone
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   150
  $ cd repo3-clone
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   151
  $ hg pull -qr1 ../repo3
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   152
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   153
  $ hg import --exact ../a.patch
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   154
  applying ../a.patch
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   155
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   156
  patching file a
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   157
  Hunk #1 succeeded at 1 with fuzz 1 (offset -1 lines).
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   158
  transaction abort!
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   159
  rollback completed
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   160
  abort: patch is damaged or loses information
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   161
  [255]
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   162
  $ hg verify
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   163
  checking changesets
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   164
  checking manifests
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   165
  crosschecking files in changesets and manifests
8eb3408bf005 import: don't rollback on failed import --exact (issue3616)
Kevin Bullock <kbullock@ringworld.org>
parents: 16913
diff changeset
   166
  checking files
39506
f1186c292d03 verify: make output less confusing (issue5924)
Meirambek Omyrzak <meirambek77@gmail.com>
parents: 38119
diff changeset
   167
  checked 2 changesets with 2 changes to 1 files