Mercurial > hg
annotate tests/test-commit-interactive-curses.t @ 24545:9e0c67e84896
json: implement {tags} template
Tags is pretty easy to implement. Let's start there.
The output is slightly different from `hg tags -Tjson`. For reference,
the CLI has the following output:
[
{
"node": "e2049974f9a23176c2addb61d8f5b86e0d620490",
"rev": 29880,
"tag": "tip",
"type": ""
},
...
]
Our output has the format:
{
"node": "0aeb19ea57a6d223bacddda3871cb78f24b06510",
"tags": [
{
"node": "e2049974f9a23176c2addb61d8f5b86e0d620490",
"tag": "tag1",
"date": [1427775457.0, 25200]
},
...
]
}
"rev" is omitted because it isn't a reliable identifier. We shouldn't
be exposing them in web APIs and giving the impression it remotely
resembles a stable identifier. Perhaps we could one day hide this behind
a config option (it might be useful to expose when running servers
locally).
The "type" of the tag isn't defined because this information isn't yet
exposed to the hgweb templater (it could be in a follow-up) and because
it is questionable whether different types should be exposed at all.
(Should the web interface really be exposing "local" tags?)
We use an object for the outer type instead of Array for a few reasons.
First, it is extensible. If we ever need to throw more global properties
into the output, we can do that without breaking backwards compatibility
(property additions should be backwards compatible). Second, uniformity
in web APIs is nice. Having everything return objects seems much saner than
a mix of array and object. Third, there are security issues with arrays
in older browsers. The JSON web services world almost never uses arrays
as the main type for this reason.
Another possibly controversial part about this patch is how dates are
defined. While JSON has a Date type, it is based on the JavaScript Date
type, which is widely considered a pile of garbage. It is a non-starter
for this reason.
Many of Mercurial's built-in date filters drop seconds resolution. So
that's a non-starter as well, since we want the API to be lossless where
possible. rfc3339date, rfc822date, isodatesec, and date are all lossless.
However, they each require the client to perform string parsing on top of
JSON decoding. While date parsing libraries are pretty ubiquitous, some
languages don't have them out of the box. However, pretty much every
programming language can deal with UNIX timestamps (which are just
integers or floats). So, we choose to use Mercurial's internal date
representation, which in JSON is modeled as float seconds since UNIX
epoch and an integer timezone offset from UTC (keep in mind
JavaScript/JSON models all "Numbers" as double prevision floating point
numbers, so there isn't a difference between ints and floats in JSON).
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 31 Mar 2015 14:52:21 -0700 |
parents | e71053ef0c46 |
children | edf907bd8144 |
rev | line source |
---|---|
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 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
3 $ cat <<EOF >> $HGRCPATH |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
4 > [ui] |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
5 > interactive = true |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
6 > [experimental] |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
7 > crecord = true |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
8 > crecordtest = testModeCommands |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
9 > EOF |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
10 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
11 $ hg init a |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
12 $ cd a |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
13 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
14 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
|
15 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
16 $ echo "a" > a |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
17 $ hg add a |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
18 $ cat <<EOF >testModeCommands |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
19 > TOGGLE |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
20 > X |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
21 > EOF |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
22 $ 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
|
23 no changes to record |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
24 $ hg tip |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
25 changeset: -1:000000000000 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
26 tag: tip |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
27 user: |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
28 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
|
29 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
30 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
31 Committing some changes |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
32 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
33 $ cat <<EOF >testModeCommands |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
34 > X |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
35 > EOF |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
36 $ 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
|
37 $ hg tip |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
38 changeset: 0:cb9a9f314b8b |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
39 tag: tip |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
40 user: test |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
41 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
|
42 summary: a |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
43 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
44 Committing only one file |
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 $ 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
|
47 >>> 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
|
48 $ hg add b |
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 > TOGGLE |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
51 > KEY_DOWN |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
52 > X |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
53 > EOF |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
54 $ 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
|
55 $ hg tip |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
56 changeset: 1:fb2705a663ea |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
57 tag: tip |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
58 user: test |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
59 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
|
60 summary: one file |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
61 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
62 $ hg cat -r tip a |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
63 a |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
64 $ cat a |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
65 a |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
66 a |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
67 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
68 Committing only one hunk |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
69 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
70 - 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
|
71 - unfold it |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
72 - 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
|
73 - toggle the second hunk |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
74 - commit |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
75 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
76 $ echo "x" > c |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
77 $ cat b >> c |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
78 $ echo "y" >> c |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
79 $ mv c b |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
80 $ cat <<EOF >testModeCommands |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
81 > A |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
82 > KEY_DOWN |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
83 > f |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
84 > KEY_DOWN |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
85 > KEY_DOWN |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
86 > KEY_DOWN |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
87 > KEY_DOWN |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
88 > TOGGLE |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
89 > X |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
90 > EOF |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
91 $ hg commit -i -m "one hunk" -d "0 0" |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
92 $ hg tip |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
93 changeset: 2:7d10dfe755a8 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
94 tag: tip |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
95 user: test |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
96 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
|
97 summary: one hunk |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
98 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
99 $ hg cat -r tip b |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
100 1 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
101 2 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
102 3 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
103 4 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
104 5 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
105 6 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
106 7 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
107 8 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
108 9 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
109 10 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
110 y |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
111 $ cat b |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
112 x |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
113 1 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
114 2 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
115 3 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
116 4 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
117 5 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
118 6 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
119 7 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
120 8 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
121 9 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
122 10 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
123 y |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
124 $ hg commit -m "other hunks" |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
125 $ hg tip |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
126 changeset: 3:a6735021574d |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
127 tag: tip |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
128 user: test |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
129 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
|
130 summary: other hunks |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
131 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
132 $ hg cat -r tip b |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
133 x |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
134 1 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
135 2 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
136 3 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
137 4 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
138 5 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
139 6 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
140 7 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
141 8 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
142 9 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
143 10 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
144 y |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
145 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
146 Editing patch of newly added file |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
147 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
148 $ cat > editor.sh << '__EOF__' |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
149 > cat "$1" | sed "s/first/very/g" > tt |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
150 > mv tt "$1" |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
151 > __EOF__ |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
152 $ cat > newfile << '__EOF__' |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
153 > This is the first line |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
154 > This is the second line |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
155 > This is the third line |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
156 > __EOF__ |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
157 $ hg add newfile |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
158 $ cat <<EOF >testModeCommands |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
159 > f |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
160 > KEY_DOWN |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
161 > KEY_DOWN |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
162 > KEY_DOWN |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
163 > e |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
164 > X |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
165 > EOF |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
166 $ HGEDITOR="\"sh\" \"`pwd`/editor.sh\"" hg commit -i -d '23 0' -medit-patch-new |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
167 $ hg tip |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
168 changeset: 4:6a0a43e9eff5 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
169 tag: tip |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
170 user: test |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
171 date: Thu Jan 01 00:00:23 1970 +0000 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
172 summary: edit-patch-new |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
173 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
174 $ hg cat -r tip newfile |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
175 This is the very line |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
176 This is the second line |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
177 This is the third line |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
178 |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
179 $ cat newfile |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
180 This is the first line |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
181 This is the second line |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
182 This is the third line |
6b43baac6dfb
record: add tests for the curses recording interface
Laurent Charignon <lcharignon@fb.com>
parents:
diff
changeset
|
183 |
24469
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
184 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
|
185 |
24469
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
186 $ hg update -C . |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
187 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
188 $ echo "hello" > x |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
189 $ hg add x |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
190 $ cat <<EOF >testModeCommands |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
191 > TOGGLE |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
192 > TOGGLE |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
193 > X |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
194 > EOF |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
195 $ hg st |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
196 A x |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
197 ? editor.sh |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
198 ? testModeCommands |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
199 $ 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
|
200 $ hg st |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
201 ? editor.sh |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
202 ? testModeCommands |
e71053ef0c46
record_curses: add test for newly added files
Laurent Charignon <lcharignon@fb.com>
parents:
24435
diff
changeset
|
203 |