tests/test-commit-interactive-curses.t
author Gregory Szorc <gregory.szorc@gmail.com>
Thu, 13 Oct 2016 12:50:27 +0200
changeset 30155 b7a966ce89ed
parent 29668 e7766022a61a
child 30157 df224038c516
permissions -rw-r--r--
changelog: disable delta chains This patch disables delta chains on changelogs. After this patch, new entries on changelogs - including existing changelogs - will be stored as the fulltext of that data (likely compressed). No delta computation will be performed. An overview of delta chains and data justifying this change follows. Revlogs try to store entries as a delta against a previous entry (either a parent revision in the case of generaldelta or the previous physical revision when not using generaldelta). Most of the time this is the correct thing to do: it frequently results in less CPU usage and smaller storage. Delta chains are most effective when the base revision being deltad against is similar to the current data. This tends to occur naturally for manifests and file data, since only small parts of each tend to change with each revision. Changelogs, however, are a different story. Changelog entries represent changesets/commits. And unless commits in a repository are homogonous (same author, changing same files, similar commit messages, etc), a delta from one entry to the next tends to be relatively large compared to the size of the entry. This means that delta chains tend to be short. How short? Here is the full vs delta revision breakdown on some real world repos: Repo % Full % Delta Max Length hg 45.8 54.2 6 mozilla-central 42.4 57.6 8 mozilla-unified 42.5 57.5 17 pypy 46.1 53.9 6 python-zstandard 46.1 53.9 3 (I threw in python-zstandard as an example of a repo that is homogonous. It contains a small Python project with changes all from the same author.) Contrast this with the manifest revlog for these repos, where 99+% of revisions are deltas and delta chains run into the thousands. So delta chains aren't as useful on changelogs. But even a short delta chain may provide benefits. Let's measure that. Delta chains may require less CPU to read revisions if the CPU time spent reading smaller deltas is less than the CPU time used to decompress larger individual entries. We can measure this via `hg perfrevlog -c -d 1` to iterate a revlog to resolve each revision's fulltext. Here are the results of that command on a repo using delta chains in its changelog and on a repo without delta chains: hg (forward) ! wall 0.407008 comb 0.410000 user 0.410000 sys 0.000000 (best of 25) ! wall 0.390061 comb 0.390000 user 0.390000 sys 0.000000 (best of 26) hg (reverse) ! wall 0.515221 comb 0.520000 user 0.520000 sys 0.000000 (best of 19) ! wall 0.400018 comb 0.400000 user 0.390000 sys 0.010000 (best of 25) mozilla-central (forward) ! wall 4.508296 comb 4.490000 user 4.490000 sys 0.000000 (best of 3) ! wall 4.370222 comb 4.370000 user 4.350000 sys 0.020000 (best of 3) mozilla-central (reverse) ! wall 5.758995 comb 5.760000 user 5.720000 sys 0.040000 (best of 3) ! wall 4.346503 comb 4.340000 user 4.320000 sys 0.020000 (best of 3) mozilla-unified (forward) ! wall 4.957088 comb 4.950000 user 4.940000 sys 0.010000 (best of 3) ! wall 4.660528 comb 4.650000 user 4.630000 sys 0.020000 (best of 3) mozilla-unified (reverse) ! wall 6.119827 comb 6.110000 user 6.090000 sys 0.020000 (best of 3) ! wall 4.675136 comb 4.670000 user 4.670000 sys 0.000000 (best of 3) pypy (forward) ! wall 1.231122 comb 1.240000 user 1.230000 sys 0.010000 (best of 8) ! wall 1.164896 comb 1.160000 user 1.160000 sys 0.000000 (best of 9) pypy (reverse) ! wall 1.467049 comb 1.460000 user 1.460000 sys 0.000000 (best of 7) ! wall 1.160200 comb 1.170000 user 1.160000 sys 0.010000 (best of 9) The data clearly shows that it takes less wall and CPU time to resolve revisions when there are no delta chains in the changelogs, regardless of the direction of traversal. Furthermore, not using a delta chain means that fulltext resolution in reverse is as fast as iterating forward. So not using delta chains on the changelog is a clear CPU win for reading operations. An example of a user-visible operation showing this speed-up is revset evaluation. Here are results for `hg perfrevset 'author(gps) or author(mpm)'`: hg ! wall 1.655506 comb 1.660000 user 1.650000 sys 0.010000 (best of 6) ! wall 1.612723 comb 1.610000 user 1.600000 sys 0.010000 (best of 7) mozilla-central ! wall 17.629826 comb 17.640000 user 17.600000 sys 0.040000 (best of 3) ! wall 17.311033 comb 17.300000 user 17.260000 sys 0.040000 (best of 3) What about 00changelog.i size? Repo Delta Chains No Delta Chains hg 7,033,250 6,976,771 mozilla-central 82,978,748 81,574,623 mozilla-unified 88,112,349 86,702,162 pypy 20,740,699 20,659,741 The data shows that removing delta chains from the changelog makes the changelog smaller. Delta chains are also used during changegroup generation. This operation essentially converts a series of revisions to one large delta chain. And changegroup generation is smart: if the delta in the revlog matches what the changegroup is emitting, it will reuse the delta instead of recalculating it. We can measure the impact removing changelog delta chains has on changegroup generation via `hg perfchangegroupchangelog`: hg ! wall 1.589245 comb 1.590000 user 1.590000 sys 0.000000 (best of 7) ! wall 1.788060 comb 1.790000 user 1.790000 sys 0.000000 (best of 6) mozilla-central ! wall 17.382585 comb 17.380000 user 17.340000 sys 0.040000 (best of 3) ! wall 20.161357 comb 20.160000 user 20.120000 sys 0.040000 (best of 3) mozilla-unified ! wall 18.722839 comb 18.720000 user 18.680000 sys 0.040000 (best of 3) ! wall 21.168075 comb 21.170000 user 21.130000 sys 0.040000 (best of 3) pypy ! wall 4.828317 comb 4.830000 user 4.820000 sys 0.010000 (best of 3) ! wall 5.415455 comb 5.420000 user 5.410000 sys 0.010000 (best of 3) The data shows eliminating delta chains makes the changelog part of changegroup generation slower. This is expected since we now have to compute deltas for revisions where we could recycle the delta before. It is worth putting this regression into context of overall changegroup times. Here is the rough total CPU time spent in changegroup generation for various repos while using delta chains on the changelog: Repo CPU Time (s) CPU Time w/ compression hg 4.50 7.05 mozilla-central 111.1 222.0 pypy 28.68 75.5 Before compression, removing delta chains from the changegroup adds ~4.4% overhead to hg changegroup generation, 1.3% to mozilla-central, and 2.0% to pypy. When you factor in zlib compression, these percentages are roughly divided by 2. While the increased CPU usage for changegroup generation is unfortunate, I think it is acceptable because the percentage is small, server operators (those likely impacted most by this) have other mechanisms to mitigate CPU consumption (namely reducing zlib compression level and pre-generated clone bundles), and because there is room to optimize this in the future. For example, we could use the nullid as the base revision, effectively encoding the full revision for each entry in the changegroup. When doing this, `hg perfchangegroupchangelog` nearly halves: mozilla-unified ! wall 21.168075 comb 21.170000 user 21.130000 sys 0.040000 (best of 3) ! wall 11.196461 comb 11.200000 user 11.190000 sys 0.010000 (best of 3) This looks very promising as a future optimization opportunity. It's worth that the changes in test-acl.t to the changegroup part size. This is because revision 6 in the changegroup had a delta chain of length 2 before and after this patch the base revision is nullrev. When the base revision is nullrev, cg2packer.deltaparent() hardcodes the *previous* revision from the changegroup as the delta parent. This caused the delta in the changegroup to switch base revisions, the delta to change, and the size to change accordingly. While the size increased in this case, I think sizes will remain the same on average, as the delta base for changelog revisions doesn't matter too much (as this patch shows). So, I don't consider this a regression.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24344
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     1
Set up a repo
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     2
28542
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
     3
  $ cp $HGRCPATH $HGRCPATH.pretest
