Mercurial > hg
annotate tests/test-export.t @ 37048:fc5e261915b9
wireproto: require POST for all HTTPv2 requests
Wire protocol version 1 transfers argument data via request
headers by default. This has historically caused problems because
servers institute limits on the length of individual HTTP headers
as well as the total size of all request headers. Mercurial servers
can advertise the maximum length of an individual header. But
there's no guarantee any intermediate HTTP agents will accept
headers up to that length.
In the existing wire protocol, server operators typically also
key off the HTTP request method to implement authentication.
For example, GET requests translate to read-only requests and
can be allowed. But read-write commands must use POST and require
authentication. This has typically worked because the only wire
protocol commands that use POST modify the repo (e.g. the
"unbundle" command).
There is an experimental feature to enable clients to transmit
argument data via POST request bodies. This is technically a
better and more robust solution. But we can't enable it by default
because of servers assuming POST means write access.
In version 2 of the wire protocol, the permissions of a request
are encoded in the URL. And with it being a new protocol in a new
URL space, we're not constrained by backwards compatibility
requirements.
This commit adopts the technically superior mechanism of using
HTTP request bodies to send argument data by requiring POST for
all commands. Strictly speaking, it may be possible to send
request bodies on GET requests. But my experience is that not all
HTTP stacks support this. POST pretty much always works. Using POST
for read-only operations does sacrifice some RESTful design
purity. But this API cares about practicality, not about being
in Roy T. Fielding's REST ivory tower.
There's a chance we may relax this restriction in the future. But
for now, I want to see how far we can get with a POST only API.
Differential Revision: https://phab.mercurial-scm.org/D2837
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 13 Mar 2018 11:57:43 -0700 |
parents | 1b179d151578 |
children | daafaff4e5be |
rev | line source |
---|---|
12034
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
1 $ hg init repo |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
2 $ cd repo |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
3 $ touch foo |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
4 $ hg add foo |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
5 $ for i in 0 1 2 3 4 5 6 7 8 9 10 11; do |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
6 > echo "foo-$i" >> foo |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
7 > hg ci -m "foo-$i" |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
8 > done |
3899
504dee0abeac
Make sequence number on hg export start at 1 (as documented for %n). Add test.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
9 |
14986
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
10 $ for out in "%nof%N" "%%%H" "%b-%R" "%h" "%r" "%m"; do |
12034
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
11 > echo |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
12 > echo "# foo-$out.patch" |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
13 > hg export -v -o "foo-$out.patch" 2:tip |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
14 > done |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
15 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
16 # foo-%nof%N.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
17 exporting patches: |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
18 foo-01of10.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
19 foo-02of10.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
20 foo-03of10.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
21 foo-04of10.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
22 foo-05of10.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
23 foo-06of10.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
24 foo-07of10.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
25 foo-08of10.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
26 foo-09of10.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
27 foo-10of10.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
28 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
29 # foo-%%%H.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
30 exporting patches: |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
31 foo-%617188a1c80f869a7b66c85134da88a6fb145f67.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
32 foo-%dd41a5ff707a5225204105611ba49cc5c229d55f.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
33 foo-%f95a5410f8664b6e1490a4af654e4b7d41a7b321.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
34 foo-%4346bcfde53b4d9042489078bcfa9c3e28201db2.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
35 foo-%afda8c3a009cc99449a05ad8aa4655648c4ecd34.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
36 foo-%35284ce2b6b99c9d2ac66268fe99e68e1974e1aa.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
37 foo-%9688c41894e6931305fa7165a37f6568050b4e9b.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
38 foo-%747d3c68f8ec44bb35816bfcd59aeb50b9654c2f.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
39 foo-%5f17a83f5fbd9414006a5e563eab4c8a00729efd.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
40 foo-%f3acbafac161ec68f1598af38f794f28847ca5d3.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
41 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
42 # foo-%b-%R.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
43 exporting patches: |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
44 foo-repo-2.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
45 foo-repo-3.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
46 foo-repo-4.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
47 foo-repo-5.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
48 foo-repo-6.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
49 foo-repo-7.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
50 foo-repo-8.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
51 foo-repo-9.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
52 foo-repo-10.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
53 foo-repo-11.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
54 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
55 # foo-%h.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
56 exporting patches: |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
57 foo-617188a1c80f.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
58 foo-dd41a5ff707a.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
59 foo-f95a5410f866.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
60 foo-4346bcfde53b.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
61 foo-afda8c3a009c.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
62 foo-35284ce2b6b9.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
63 foo-9688c41894e6.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
64 foo-747d3c68f8ec.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
65 foo-5f17a83f5fbd.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
66 foo-f3acbafac161.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
67 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
68 # foo-%r.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
69 exporting patches: |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
70 foo-02.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
71 foo-03.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
72 foo-04.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
73 foo-05.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
74 foo-06.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
75 foo-07.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
76 foo-08.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
77 foo-09.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
78 foo-10.patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
79 foo-11.patch |
14986
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
80 |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
81 # foo-%m.patch |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
82 exporting patches: |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
83 foo-foo_2.patch |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
84 foo-foo_3.patch |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
85 foo-foo_4.patch |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
86 foo-foo_5.patch |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
87 foo-foo_6.patch |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
88 foo-foo_7.patch |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
89 foo-foo_8.patch |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
90 foo-foo_9.patch |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
91 foo-foo_10.patch |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
92 foo-foo_11.patch |
7319
eae1767cc6a8
export: fixed silent output file overwriting
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
parents:
3899
diff
changeset
|
93 |
18613
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
94 Doing it again clobbers the files rather than appending: |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
95 $ hg export -v -o "foo-%m.patch" 2:3 |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
96 exporting patches: |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
97 foo-foo_2.patch |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
98 foo-foo_3.patch |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
99 $ grep HG foo-foo_2.patch | wc -l |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
100 \s*1 (re) |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
101 $ grep HG foo-foo_3.patch | wc -l |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
102 \s*1 (re) |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
103 |
12034
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
104 Exporting 4 changesets to a file: |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
105 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
106 $ hg export -o export_internal 1 2 3 4 |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12034
diff
changeset
|
107 $ grep HG export_internal | wc -l |
12377
a5b77eb0409b
tests: various fixes for new unified test pattern format
Matt Mackall <mpm@selenic.com>
parents:
12366
diff
changeset
|
108 \s*4 (re) |
12034
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
109 |
18613
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
110 Doing it again clobbers the file rather than appending: |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
111 $ hg export -o export_internal 1 2 3 4 |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
112 $ grep HG export_internal | wc -l |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
113 \s*4 (re) |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
114 |
1a2f4c633410
export: clobber files with -o (bc) (issue3652)
Augie Fackler <raf@durin42.com>
parents:
17460
diff
changeset
|
115 Exporting 4 changesets to stdout: |
12034
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
116 |
12366
c01dc9087d9a
tests: drop a bunch of sed calls from unified tests
Matt Mackall <mpm@selenic.com>
parents:
12034
diff
changeset
|
117 $ hg export 1 2 3 4 | grep HG | wc -l |
12377
a5b77eb0409b
tests: various fixes for new unified test pattern format
Matt Mackall <mpm@selenic.com>
parents:
12366
diff
changeset
|
118 \s*4 (re) |
12034
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
119 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
120 Exporting revision -2 to a file: |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
121 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
122 $ hg export -- -2 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
123 # HG changeset patch |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
124 # User test |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
125 # Date 0 0 |
18648
76b69cccb07a
export: show 'Date' header in a format that also is readable for humans
Mads Kiilerich <mads@kiilerich.com>
parents:
18613
diff
changeset
|
126 # Thu Jan 01 00:00:00 1970 +0000 |
12034
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
127 # Node ID 5f17a83f5fbd9414006a5e563eab4c8a00729efd |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
128 # Parent 747d3c68f8ec44bb35816bfcd59aeb50b9654c2f |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
129 foo-10 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
130 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
131 diff -r 747d3c68f8ec -r 5f17a83f5fbd foo |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
132 --- a/foo Thu Jan 01 00:00:00 1970 +0000 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
133 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
134 @@ -8,3 +8,4 @@ |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
135 foo-7 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
136 foo-8 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
137 foo-9 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
138 +foo-10 |
3bfd425f1472
tests: unify test-export
Adrian Buehlmann <adrian@cadifra.com>
parents:
8167
diff
changeset
|
139 |
32662
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
140 Exporting wdir revision: |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
141 |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
142 $ echo "foo-wdir" >> foo |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
143 $ hg export 'wdir()' |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
144 # HG changeset patch |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
145 # User test |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
146 # Date 0 0 |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
147 # Thu Jan 01 00:00:00 1970 +0000 |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
148 # Node ID ffffffffffffffffffffffffffffffffffffffff |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
149 # Parent f3acbafac161ec68f1598af38f794f28847ca5d3 |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
150 |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
151 |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
152 diff -r f3acbafac161 foo |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
153 --- a/foo Thu Jan 01 00:00:00 1970 +0000 |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
154 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
155 @@ -10,3 +10,4 @@ |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
156 foo-9 |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
157 foo-10 |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
158 foo-11 |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
159 +foo-wdir |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
160 $ hg revert -q foo |
9d201b39ccd9
export: map wctx.node() to 'ff...' node id (issue5438)
Yuya Nishihara <yuya@tcha.org>
parents:
29516
diff
changeset
|
161 |
27416
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
162 No filename should be printed if stdout is specified explicitly: |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
163 |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
164 $ hg export -v 1 -o - |
27419
7e2495bf0ad8
cmdutil: do not duplicate stdout by makefileobj()
Yuya Nishihara <yuya@tcha.org>
parents:
27416
diff
changeset
|
165 exporting patch: |
27416
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
166 # HG changeset patch |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
167 # User test |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
168 # Date 0 0 |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
169 # Thu Jan 01 00:00:00 1970 +0000 |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
170 # Node ID d1c9656e973cfb5aebd5499bbd2cb350e3b12266 |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
171 # Parent 871558de6af2e8c244222f8eea69b782c94ce3df |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
172 foo-1 |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
173 |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
174 diff -r 871558de6af2 -r d1c9656e973c foo |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
175 --- a/foo Thu Jan 01 00:00:00 1970 +0000 |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
176 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
177 @@ -1,1 +1,2 @@ |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
178 foo-0 |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
179 +foo-1 |
9d04b4da6773
export: do not print '<fdopen>' as an output filename
Yuya Nishihara <yuya@tcha.org>
parents:
23172
diff
changeset
|
180 |
14986
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
181 Checking if only alphanumeric characters are used in the file name (%m option): |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
182 |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
183 $ echo "line" >> foo |
29516
e5c61e745cd7
test-export: be more aggressive about quoting ^
Augie Fackler <augie@google.com>
parents:
27419
diff
changeset
|
184 $ hg commit -m " !\"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]"'^'"_\`abcdefghijklmnopqrstuvwxyz{|}~" |
14986
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
185 $ hg export -v -o %m.patch tip |
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
186 exporting patch: |
36507
165cf86365ff
cmdutil: strip "%m" pattern (first line of commit message) from both ends
Yuya Nishihara <yuya@tcha.org>
parents:
36239
diff
changeset
|
187 ___________0123456789_______ABCDEFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz____.patch |
14986
70e11de6964d
export: add %m to file format string (first line of the commit message)
Andrzej Bieniek <andyhelp@gmail.com>
parents:
12377
diff
changeset
|
188 |
36511
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
189 Template fragments in file name: |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
190 |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
191 $ hg export -v -o '{node|shortest}.patch' tip |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
192 exporting patch: |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
193 197e.patch |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
194 |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
195 Backslash should be preserved because it is a directory separator on Windows: |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
196 |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
197 $ mkdir out |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
198 $ hg export -v -o 'out\{node|shortest}.patch' tip |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
199 exporting patch: |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
200 out\197e.patch |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
201 |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
202 Still backslash is taken as an escape character in inner template strings: |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
203 |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
204 $ hg export -v -o '{"out\{foo}.patch"}' tip |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
205 exporting patch: |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
206 out{foo}.patch |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
207 |
36239
428de1a59f2d
cmdutil: narrow scope of KeyError in makefilename()
Yuya Nishihara <yuya@tcha.org>
parents:
32662
diff
changeset
|
208 Invalid pattern in file name: |
428de1a59f2d
cmdutil: narrow scope of KeyError in makefilename()
Yuya Nishihara <yuya@tcha.org>
parents:
32662
diff
changeset
|
209 |
428de1a59f2d
cmdutil: narrow scope of KeyError in makefilename()
Yuya Nishihara <yuya@tcha.org>
parents:
32662
diff
changeset
|
210 $ hg export -o '%x.patch' tip |
428de1a59f2d
cmdutil: narrow scope of KeyError in makefilename()
Yuya Nishihara <yuya@tcha.org>
parents:
32662
diff
changeset
|
211 abort: invalid format spec '%x' in output filename |
428de1a59f2d
cmdutil: narrow scope of KeyError in makefilename()
Yuya Nishihara <yuya@tcha.org>
parents:
32662
diff
changeset
|
212 [255] |
36511
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
213 $ hg export -o '%' tip |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
214 abort: incomplete format spec in output filename |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
215 [255] |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
216 $ hg export -o '%{"foo"}' tip |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
217 abort: incomplete format spec in output filename |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
218 [255] |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
219 $ hg export -o '%m{' tip |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
220 hg: parse error at 3: unterminated template expansion |
36669
80d7fb6c2dec
templater: add hint to template parse errors to help locate issues
Ryan McElroy <rmcelroy@fb.com>
parents:
36511
diff
changeset
|
221 (%m{ |
36691
1b179d151578
templater: fix position of terminator character in error message
Yuya Nishihara <yuya@tcha.org>
parents:
36669
diff
changeset
|
222 ^ here) |
36511
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
223 [255] |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
224 $ hg export -o '%\' tip |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
225 abort: invalid format spec '%\' in output filename |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
226 [255] |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
227 $ hg export -o '\%' tip |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
228 abort: incomplete format spec in output filename |
aa3294027936
cmdutil: expand filename format string by templater (BC)
Yuya Nishihara <yuya@tcha.org>
parents:
36507
diff
changeset
|
229 [255] |
36239
428de1a59f2d
cmdutil: narrow scope of KeyError in makefilename()
Yuya Nishihara <yuya@tcha.org>
parents:
32662
diff
changeset
|
230 |
16357
8ca7187d479f
export: catch exporting empty revsets (issue3353)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14986
diff
changeset
|
231 Catch exporting unknown revisions (especially empty revsets, see issue3353) |
8ca7187d479f
export: catch exporting empty revsets (issue3353)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14986
diff
changeset
|
232 |
8ca7187d479f
export: catch exporting empty revsets (issue3353)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14986
diff
changeset
|
233 $ hg export |
18956
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
234 # HG changeset patch |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
235 # User test |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
236 # Date 0 0 |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
237 # Thu Jan 01 00:00:00 1970 +0000 |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
238 # Node ID 197ecd81a57f760b54f34a58817ad5b04991fa47 |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
239 # Parent f3acbafac161ec68f1598af38f794f28847ca5d3 |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
240 !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
241 |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
242 diff -r f3acbafac161 -r 197ecd81a57f foo |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
243 --- a/foo Thu Jan 01 00:00:00 1970 +0000 |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
244 +++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
245 @@ -10,3 +10,4 @@ |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
246 foo-9 |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
247 foo-10 |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
248 foo-11 |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
249 +line |
1a9ad84583ee
export: export working directory parent by default
Mads Kiilerich <mads@kiilerich.com>
parents:
18648
diff
changeset
|
250 |
16357
8ca7187d479f
export: catch exporting empty revsets (issue3353)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14986
diff
changeset
|
251 $ hg export "" |
8ca7187d479f
export: catch exporting empty revsets (issue3353)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14986
diff
changeset
|
252 hg: parse error: empty query |
8ca7187d479f
export: catch exporting empty revsets (issue3353)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14986
diff
changeset
|
253 [255] |
8ca7187d479f
export: catch exporting empty revsets (issue3353)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14986
diff
changeset
|
254 $ hg export 999 |
8ca7187d479f
export: catch exporting empty revsets (issue3353)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14986
diff
changeset
|
255 abort: unknown revision '999'! |
8ca7187d479f
export: catch exporting empty revsets (issue3353)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14986
diff
changeset
|
256 [255] |
8ca7187d479f
export: catch exporting empty revsets (issue3353)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14986
diff
changeset
|
257 $ hg export "not all()" |
8ca7187d479f
export: catch exporting empty revsets (issue3353)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14986
diff
changeset
|
258 abort: export requires at least one changeset |
8ca7187d479f
export: catch exporting empty revsets (issue3353)
Thomas Arendsen Hein <thomas@intevation.de>
parents:
14986
diff
changeset
|
259 [255] |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16357
diff
changeset
|
260 |
17460
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
261 Check for color output |
23172
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
18956
diff
changeset
|
262 $ cat <<EOF >> $HGRCPATH |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
18956
diff
changeset
|
263 > [color] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
18956
diff
changeset
|
264 > mode = ansi |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
18956
diff
changeset
|
265 > [extensions] |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
18956
diff
changeset
|
266 > color = |
e955549cd045
tests: write hgrc of more than two lines by using shell heredoc
Yuya Nishihara <yuya@tcha.org>
parents:
18956
diff
changeset
|
267 > EOF |
17460
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
268 |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
269 $ hg export --color always --nodates tip |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
270 # HG changeset patch |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
271 # User test |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
272 # Date 0 0 |
18648
76b69cccb07a
export: show 'Date' header in a format that also is readable for humans
Mads Kiilerich <mads@kiilerich.com>
parents:
18613
diff
changeset
|
273 # Thu Jan 01 00:00:00 1970 +0000 |
17460
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
274 # Node ID * (glob) |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
275 # Parent * (glob) |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
276 !"#$%&(,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
277 |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
278 \x1b[0;1mdiff -r f3acbafac161 -r 197ecd81a57f foo\x1b[0m (esc) |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
279 \x1b[0;31;1m--- a/foo\x1b[0m (esc) |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
280 \x1b[0;32;1m+++ b/foo\x1b[0m (esc) |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
281 \x1b[0;35m@@ -10,3 +10,4 @@\x1b[0m (esc) |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
282 foo-9 |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
283 foo-10 |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
284 foo-11 |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
285 \x1b[0;32m+line\x1b[0m (esc) |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
286 |
a306837f8c87
color: enabled color support for export command (issue1507)
Ankur Dahiya <ankurd@fb.com>
parents:
17345
diff
changeset
|
287 |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
16357
diff
changeset
|
288 $ cd .. |