tests/test-histedit-drop.t
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Wed, 24 Feb 2016 06:10:46 +0900
changeset 28265 332926212ef8
parent 28004 34165875fa5d
child 28519 518a5030acba
permissions -rw-r--r--
repoview: discard filtered changelog if index isn't shared with unfiltered Before this patch, revisions rollbacked at failure of previous transaction might be visible at subsequent operations unintentionally, if repoview object is reused even after failure of transaction: e.g. command server and HTTP server are typical cases. 'repoview' uses the tuple of values below of unfiltered changelog as "the key" to examine validity of filtered changelog cache. - length - tip node - filtered revisions (as hashed value) - '_delayed' field 'repoview' compares between "the key" of unfiltered changelog at previous caching and now, and reuses filtered changelog cache if no change is detected. But this comparison indicates only that there is no change between unfiltered 'repo.changelog' at last caching and now, but not that filtered changelog cache is valid for current unfiltered one. 'repoview' uses "shallow copy" of unfiltered changelog to create filtered changelog cache. In this case, 'index' buffer of unfiltered changelog is also referred by filtered changelog. At failure of transaction, unfiltered changelog itself is invalidated (= un-referred) on the 'repo' side (see 0a7610758c42 also). But 'index' of it still contains revisions to be rollbacked at this failure, and is referred by filtered changelog. Therefore, even if there is no change between unfiltered 'repo.changelog' at last caching and now, steps below makes rollbacked revisions visible via filtered changelog unintentionally. 1. instantiate unfiltered changelog as 'repo.changelog' (call it CL1) 2. make filtered (= shallow copy of) CL1 (call it FCL1) 3. cache FCL1 with "the key" of CL1 4. revisions are appended to 'index', which is shared by CL1 and FCL1 5. invalidate 'repo.changelog' (= CL1) at failure of transaction 6. instantiate 'repo.changelog' again at next operation (call it CL2) CL2 doesn't have revisions added at (4), because it is instantiated from '00changelog.i', which isn't changed while failed transaction. 7. compare between "the key" of CL1 and CL2 8. FCL1 cached at (3) is reused, because comparison at (7) doesn't detect change between CL1 at (1) and CL2 9. revisions rollbacked at (5) are visible via FCL1 unintentionally, because FCL1 still refers 'index' changed at (4) The root cause of this issue is that there is no examination about validity of filtered changelog cache against current unfiltered one. This patch discards filtered changelog cache, if its 'index' object isn't shared with unfiltered one. BTW, at the time of this patch, redundant truncation of '00changelog.i' at failure of transaction (see 0a7610758c42 for detail) often prevents "hg serve" from making already rollbacked revisions visible, because updating timestamps of '00changelog.i' by truncation makes "hg serve" discard old repoview object with invalid filtered changelog cache. This is reason why this issue is overlooked before this patch, even though test-bundle2-exchange.t has tests in similar situation: failure of "hg push" via HTTP by pretxnclose hook on server side doesn't prevent subsequent commands from looking up outgoing revisions correctly. But timestamp on the filesystem doesn't have enough resolution for recent computation power, and it can't be assumed that this avoidance always works as expected. Therefore, without this patch, this issue might appear occasionally.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
     1
  $ . "$TESTDIR/histedit-helpers.sh"
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
     2
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
     3
  $ cat >> $HGRCPATH <<EOF
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
     4
  > [extensions]
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
     5
  > histedit=
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
     6
  > EOF
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
     7
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
     8
  $ initrepo ()
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
     9
  > {
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    10
  >     hg init r
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    11
  >     cd r
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    12
  >     for x in a b c d e f ; do
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    13
  >         echo $x > $x
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    14
  >         hg add $x
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    15
  >         hg ci -m $x
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    16
  >     done
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    17
  > }
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    18
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    19
  $ initrepo
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
    20
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    21
log before edit
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    22
  $ hg log --graph
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    23
  @  changeset:   5:652413bf663e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    24
  |  tag:         tip
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    25
  |  user:        test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    26
  |  date:        Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    27
  |  summary:     f
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    28
  |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    29
  o  changeset:   4:e860deea161a
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    30
  |  user:        test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    31
  |  date:        Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    32
  |  summary:     e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    33
  |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    34
  o  changeset:   3:055a42cdd887
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    35
  |  user:        test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    36
  |  date:        Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    37
  |  summary:     d
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    38
  |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    39
  o  changeset:   2:177f92b77385
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    40
  |  user:        test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    41
  |  date:        Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    42
  |  summary:     c
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    43
  |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    44
  o  changeset:   1:d2ae7f538514
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    45
  |  user:        test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    46
  |  date:        Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    47
  |  summary:     b
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    48
  |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    49
  o  changeset:   0:cb9a9f314b8b
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    50
     user:        test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    51
     date:        Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    52
     summary:     a
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    53
  
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
    54
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    55
edit the history
19019
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18509
diff changeset
    56
  $ hg histedit 177f92b77385 --commands - 2>&1 << EOF | fixbundle
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18509
diff changeset
    57
  > drop 177f92b77385 c
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18509
diff changeset
    58
  > pick e860deea161a e
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18509
diff changeset
    59
  > pick 652413bf663e f
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18509
diff changeset
    60
  > pick 055a42cdd887 d
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18509
diff changeset
    61
  > EOF
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
    62
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    63
log after edit
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    64
  $ hg log --graph
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
    65
  @  changeset:   4:f518305ce889
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    66
  |  tag:         tip
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    67
  |  user:        test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    68
  |  date:        Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    69
  |  summary:     d
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    70
  |
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
    71
  o  changeset:   3:a4f7421b80f7
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    72
  |  user:        test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    73
  |  date:        Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    74
  |  summary:     f
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    75
  |
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
    76
  o  changeset:   2:ee283cb5f2d5
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    77
  |  user:        test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    78
  |  date:        Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    79
  |  summary:     e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    80
  |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    81
  o  changeset:   1:d2ae7f538514
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    82
  |  user:        test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    83
  |  date:        Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    84
  |  summary:     b
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    85
  |
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    86
  o  changeset:   0:cb9a9f314b8b
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    87
     user:        test
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    88
     date:        Thu Jan 01 00:00:00 1970 +0000
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    89
     summary:     a
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
    90
  
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
    91