24344
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     4
  $ cat <<EOF >> $HGRCPATH
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     5
  > [ui]
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     6
  > interactive = true
28543
f7874de435c5 crecord: use ui.interface to choose curses interface
Simon Farnsworth <simonfar@fb.com>
parents: 28542
diff changeset
     7
  > interface = curses
24344
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     8
  > [experimental]
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
     9
  > crecordtest = testModeCommands
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    10
  > EOF
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    11
29668
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    12
Record with noeol at eof (issue5268)
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    13
  $ hg init noeol
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    14
  $ cd noeol
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    15
  $ printf '0' > a
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    16
  $ printf '0\n' > b
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    17
  $ hg ci -Aqm initial
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    18
  $ printf '1\n0' > a
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    19
  $ printf '1\n0\n' > b
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    20
  $ cat <<EOF >testModeCommands
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    21
  > c
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    22
  > EOF
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    23
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit  -i -m "add hunks" -d "0 0"
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    24
  $ cd ..
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    25
e7766022a61a crecord: properly handle files with No newline at eof (issue5268)
timeless <timeless@mozdev.org>
parents: 28638
diff changeset
    26
Normal repo
24344
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    27
  $ hg init a
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    28
  $ cd a
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    29
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    30
Committing some changes but stopping on the way
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    31
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    32
  $ echo "a" > a
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    33
  $ hg add a
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    34
  $ cat <<EOF >testModeCommands
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    35
  > TOGGLE
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    36
  > X
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    37
  > EOF
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    38
  $ hg commit -i  -m "a" -d "0 0"
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    39
  no changes to record
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    40
  $ hg tip
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    41
  changeset:   -1:000000000000
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    42
  tag:         tip
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    43
  user:        
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    44
  date:        Thu Jan 01 00:00:00 1970 +0000
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    45
  
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    46
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    47
Committing some changes
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    48
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    49
  $ cat <<EOF >testModeCommands
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    50
  > X
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    51
  > EOF
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    52
  $ hg commit -i  -m "a" -d "0 0"
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    53
  $ hg tip
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    54
  changeset:   0:cb9a9f314b8b
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    55
  tag:         tip
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    56
  user:        test
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    57
  date:        Thu Jan 01 00:00:00 1970 +0000
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    58
  summary:     a
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    59
  
