tests/test-histedit-arguments.t
author Pierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 18 Apr 2013 11:53:58 -0400
changeset 19040 7eb6bfe0b5a2
parent 19039 41669a18a7d6
child 19041 3b52b15e0b3d
permissions -rw-r--r--
histedit-test: test that missing revisions are detected We had not tested for this case.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19035
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     1
Test argument handling and various data parsing
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     2
==================================================
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     3
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     4
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     5
Enable extensions used by this test.
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     6
  $ cat >>$HGRCPATH <<EOF
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     7
  > [extensions]
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     8
  > histedit=
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     9
  > EOF
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    10
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    11
Repo setup.
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    12
  $ hg init foo
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    13
  $ cd foo
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    14
  $ echo alpha >> alpha
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    15
  $ hg addr
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    16
  adding alpha
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    17
  $ hg ci -m one
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    18
  $ echo alpha >> alpha
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    19
  $ hg ci -m two
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    20
  $ echo alpha >> alpha
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    21
  $ hg ci -m three
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    22
  $ echo alpha >> alpha
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    23
  $ hg ci -m four
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    24
  $ echo alpha >> alpha
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    25
  $ hg ci -m five
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    26
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    27
  $ hg log --style compact --graph
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    28
  @  4[tip]   08d98a8350f3   1970-01-01 00:00 +0000   test
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    29
  |    five
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    30
  |
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    31
  o  3   c8e68270e35a   1970-01-01 00:00 +0000   test
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    32
  |    four
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    33
  |
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    34
  o  2   eb57da33312f   1970-01-01 00:00 +0000   test
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    35
  |    three
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    36
  |
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    37
  o  1   579e40513370   1970-01-01 00:00 +0000   test
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    38
  |    two
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    39
  |
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    40
  o  0   6058cbb6cfd7   1970-01-01 00:00 +0000   test
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    41
       one
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    42
  
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    43
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    44
Run a dummy edit to make sure we get tip^^ correctly via revsingle.
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    45
--------------------------------------------------------------------
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    46
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    47
  $ HGEDITOR=cat hg histedit "tip^^"
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    48
  pick eb57da33312f 2 three
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    49
  pick c8e68270e35a 3 four
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    50
  pick 08d98a8350f3 4 five
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    51
  
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    52
  # Edit history between eb57da33312f and 08d98a8350f3
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    53
  #
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    54
  # Commands:
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    55
  #  p, pick = use commit
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    56
  #  e, edit = use commit, but stop for amending
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    57
  #  f, fold = use commit, but fold into previous commit (combines N and N-1)
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    58
  #  d, drop = remove commit from history
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    59
  #  m, mess = edit message without changing commit content
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    60
  #
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    61
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    62
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    63
Run on a revision not ancestors of the current working directory.
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    64
--------------------------------------------------------------------
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    65
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    66
  $ hg up 2
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    67
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    68
  $ hg histedit -r 4
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    69
  abort: 08d98a8350f3 is not an ancestor of working directory
85974024ffa3 histedit-test: rename histedit-revspec into histedit-argument
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    70
  [255]
19039
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    71
  $ hg up --quiet
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    72
19040
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
    73
Test that missing revisions are detected
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
    74
---------------------------------------
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
    75
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
    76
  $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
    77
  > pick eb57da33312f 2 three
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
    78
  > pick 08d98a8350f3 4 five
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
    79
  > EOF
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
    80
  abort: must specify a rule for each changeset once
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
    81
  [255]
7eb6bfe0b5a2 histedit-test: test that missing revisions are detected
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19039
diff changeset
    82
19039
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    83
Test short version of command
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    84
---------------------------------------
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    85
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    86
Note: we use varying amounts of white space between command name and changeset
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    87
short hash. This tests issue3893.
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    88
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    89
  $ HGEDITOR=cat hg histedit "tip^^" --commands - << EOF
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    90
  > pick eb57da33312f 2 three
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    91
  > p    c8e68270e35a 3 four
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    92
  > f 08d98a8350f3 4 five
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    93
  > EOF
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    94
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    95
  reverting alpha
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    96
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    97
  four
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    98
  ***
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
    99
  five
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   100
  
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   101
  
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   102
  
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   103
  HG: Enter commit message.  Lines beginning with 'HG:' are removed.
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   104
  HG: Leave message empty to abort commit.
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   105
  HG: --
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   106
  HG: user: test
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   107
  HG: branch 'default'
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   108
  HG: changed alpha
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   109
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   110
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
41669a18a7d6 histedit: handle multiple spaces between action and hash (issue3893)
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents: 19035
diff changeset
   111
  saved backup bundle to $TESTTMP/foo/.hg/strip-backup/*-backup.hg (glob)