18437
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
    92
Check histedit_source
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
    93
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
    94
  $ hg log --debug --rev f518305ce889
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
    95
  changeset:   4:f518305ce889c07cb5bd05522176d75590ef3324
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
    96
  tag:         tip
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
    97
  phase:       draft
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
    98
  parent:      3:a4f7421b80f79fcc59fff01bcbf4a53d127dd6d3
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
    99
  parent:      -1:0000000000000000000000000000000000000000
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
   100
  manifest:    4:d3d4f51c157ff242c32ff745d4799aaa26ccda44
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
   101
  user:        test
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
   102
  date:        Thu Jan 01 00:00:00 1970 +0000
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
   103
  files+:      d
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
   104
  extra:       branch=default
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
   105
  extra:       histedit_source=055a42cdd88768532f9cf79daa407fc8d138de9b
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
   106
  description:
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
   107
  d
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
   108
  
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
   109
  
358c23e8f1c6 histedit: record histedit source (issue3681)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 17087
diff changeset
   110
17085
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
   111
manifest after edit
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
   112
  $ hg manifest
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
   113
  a
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
   114
  b
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
   115
  d
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
   116
  e
35729bdd59b6 tests: convert histedit tests to .t
Mads Kiilerich <mads@kiilerich.com>
parents: 17064
diff changeset
   117
  f
17064
168cc52ad7c2 histedit: new extension for interactive history editing
Augie Fackler <raf@durin42.com>
parents:
diff changeset
   118
18509
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   119
Drop the last changeset
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   120
19019
53060cc1b601 histedit-test: generalise --commands "-" usage
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18509
diff changeset
   121
  $ hg histedit ee283cb5f2d5 --commands - 2>&1 << EOF | fixbundle
18509
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   122
  > pick ee283cb5f2d5 e
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   123
  > pick a4f7421b80f7 f
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   124
  > drop f518305ce889 d
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   125
  > EOF
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   126
  $ hg log --graph
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   127
  @  changeset:   3:a4f7421b80f7
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   128
  |  tag:         tip
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   129
  |  user:        test
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   130
  |  date:        Thu Jan 01 00:00:00 1970 +0000
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   131
  |  summary:     f
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   132
  |
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   133
  o  changeset:   2:ee283cb5f2d5
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   134
  |  user:        test
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   135
  |  date:        Thu Jan 01 00:00:00 1970 +0000
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   136
  |  summary:     e
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   137
  |
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   138
  o  changeset:   1:d2ae7f538514
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   139
  |  user:        test
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   140
  |  date:        Thu Jan 01 00:00:00 1970 +0000
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   141
  |  summary:     b
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   142
  |
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   143
  o  changeset:   0:cb9a9f314b8b
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   144
     user:        test
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   145
     date:        Thu Jan 01 00:00:00 1970 +0000
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   146
     summary:     a
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   147
  
21daee53c101 test-histedit: add tests for dropping head changeset
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 18437
diff changeset
   148
27414
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   149
  $ hg histedit cb9a9f314b8b --commands - 2>&1 << EOF | fixbundle
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   150
  > pick cb9a9f314b8b a
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   151
  > pick ee283cb5f2d5 e
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   152
  > EOF
27545
a67d2e059a51 histedit: use parse-error exception for parsing
timeless <timeless@mozdev.org>
parents: 27414
diff changeset
   153
  hg: parse error: missing rules for changeset a4f7421b80f7
27414
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   154
  (use "drop a4f7421b80f7" to discard, see also: "hg help -e histedit.config")
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   155
  $ hg --config histedit.dropmissing=True histedit  cb9a9f314b8b --commands - 2>&1 << EOF | fixbundle
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   156
  > pick cb9a9f314b8b a
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   157
  > pick ee283cb5f2d5 e
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   158
  > EOF
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   159
  $ hg log --graph
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   160
  @  changeset:   1:e99c679bf03e
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   161
  |  tag:         tip
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   162
  |  user:        test
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   163
  |  date:        Thu Jan 01 00:00:00 1970 +0000
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   164
  |  summary:     e
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   165
  |
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   166
  o  changeset:   0:cb9a9f314b8b
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   167
     user:        test
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   168
     date:        Thu Jan 01 00:00:00 1970 +0000
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   169
     summary:     a
6602a7b9deec histedit: delete to drop
Mateusz Kwapich <mitrandir@fb.com>
parents: 27406
diff changeset
   170