27321
dcdf0a52ad36 crecord: add dictionary to default return value of filterpatch
Laurent Charignon <lcharignon@fb.com>
parents: 27156
diff changeset
    60
Check that commit -i works with no changes
dcdf0a52ad36 crecord: add dictionary to default return value of filterpatch
Laurent Charignon <lcharignon@fb.com>
parents: 27156
diff changeset
    61
  $ hg commit -i
dcdf0a52ad36 crecord: add dictionary to default return value of filterpatch
Laurent Charignon <lcharignon@fb.com>
parents: 27156
diff changeset
    62
  no changes to record
dcdf0a52ad36 crecord: add dictionary to default return value of filterpatch
Laurent Charignon <lcharignon@fb.com>
parents: 27156
diff changeset
    63
24344
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    64
Committing only one file
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    65
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    66
  $ echo "a" >> a
24434
f169405c03ab test-interactive: use stable EOL in various file generating routines
Matt Harbison <matt_harbison@yahoo.com>
parents: 24363
diff changeset
    67
  >>> open('b', 'wb').write("1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n")
24344
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    68
  $ hg add b
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    69
  $ cat <<EOF >testModeCommands
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    70
  > TOGGLE
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    71
  > KEY_DOWN
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    72
  > X
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    73
  > EOF
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    74
  $ hg commit -i  -m "one file" -d "0 0"
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    75
  $ hg tip
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    76
  changeset:   1:fb2705a663ea
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    77
  tag:         tip
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    78
  user:        test
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    79
  date:        Thu Jan 01 00:00:00 1970 +0000
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    80
  summary:     one file
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    81
  
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    82
  $ hg cat -r tip a
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    83
  a
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    84
  $ cat a
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    85
  a
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    86
  a
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    87
25557
52c552a05414 crecord: exit edition of hunk with non-zero status does not interrupt session
Laurent Charignon <lcharignon@fb.com>
parents: 24837
diff changeset
    88
Committing only one hunk while aborting edition of hunk
24344
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    89
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    90
- Untoggle all the hunks, go down to the second file
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    91
- unfold it
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    92
- go down to second hunk (1 for the first hunk, 1 for the first hunkline, 1 for the second hunk, 1 for the second hunklike)
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    93
- toggle the second hunk
27156
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
    94
- toggle on and off the amend mode (to check that it toggles off)
26781
1aee2ab0f902 spelling: trivial spell checking
Mads Kiilerich <madski@unity3d.com>
parents: 25557
diff changeset
    95
- edit the hunk and quit the editor immediately with non-zero status
24344
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    96
- commit
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    97
25557
52c552a05414 crecord: exit edition of hunk with non-zero status does not interrupt session
Laurent Charignon <lcharignon@fb.com>
parents: 24837
diff changeset
    98
  $ printf "printf 'editor ran\n'; exit 1" > editor.sh
24344
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
    99
  $ echo "x" > c
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   100
  $ cat b >> c
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   101
  $ echo "y" >> c
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   102
  $ mv c b
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   103
  $ cat <<EOF >testModeCommands
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   104
  > A
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   105
  > KEY_DOWN
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   106
  > f
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   107
  > KEY_DOWN
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   108
  > KEY_DOWN
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   109
  > KEY_DOWN
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   110
  > KEY_DOWN
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   111
  > TOGGLE
27156
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   112
  > a
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   113
  > a
25557
52c552a05414 crecord: exit edition of hunk with non-zero status does not interrupt session
Laurent Charignon <lcharignon@fb.com>
parents: 24837
diff changeset
   114
  > e
24344
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   115
  > X
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   116
  > EOF
25557
52c552a05414 crecord: exit edition of hunk with non-zero status does not interrupt session
Laurent Charignon <lcharignon@fb.com>
parents: 24837
diff changeset
   117
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i  -m "one hunk" -d "0 0"
52c552a05414 crecord: exit edition of hunk with non-zero status does not interrupt session
Laurent Charignon <lcharignon@fb.com>
parents: 24837
diff changeset
   118
  editor ran
52c552a05414 crecord: exit edition of hunk with non-zero status does not interrupt session
Laurent Charignon <lcharignon@fb.com>
parents: 24837
diff changeset
   119
  $ rm editor.sh
24344
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   120
  $ hg tip
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   121
  changeset:   2:7d10dfe755a8
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   122
  tag:         tip
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   123
  user:        test
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   124
  date:        Thu Jan 01 00:00:00 1970 +0000
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   125
  summary:     one hunk
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   126
  
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   127
  $ hg cat -r tip b
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   128
  1
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   129
  2
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   130
  3
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   131
  4
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   132
  5
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   133
  6
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   134
  7
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   135
  8
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   136
  9
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   137
  10
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   138
  y
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   139
  $ cat b
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   140
  x
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   141
  1
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   142
  2
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   143
  3
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   144
  4
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   145
  5
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   146
  6
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   147
  7
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   148
  8
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   149
  9
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   150
  10
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   151
  y
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   152
  $ hg commit -m "other hunks"
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   153
  $ hg tip
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   154
  changeset:   3:a6735021574d
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   155
  tag:         tip
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   156
  user:        test
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   157
  date:        Thu Jan 01 00:00:00 1970 +0000
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   158
  summary:     other hunks
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   159
  
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   160
  $ hg cat -r tip b
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   161
  x
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   162
  1
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   163
  2
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   164
  3
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   165
  4
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   166
  5
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   167
  6
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   168
  7
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   169
  8
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   170
  9
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   171
  10
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   172
  y
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   173
24469
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   174
Newly added files can be selected with the curses interface
24344
6b43baac6dfb record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff changeset
   175
24469
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   176
  $ hg update -C .
24837
edf907bd8144 record: fix record with change on moved file crashes (issue4619)
Laurent Charignon <lcharignon@fb.com>
parents: 24469
diff changeset
   177
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
24469
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   178
  $ echo "hello" > x
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   179
  $ hg add x
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   180
  $ cat <<EOF >testModeCommands
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   181
  > TOGGLE
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   182
  > TOGGLE
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   183
  > X
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   184
  > EOF
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   185
  $ hg st
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   186
  A x
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   187
  ? testModeCommands
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   188
  $ hg commit -i  -m "newly added file" -d "0 0"
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   189
  $ hg st
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   190
  ? testModeCommands
e71053ef0c46 record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents: 24435
diff changeset
   191
27156
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   192
Amend option works
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   193
  $ echo "hello world" > x
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   194
  $ hg diff -c .
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   195
  diff -r a6735021574d -r 2b0e9be4d336 x
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   196
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   197
  +++ b/x	Thu Jan 01 00:00:00 1970 +0000
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   198
  @@ -0,0 +1,1 @@
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   199
  +hello
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   200
  $ cat <<EOF >testModeCommands
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   201
  > a
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   202
  > X
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   203
  > EOF
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   204
  $ hg commit -i  -m "newly added file" -d "0 0"
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   205
  saved backup bundle to $TESTTMP/a/.hg/strip-backup/2b0e9be4d336-28bbe4e2-amend-backup.hg (glob)
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   206
  $ hg diff -c .
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   207
  diff -r a6735021574d -r c1d239d165ae x
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   208
  --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   209
  +++ b/x	Thu Jan 01 00:00:00 1970 +0000
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   210
  @@ -0,0 +1,1 @@
55fa7c3900ae commit: add amend mode for commit -i
Laurent Charignon <lcharignon@fb.com>
parents: 26781
diff changeset
   211
  +hello world
27914
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   212
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   213
Editing a hunk puts you back on that hunk when done editing (issue5041)
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   214
To do that, we change two lines in a file, pretend to edit the second line,
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   215
exit, toggle the line selected at the end of the edit and commit.
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   216
The first line should be recorded if we were put on the second line at the end
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   217
of the edit.
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   218
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   219
  $ hg update -C .
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   220
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   221
  $ echo "foo" > x
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   222
  $ echo "hello world" >> x
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   223
  $ echo "bar" >> x
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   224
  $ cat <<EOF >testModeCommands
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   225
  > f
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   226
  > KEY_DOWN
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   227
  > KEY_DOWN
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   228
  > KEY_DOWN
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   229
  > KEY_DOWN
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   230
  > e
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   231
  > TOGGLE
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   232
  > X
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   233
  > EOF
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   234
  $ printf "printf 'editor ran\n'; exit 0" > editor.sh
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   235
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit  -i -m "edit hunk" -d "0 0"
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   236
  editor ran
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   237
  $ hg cat -r . x
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   238
  foo
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   239
  hello world
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   240
28638
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   241
Testing the review option. The entire final filtered patch should show
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   242
up in the editor and be editable. We will unselect the second file and
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   243
the first hunk of the third file. During review, we will decide that
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   244
"lower" sounds better than "bottom", and the final commit should
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   245
reflect this edition.
27914
505a10b504ed crecord: edit during hg crecord should preserve cursor position (issue5041)
Laurent Charignon <lcharignon@fb.com>
parents: 27321
diff changeset
   246
28638
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   247
  $ hg update -C .
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   248
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   249
  $ echo "top" > c
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   250
  $ cat x >> c
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   251
  $ echo "bottom" >> c
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   252
  $ mv c x
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   253
  $ echo "third a" >> a
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   254
  $ echo "we will unselect this" >> b
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   255
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   256
  $ cat > editor.sh <<EOF
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   257
  > cat "\$1"
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   258
  > cat "\$1" | sed s/bottom/lower/ > tmp
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   259
  > mv tmp "\$1"
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   260
  > EOF
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   261
  $ cat > testModeCommands <<EOF
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   262
  > KEY_DOWN
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   263
  > TOGGLE
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   264
  > KEY_DOWN
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   265
  > f
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   266
  > KEY_DOWN
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   267
  > TOGGLE
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   268
  > R
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   269
  > EOF
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   270
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   271
  $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit  -i -m "review hunks" -d "0 0"
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   272
  # To remove '-' lines, make them ' ' lines (context).
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   273
  # To remove '+' lines, delete them.
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   274
  # Lines starting with # will be removed from the patch.
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   275
  #
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   276
  # If the patch applies cleanly, the edited patch will immediately
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   277
  # be finalised. If it does not apply cleanly, rejects files will be
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   278
  # generated. You can use those when you try again.
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   279
  diff --git a/a b/a
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   280
  --- a/a
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   281
  +++ b/a
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   282
  @@ -1,2 +1,3 @@
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   283
   a
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   284
   a
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   285
  +third a
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   286
  diff --git a/x b/x
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   287
  --- a/x
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   288
  +++ b/x
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   289
  @@ -1,2 +1,3 @@
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   290
   foo
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   291
   hello world
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   292
  +bottom
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   293
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   294
  $ hg cat -r . a
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   295
  a
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   296
  a
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   297
  third a
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   298
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   299
  $ hg cat -r . b
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   300
  x
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   301
  1
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   302
  2
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   303
  3
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   304
  4
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   305
  5
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   306
  6
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   307
  7
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   308
  8
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   309
  9
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   310
  10
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   311
  y
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   312
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   313
  $ hg cat -r . x
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   314
  foo
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   315
  hello world
44319097e7b9 crecord: re-enable reviewing a patch before comitting it
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 28543
diff changeset
   316
  lower
28542
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   317
Check ui.interface logic for the chunkselector
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   318
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   319
The default interface is text
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   320
  $ cp $HGRCPATH.pretest $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   321
  $ chunkselectorinterface() {
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   322
  > python <<EOF
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   323
  > from mercurial import hg, ui, parsers;\
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   324
  > repo = hg.repository(ui.ui(), ".");\
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   325
  > print repo.ui.interface("chunkselector")
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   326
  > EOF
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   327
  > }
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   328
  $ chunkselectorinterface
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   329
  text
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   330
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   331
If only the default is set, we'll use that for the feature, too
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   332
  $ cp $HGRCPATH.pretest $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   333
  $ cat <<EOF >> $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   334
  > [ui]
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   335
  > interface = curses
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   336
  > EOF
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   337
  $ chunkselectorinterface
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   338
  curses
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   339
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   340
It is possible to override the default interface with a feature specific
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   341
interface
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   342
  $ cp $HGRCPATH.pretest $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   343
  $ cat <<EOF >> $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   344
  > [ui]
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   345
  > interface = text
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   346
  > interface.chunkselector = curses
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   347
  > EOF
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   348
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   349
  $ chunkselectorinterface
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   350
  curses
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   351
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   352
  $ cp $HGRCPATH.pretest $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   353
  $ cat <<EOF >> $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   354
  > [ui]
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   355
  > interface = curses
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   356
  > interface.chunkselector = text
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   357
  > EOF
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   358
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   359
  $ chunkselectorinterface
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   360
  text
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   361
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   362
If a bad interface name is given, we use the default value (with a nice
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   363
error message to suggest that the configuration needs to be fixed)
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   364
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   365
  $ cp $HGRCPATH.pretest $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   366
  $ cat <<EOF >> $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   367
  > [ui]
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   368
  > interface = blah
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   369
  > EOF
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   370
  $ chunkselectorinterface
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   371
  invalid value for ui.interface: blah (using text)
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   372
  text
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   373
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   374
  $ cp $HGRCPATH.pretest $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   375
  $ cat <<EOF >> $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   376
  > [ui]
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   377
  > interface = curses
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   378
  > interface.chunkselector = blah
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   379
  > EOF
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   380
  $ chunkselectorinterface
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   381
  invalid value for ui.interface.chunkselector: blah (using curses)
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   382
  curses
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   383
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   384
  $ cp $HGRCPATH.pretest $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   385
  $ cat <<EOF >> $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   386
  > [ui]
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   387
  > interface = blah
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   388
  > interface.chunkselector = curses
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   389
  > EOF
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   390
  $ chunkselectorinterface
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   391
  invalid value for ui.interface: blah
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   392
  curses
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   393
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   394
  $ cp $HGRCPATH.pretest $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   395
  $ cat <<EOF >> $HGRCPATH
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   396
  > [ui]
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   397
  > interface = blah
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   398
  > interface.chunkselector = blah
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   399
  > EOF
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   400
  $ chunkselectorinterface
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   401
  invalid value for ui.interface: blah
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   402
  invalid value for ui.interface.chunkselector: blah (using text)
71e12fc53b80 ui: add new config flag for interface selection
Simon Farnsworth <simonfar@fb.com>
parents: 27914
diff changeset
   403
  text