Show More
@@ -1,229 +1,242 b'' | |||||
1 | #!/bin/sh |
|
1 | #!/bin/sh | |
2 |
|
2 | |||
3 | cat <<EOF >> $HGRCPATH |
|
3 | cat <<EOF >> $HGRCPATH | |
4 | [extensions] |
|
4 | [extensions] | |
5 | hgext.keyword = |
|
5 | hgext.keyword = | |
6 | [keyword] |
|
6 | [keyword] | |
7 | * = |
|
7 | * = | |
8 | b = ignore |
|
8 | b = ignore | |
9 | [hooks] |
|
9 | [hooks] | |
10 | commit= |
|
10 | commit= | |
11 | commit.test=cp a hooktest |
|
11 | commit.test=cp a hooktest | |
12 | EOF |
|
12 | EOF | |
13 |
|
13 | |||
14 | echo % help |
|
14 | echo % help | |
15 | hg help keyword |
|
15 | hg help keyword | |
16 |
|
16 | |||
17 | echo % hg kwdemo |
|
17 | echo % hg kwdemo | |
18 | hg --quiet kwdemo --default \ |
|
18 | hg --quiet kwdemo --default \ | |
19 | | sed -e 's![^ ][^ ]*demo.txt,v!/TMP/demo.txt,v!' \ |
|
19 | | sed -e 's![^ ][^ ]*demo.txt,v!/TMP/demo.txt,v!' \ | |
20 | -e 's/,v [a-z0-9][a-z0-9]* /,v xxxxxxxxxxxx /' \ |
|
20 | -e 's/,v [a-z0-9][a-z0-9]* /,v xxxxxxxxxxxx /' \ | |
21 | -e '/[$]Revision/ s/: [a-z0-9][a-z0-9]* /: xxxxxxxxxxxx /' \ |
|
21 | -e '/[$]Revision/ s/: [a-z0-9][a-z0-9]* /: xxxxxxxxxxxx /' \ | |
22 | -e 's! 20[0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-6][0-9]:[0-6][0-9]! 2000/00/00 00:00:00!' |
|
22 | -e 's! 20[0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-6][0-9]:[0-6][0-9]! 2000/00/00 00:00:00!' | |
23 |
|
23 | |||
24 | hg --quiet kwdemo "Branch = {branches}" |
|
24 | hg --quiet kwdemo "Branch = {branches}" | |
25 |
|
25 | |||
26 | hg init Test |
|
26 | hg init Test | |
27 | cd Test |
|
27 | cd Test | |
28 |
|
28 | |||
29 | echo % kwshrink should exit silently in empty/invalid repo |
|
29 | echo % kwshrink should exit silently in empty/invalid repo | |
30 | hg kwshrink |
|
30 | hg kwshrink | |
31 |
|
31 | |||
32 | echo 'expand $Id$' > a |
|
32 | echo 'expand $Id$' > a | |
33 | echo 'do not process $Id:' >> a |
|
33 | echo 'do not process $Id:' >> a | |
34 | echo 'xxx $' >> a |
|
34 | echo 'xxx $' >> a | |
35 | echo 'ignore $Id$' > b |
|
35 | echo 'ignore $Id$' > b | |
36 | ln -s a sym |
|
36 | ln -s a sym | |
37 | echo % cat |
|
37 | echo % cat | |
38 | cat sym a b |
|
38 | cat sym a b | |
39 |
|
39 | |||
40 | echo % addremove |
|
40 | echo % addremove | |
41 | hg addremove |
|
41 | hg addremove | |
42 | echo % status |
|
42 | echo % status | |
43 | hg status |
|
43 | hg status | |
44 |
|
44 | |||
45 | echo % default keyword expansion including commit hook |
|
45 | echo % default keyword expansion including commit hook | |
46 | echo % interrupted commit should not change state or run commit hook |
|
46 | echo % interrupted commit should not change state or run commit hook | |
47 | hg --debug commit |
|
47 | hg --debug commit | |
48 | echo % status |
|
48 | echo % status | |
49 | hg status |
|
49 | hg status | |
50 |
|
50 | |||
51 | echo % commit |
|
51 | echo % commit | |
52 | hg --debug commit -mabsym -d '0 0' -u 'User Name <user@example.com>' |
|
52 | hg --debug commit -mabsym -d '0 0' -u 'User Name <user@example.com>' | |
53 | echo % status |
|
53 | echo % status | |
54 | hg status |
|
54 | hg status | |
55 | echo % identify |
|
55 | echo % identify | |
56 | hg --quiet identify |
|
56 | hg --quiet identify | |
57 | echo % cat |
|
57 | echo % cat | |
58 | cat sym a b |
|
58 | cat sym a b | |
59 | echo % hg cat |
|
59 | echo % hg cat | |
60 | hg cat sym a b |
|
60 | hg cat sym a b | |
61 |
|
61 | |||
62 | echo |
|
62 | echo | |
63 | echo % diff a hooktest |
|
63 | echo % diff a hooktest | |
64 | diff a hooktest |
|
64 | diff a hooktest | |
65 |
|
65 | |||
66 | echo % removing commit hook from config |
|
66 | echo % removing commit hook from config | |
67 | sed -e '/\[hooks\]/,$ d' $HGRCPATH > $HGRCPATH.nohook |
|
67 | sed -e '/\[hooks\]/,$ d' $HGRCPATH > $HGRCPATH.nohook | |
68 | mv $HGRCPATH.nohook $HGRCPATH |
|
68 | mv $HGRCPATH.nohook $HGRCPATH | |
69 | rm hooktest |
|
69 | rm hooktest | |
70 |
|
70 | |||
71 | echo % touch |
|
71 | echo % touch | |
72 | touch a b |
|
72 | touch a b | |
73 | echo % status |
|
73 | echo % status | |
74 | hg status |
|
74 | hg status | |
75 |
|
75 | |||
76 | rm sym a b |
|
76 | rm sym a b | |
77 | echo % update |
|
77 | echo % update | |
78 | hg update |
|
78 | hg update | |
79 | echo % cat |
|
79 | echo % cat | |
80 | cat sym a b |
|
80 | cat sym a b | |
81 |
|
81 | |||
|
82 | echo % check whether expansion is filewise | |||
|
83 | echo '$Id$' > c | |||
|
84 | echo 'tests for different changenodes' >> c | |||
|
85 | echo % commit c | |||
|
86 | hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>' | |||
|
87 | echo % force expansion | |||
|
88 | hg -v kwexpand | |||
|
89 | echo % compare changenodes in a c | |||
|
90 | cat a c | |||
|
91 | echo % rollback and remove c | |||
|
92 | hg rollback | |||
|
93 | rm c | |||
|
94 | ||||
82 | echo % copy |
|
95 | echo % copy | |
83 | hg cp a c |
|
96 | hg cp a c | |
84 |
|
97 | |||
85 | echo % kwfiles added |
|
98 | echo % kwfiles added | |
86 | hg kwfiles |
|
99 | hg kwfiles | |
87 |
|
100 | |||
88 | echo % commit |
|
101 | echo % commit | |
89 | hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>' |
|
102 | hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>' | |
90 | echo % cat a c |
|
103 | echo % cat a c | |
91 | cat a c |
|
104 | cat a c | |
92 | echo % touch copied c after 1 second |
|
105 | echo % touch copied c after 1 second | |
93 | sleep 1 |
|
106 | sleep 1 | |
94 | touch c |
|
107 | touch c | |
95 | echo % status |
|
108 | echo % status | |
96 | hg status |
|
109 | hg status | |
97 |
|
110 | |||
98 | echo % kwfiles |
|
111 | echo % kwfiles | |
99 | hg kwfiles |
|
112 | hg kwfiles | |
100 |
|
113 | |||
101 | echo % diff --rev |
|
114 | echo % diff --rev | |
102 | hg diff --rev 0 | grep -v 'b/c' |
|
115 | hg diff --rev 0 | grep -v 'b/c' | |
103 |
|
116 | |||
104 | echo % rollback |
|
117 | echo % rollback | |
105 | hg rollback |
|
118 | hg rollback | |
106 | echo % status |
|
119 | echo % status | |
107 | hg status |
|
120 | hg status | |
108 | echo % update -C |
|
121 | echo % update -C | |
109 | hg update --clean |
|
122 | hg update --clean | |
110 |
|
123 | |||
111 | echo % custom keyword expansion |
|
124 | echo % custom keyword expansion | |
112 | echo % try with kwdemo |
|
125 | echo % try with kwdemo | |
113 | hg --quiet kwdemo "Xinfo = {author}: {desc}" |
|
126 | hg --quiet kwdemo "Xinfo = {author}: {desc}" | |
114 |
|
127 | |||
115 | cat <<EOF >>$HGRCPATH |
|
128 | cat <<EOF >>$HGRCPATH | |
116 | [keywordmaps] |
|
129 | [keywordmaps] | |
117 | Id = {file} {node|short} {date|rfc822date} {author|user} |
|
130 | Id = {file} {node|short} {date|rfc822date} {author|user} | |
118 | Xinfo = {author}: {desc} |
|
131 | Xinfo = {author}: {desc} | |
119 | EOF |
|
132 | EOF | |
120 |
|
133 | |||
121 | echo % cat |
|
134 | echo % cat | |
122 | cat sym a b |
|
135 | cat sym a b | |
123 | echo % hg cat |
|
136 | echo % hg cat | |
124 | hg cat sym a b |
|
137 | hg cat sym a b | |
125 |
|
138 | |||
126 | echo |
|
139 | echo | |
127 | echo '$Xinfo$' >> a |
|
140 | echo '$Xinfo$' >> a | |
128 | cat <<EOF >> log |
|
141 | cat <<EOF >> log | |
129 | firstline |
|
142 | firstline | |
130 | secondline |
|
143 | secondline | |
131 | EOF |
|
144 | EOF | |
132 |
|
145 | |||
133 | echo % interrupted commit should not change state |
|
146 | echo % interrupted commit should not change state | |
134 | hg commit |
|
147 | hg commit | |
135 | echo % status |
|
148 | echo % status | |
136 | hg status |
|
149 | hg status | |
137 |
|
150 | |||
138 | echo % commit |
|
151 | echo % commit | |
139 | hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>' |
|
152 | hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>' | |
140 | rm log |
|
153 | rm log | |
141 | echo % status |
|
154 | echo % status | |
142 | hg status |
|
155 | hg status | |
143 |
|
156 | |||
144 | echo % cat |
|
157 | echo % cat | |
145 | cat sym a b |
|
158 | cat sym a b | |
146 | echo % hg cat |
|
159 | echo % hg cat | |
147 | hg cat sym a b |
|
160 | hg cat sym a b | |
148 | echo |
|
161 | echo | |
149 |
|
162 | |||
150 | echo % remove |
|
163 | echo % remove | |
151 | hg remove a |
|
164 | hg remove a | |
152 | hg --debug commit -m rma |
|
165 | hg --debug commit -m rma | |
153 | echo % status |
|
166 | echo % status | |
154 | hg status |
|
167 | hg status | |
155 | echo % rollback |
|
168 | echo % rollback | |
156 | hg rollback |
|
169 | hg rollback | |
157 | echo % status |
|
170 | echo % status | |
158 | hg status |
|
171 | hg status | |
159 | echo % revert a |
|
172 | echo % revert a | |
160 | hg revert --no-backup --rev tip a |
|
173 | hg revert --no-backup --rev tip a | |
161 | echo % cat a |
|
174 | echo % cat a | |
162 | cat a |
|
175 | cat a | |
163 |
|
176 | |||
164 | echo % clone to test incoming |
|
177 | echo % clone to test incoming | |
165 | cd .. |
|
178 | cd .. | |
166 | hg clone -r0 Test Test-a |
|
179 | hg clone -r0 Test Test-a | |
167 | cd Test-a |
|
180 | cd Test-a | |
168 | cat <<EOF >> .hg/hgrc |
|
181 | cat <<EOF >> .hg/hgrc | |
169 | [paths] |
|
182 | [paths] | |
170 | default = ../Test |
|
183 | default = ../Test | |
171 | EOF |
|
184 | EOF | |
172 | echo % incoming |
|
185 | echo % incoming | |
173 | # remove path to temp dir |
|
186 | # remove path to temp dir | |
174 | hg incoming | sed -e 's/^\(comparing with \).*\(test-keyword.*\)/\1\2/' |
|
187 | hg incoming | sed -e 's/^\(comparing with \).*\(test-keyword.*\)/\1\2/' | |
175 |
|
188 | |||
176 | sed -e 's/Id.*/& rejecttest/' a > a.new |
|
189 | sed -e 's/Id.*/& rejecttest/' a > a.new | |
177 | mv a.new a |
|
190 | mv a.new a | |
178 | echo % commit rejecttest |
|
191 | echo % commit rejecttest | |
179 | hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>' |
|
192 | hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>' | |
180 | echo % export |
|
193 | echo % export | |
181 | hg export -o ../rejecttest.diff tip |
|
194 | hg export -o ../rejecttest.diff tip | |
182 |
|
195 | |||
183 | cd ../Test |
|
196 | cd ../Test | |
184 | echo % import |
|
197 | echo % import | |
185 | hg import ../rejecttest.diff |
|
198 | hg import ../rejecttest.diff | |
186 | echo % cat |
|
199 | echo % cat | |
187 | cat sym a b |
|
200 | cat sym a b | |
188 | echo |
|
201 | echo | |
189 | echo % rollback |
|
202 | echo % rollback | |
190 | hg rollback |
|
203 | hg rollback | |
191 | echo % clean update |
|
204 | echo % clean update | |
192 | hg update --clean |
|
205 | hg update --clean | |
193 |
|
206 | |||
194 | echo % kwexpand/kwshrink on selected files |
|
207 | echo % kwexpand/kwshrink on selected files | |
195 | mkdir x |
|
208 | mkdir x | |
196 | echo % copy a x/a |
|
209 | echo % copy a x/a | |
197 | hg copy a x/a |
|
210 | hg copy a x/a | |
198 | echo % kwexpand a |
|
211 | echo % kwexpand a | |
199 | hg --verbose kwexpand a |
|
212 | hg --verbose kwexpand a | |
200 | echo % kwexpand x/a should abort |
|
213 | echo % kwexpand x/a should abort | |
201 | hg --verbose kwexpand x/a |
|
214 | hg --verbose kwexpand x/a | |
202 | cd x |
|
215 | cd x | |
203 | hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>' |
|
216 | hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>' | |
204 | echo % cat a |
|
217 | echo % cat a | |
205 | cat a |
|
218 | cat a | |
206 | echo % kwshrink a inside directory x |
|
219 | echo % kwshrink a inside directory x | |
207 | hg --verbose kwshrink a |
|
220 | hg --verbose kwshrink a | |
208 | echo % cat a |
|
221 | echo % cat a | |
209 | cat a |
|
222 | cat a | |
210 | cd .. |
|
223 | cd .. | |
211 |
|
224 | |||
212 | echo % kwexpand nonexistent |
|
225 | echo % kwexpand nonexistent | |
213 | hg kwexpand nonexistent |
|
226 | hg kwexpand nonexistent | |
214 |
|
227 | |||
215 | echo % switch off expansion |
|
228 | echo % switch off expansion | |
216 | echo % kwshrink with unknown file u |
|
229 | echo % kwshrink with unknown file u | |
217 | cp a u |
|
230 | cp a u | |
218 | hg --verbose kwshrink |
|
231 | hg --verbose kwshrink | |
219 | echo % cat |
|
232 | echo % cat | |
220 | cat sym a b |
|
233 | cat sym a b | |
221 | echo % hg cat |
|
234 | echo % hg cat | |
222 | hg cat sym a b |
|
235 | hg cat sym a b | |
223 | echo |
|
236 | echo | |
224 | rm $HGRCPATH |
|
237 | rm $HGRCPATH | |
225 | echo % cat |
|
238 | echo % cat | |
226 | cat sym a b |
|
239 | cat sym a b | |
227 | echo % hg cat |
|
240 | echo % hg cat | |
228 | hg cat sym a b |
|
241 | hg cat sym a b | |
229 | echo |
|
242 | echo |
@@ -1,344 +1,358 b'' | |||||
1 | % help |
|
1 | % help | |
2 | keyword extension - keyword expansion in local repositories |
|
2 | keyword extension - keyword expansion in local repositories | |
3 |
|
3 | |||
4 | This extension expands RCS/CVS-like or self-customized $Keywords$ |
|
4 | This extension expands RCS/CVS-like or self-customized $Keywords$ | |
5 | in tracked text files selected by your configuration. |
|
5 | in tracked text files selected by your configuration. | |
6 |
|
6 | |||
7 | Keywords are only expanded in local repositories and not stored in |
|
7 | Keywords are only expanded in local repositories and not stored in | |
8 | the change history. The mechanism can be regarded as a convenience |
|
8 | the change history. The mechanism can be regarded as a convenience | |
9 | for the current user or for archive distribution. |
|
9 | for the current user or for archive distribution. | |
10 |
|
10 | |||
11 | Configuration is done in the [keyword] and [keywordmaps] sections |
|
11 | Configuration is done in the [keyword] and [keywordmaps] sections | |
12 | of hgrc files. |
|
12 | of hgrc files. | |
13 |
|
13 | |||
14 | Example: |
|
14 | Example: | |
15 |
|
15 | |||
16 | [keyword] |
|
16 | [keyword] | |
17 | # expand keywords in every python file except those matching "x*" |
|
17 | # expand keywords in every python file except those matching "x*" | |
18 | **.py = |
|
18 | **.py = | |
19 | x* = ignore |
|
19 | x* = ignore | |
20 |
|
20 | |||
21 | Note: the more specific you are in your filename patterns |
|
21 | Note: the more specific you are in your filename patterns | |
22 | the less you lose speed in huge repos. |
|
22 | the less you lose speed in huge repos. | |
23 |
|
23 | |||
24 | For [keywordmaps] template mapping and expansion demonstration and |
|
24 | For [keywordmaps] template mapping and expansion demonstration and | |
25 | control run "hg kwdemo". |
|
25 | control run "hg kwdemo". | |
26 |
|
26 | |||
27 | An additional date template filter {date|utcdate} is provided. |
|
27 | An additional date template filter {date|utcdate} is provided. | |
28 |
|
28 | |||
29 | The default template mappings (view with "hg kwdemo -d") can be replaced |
|
29 | The default template mappings (view with "hg kwdemo -d") can be replaced | |
30 | with customized keywords and templates. |
|
30 | with customized keywords and templates. | |
31 | Again, run "hg kwdemo" to control the results of your config changes. |
|
31 | Again, run "hg kwdemo" to control the results of your config changes. | |
32 |
|
32 | |||
33 | Before changing/disabling active keywords, run "hg kwshrink" to avoid |
|
33 | Before changing/disabling active keywords, run "hg kwshrink" to avoid | |
34 | the risk of inadvertedly storing expanded keywords in the change history. |
|
34 | the risk of inadvertedly storing expanded keywords in the change history. | |
35 |
|
35 | |||
36 | To force expansion after enabling it, or a configuration change, run |
|
36 | To force expansion after enabling it, or a configuration change, run | |
37 | "hg kwexpand". |
|
37 | "hg kwexpand". | |
38 |
|
38 | |||
39 | Expansions spanning more than one line and incremental expansions, |
|
39 | Expansions spanning more than one line and incremental expansions, | |
40 | like CVS' $Log$, are not supported. A keyword template map |
|
40 | like CVS' $Log$, are not supported. A keyword template map | |
41 | "Log = {desc}" expands to the first line of the changeset description. |
|
41 | "Log = {desc}" expands to the first line of the changeset description. | |
42 |
|
42 | |||
43 | list of commands: |
|
43 | list of commands: | |
44 |
|
44 | |||
45 | kwdemo print [keywordmaps] configuration and an expansion example |
|
45 | kwdemo print [keywordmaps] configuration and an expansion example | |
46 | kwexpand expand keywords in working directory |
|
46 | kwexpand expand keywords in working directory | |
47 | kwfiles print files currently configured for keyword expansion |
|
47 | kwfiles print files currently configured for keyword expansion | |
48 | kwshrink revert expanded keywords in working directory |
|
48 | kwshrink revert expanded keywords in working directory | |
49 |
|
49 | |||
50 | use "hg -v help keyword" to show aliases and global options |
|
50 | use "hg -v help keyword" to show aliases and global options | |
51 | % hg kwdemo |
|
51 | % hg kwdemo | |
52 | [extensions] |
|
52 | [extensions] | |
53 | hgext.keyword = |
|
53 | hgext.keyword = | |
54 | [keyword] |
|
54 | [keyword] | |
55 | * = |
|
55 | * = | |
56 | b = ignore |
|
56 | b = ignore | |
57 | demo.txt = |
|
57 | demo.txt = | |
58 | [keywordmaps] |
|
58 | [keywordmaps] | |
59 | RCSFile = {file|basename},v |
|
59 | RCSFile = {file|basename},v | |
60 | Author = {author|user} |
|
60 | Author = {author|user} | |
61 | Header = {root}/{file},v {node|short} {date|utcdate} {author|user} |
|
61 | Header = {root}/{file},v {node|short} {date|utcdate} {author|user} | |
62 | Source = {root}/{file},v |
|
62 | Source = {root}/{file},v | |
63 | Date = {date|utcdate} |
|
63 | Date = {date|utcdate} | |
64 | Id = {file|basename},v {node|short} {date|utcdate} {author|user} |
|
64 | Id = {file|basename},v {node|short} {date|utcdate} {author|user} | |
65 | Revision = {node|short} |
|
65 | Revision = {node|short} | |
66 | $RCSFile: demo.txt,v $ |
|
66 | $RCSFile: demo.txt,v $ | |
67 | $Author: test $ |
|
67 | $Author: test $ | |
68 | $Header: /TMP/demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ |
|
68 | $Header: /TMP/demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ | |
69 | $Source: /TMP/demo.txt,v $ |
|
69 | $Source: /TMP/demo.txt,v $ | |
70 | $Date: 2000/00/00 00:00:00 $ |
|
70 | $Date: 2000/00/00 00:00:00 $ | |
71 | $Id: demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ |
|
71 | $Id: demo.txt,v xxxxxxxxxxxx 2000/00/00 00:00:00 test $ | |
72 | $Revision: xxxxxxxxxxxx $ |
|
72 | $Revision: xxxxxxxxxxxx $ | |
73 | [extensions] |
|
73 | [extensions] | |
74 | hgext.keyword = |
|
74 | hgext.keyword = | |
75 | [keyword] |
|
75 | [keyword] | |
76 | * = |
|
76 | * = | |
77 | b = ignore |
|
77 | b = ignore | |
78 | demo.txt = |
|
78 | demo.txt = | |
79 | [keywordmaps] |
|
79 | [keywordmaps] | |
80 | Branch = {branches} |
|
80 | Branch = {branches} | |
81 | $Branch: demobranch $ |
|
81 | $Branch: demobranch $ | |
82 | % kwshrink should exit silently in empty/invalid repo |
|
82 | % kwshrink should exit silently in empty/invalid repo | |
83 | % cat |
|
83 | % cat | |
84 | expand $Id$ |
|
84 | expand $Id$ | |
85 | do not process $Id: |
|
85 | do not process $Id: | |
86 | xxx $ |
|
86 | xxx $ | |
87 | expand $Id$ |
|
87 | expand $Id$ | |
88 | do not process $Id: |
|
88 | do not process $Id: | |
89 | xxx $ |
|
89 | xxx $ | |
90 | ignore $Id$ |
|
90 | ignore $Id$ | |
91 | % addremove |
|
91 | % addremove | |
92 | adding a |
|
92 | adding a | |
93 | adding b |
|
93 | adding b | |
94 | adding sym |
|
94 | adding sym | |
95 | % status |
|
95 | % status | |
96 | A a |
|
96 | A a | |
97 | A b |
|
97 | A b | |
98 | A sym |
|
98 | A sym | |
99 | % default keyword expansion including commit hook |
|
99 | % default keyword expansion including commit hook | |
100 | % interrupted commit should not change state or run commit hook |
|
100 | % interrupted commit should not change state or run commit hook | |
101 | a |
|
101 | a | |
102 | b |
|
102 | b | |
103 | sym |
|
103 | sym | |
104 | transaction abort! |
|
104 | transaction abort! | |
105 | rollback completed |
|
105 | rollback completed | |
106 | abort: empty commit message |
|
106 | abort: empty commit message | |
107 | % status |
|
107 | % status | |
108 | A a |
|
108 | A a | |
109 | A b |
|
109 | A b | |
110 | A sym |
|
110 | A sym | |
111 | % commit |
|
111 | % commit | |
112 | a |
|
112 | a | |
113 | b |
|
113 | b | |
114 | sym |
|
114 | sym | |
115 | overwriting a expanding keywords |
|
115 | overwriting a expanding keywords | |
116 | running hook commit.test: cp a hooktest |
|
116 | running hook commit.test: cp a hooktest | |
117 | % status |
|
117 | % status | |
118 | ? hooktest |
|
118 | ? hooktest | |
119 | % identify |
|
119 | % identify | |
120 | f782df5f9602 |
|
120 | f782df5f9602 | |
121 | % cat |
|
121 | % cat | |
122 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ |
|
122 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
123 | do not process $Id: |
|
123 | do not process $Id: | |
124 | xxx $ |
|
124 | xxx $ | |
125 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ |
|
125 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
126 | do not process $Id: |
|
126 | do not process $Id: | |
127 | xxx $ |
|
127 | xxx $ | |
128 | ignore $Id$ |
|
128 | ignore $Id$ | |
129 | % hg cat |
|
129 | % hg cat | |
130 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ |
|
130 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
131 | do not process $Id: |
|
131 | do not process $Id: | |
132 | xxx $ |
|
132 | xxx $ | |
133 | ignore $Id$ |
|
133 | ignore $Id$ | |
134 | a |
|
134 | a | |
135 | % diff a hooktest |
|
135 | % diff a hooktest | |
136 | % removing commit hook from config |
|
136 | % removing commit hook from config | |
137 | % touch |
|
137 | % touch | |
138 | % status |
|
138 | % status | |
139 | % update |
|
139 | % update | |
140 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
140 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
141 | % cat |
|
141 | % cat | |
142 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ |
|
142 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
143 | do not process $Id: |
|
143 | do not process $Id: | |
144 | xxx $ |
|
144 | xxx $ | |
145 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ |
|
145 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
146 | do not process $Id: |
|
146 | do not process $Id: | |
147 | xxx $ |
|
147 | xxx $ | |
148 | ignore $Id$ |
|
148 | ignore $Id$ | |
|
149 | % check whether expansion is filewise | |||
|
150 | % commit c | |||
|
151 | adding c | |||
|
152 | % force expansion | |||
|
153 | overwriting a expanding keywords | |||
|
154 | overwriting c expanding keywords | |||
|
155 | % compare changenodes in a c | |||
|
156 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |||
|
157 | do not process $Id: | |||
|
158 | xxx $ | |||
|
159 | $Id: c,v ba4426d1938e 1970/01/01 00:00:01 user $ | |||
|
160 | tests for different changenodes | |||
|
161 | % rollback and remove c | |||
|
162 | rolling back last transaction | |||
149 | % copy |
|
163 | % copy | |
150 | % kwfiles added |
|
164 | % kwfiles added | |
151 | a |
|
165 | a | |
152 | c |
|
166 | c | |
153 | % commit |
|
167 | % commit | |
154 | c |
|
168 | c | |
155 | c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 |
|
169 | c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 | |
156 | overwriting c expanding keywords |
|
170 | overwriting c expanding keywords | |
157 | % cat a c |
|
171 | % cat a c | |
158 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ |
|
172 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
159 | do not process $Id: |
|
173 | do not process $Id: | |
160 | xxx $ |
|
174 | xxx $ | |
161 | expand $Id: c,v 0ba462c0f077 1970/01/01 00:00:01 user $ |
|
175 | expand $Id: c,v 0ba462c0f077 1970/01/01 00:00:01 user $ | |
162 | do not process $Id: |
|
176 | do not process $Id: | |
163 | xxx $ |
|
177 | xxx $ | |
164 | % touch copied c after 1 second |
|
178 | % touch copied c after 1 second | |
165 | % status |
|
179 | % status | |
166 | % kwfiles |
|
180 | % kwfiles | |
167 | a |
|
181 | a | |
168 | c |
|
182 | c | |
169 | % diff --rev |
|
183 | % diff --rev | |
170 | diff -r f782df5f9602 c |
|
184 | diff -r f782df5f9602 c | |
171 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
185 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
172 | @@ -0,0 +1,3 @@ |
|
186 | @@ -0,0 +1,3 @@ | |
173 | +expand $Id: c,v 0ba462c0f077 1970/01/01 00:00:01 user $ |
|
187 | +expand $Id: c,v 0ba462c0f077 1970/01/01 00:00:01 user $ | |
174 | +do not process $Id: |
|
188 | +do not process $Id: | |
175 | +xxx $ |
|
189 | +xxx $ | |
176 | % rollback |
|
190 | % rollback | |
177 | rolling back last transaction |
|
191 | rolling back last transaction | |
178 | % status |
|
192 | % status | |
179 | A c |
|
193 | A c | |
180 | % update -C |
|
194 | % update -C | |
181 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
195 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
182 | % custom keyword expansion |
|
196 | % custom keyword expansion | |
183 | % try with kwdemo |
|
197 | % try with kwdemo | |
184 | [extensions] |
|
198 | [extensions] | |
185 | hgext.keyword = |
|
199 | hgext.keyword = | |
186 | [keyword] |
|
200 | [keyword] | |
187 | * = |
|
201 | * = | |
188 | b = ignore |
|
202 | b = ignore | |
189 | demo.txt = |
|
203 | demo.txt = | |
190 | [keywordmaps] |
|
204 | [keywordmaps] | |
191 | Xinfo = {author}: {desc} |
|
205 | Xinfo = {author}: {desc} | |
192 | $Xinfo: test: hg keyword config and expansion example $ |
|
206 | $Xinfo: test: hg keyword config and expansion example $ | |
193 | % cat |
|
207 | % cat | |
194 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ |
|
208 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
195 | do not process $Id: |
|
209 | do not process $Id: | |
196 | xxx $ |
|
210 | xxx $ | |
197 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ |
|
211 | expand $Id: a,v f782df5f9602 1970/01/01 00:00:00 user $ | |
198 | do not process $Id: |
|
212 | do not process $Id: | |
199 | xxx $ |
|
213 | xxx $ | |
200 | ignore $Id$ |
|
214 | ignore $Id$ | |
201 | % hg cat |
|
215 | % hg cat | |
202 | expand $Id: a f782df5f9602 Thu, 01 Jan 1970 00:00:00 +0000 user $ |
|
216 | expand $Id: a f782df5f9602 Thu, 01 Jan 1970 00:00:00 +0000 user $ | |
203 | do not process $Id: |
|
217 | do not process $Id: | |
204 | xxx $ |
|
218 | xxx $ | |
205 | ignore $Id$ |
|
219 | ignore $Id$ | |
206 | a |
|
220 | a | |
207 | % interrupted commit should not change state |
|
221 | % interrupted commit should not change state | |
208 | transaction abort! |
|
222 | transaction abort! | |
209 | rollback completed |
|
223 | rollback completed | |
210 | abort: empty commit message |
|
224 | abort: empty commit message | |
211 | % status |
|
225 | % status | |
212 | M a |
|
226 | M a | |
213 | ? log |
|
227 | ? log | |
214 | % commit |
|
228 | % commit | |
215 | a |
|
229 | a | |
216 | overwriting a expanding keywords |
|
230 | overwriting a expanding keywords | |
217 | % status |
|
231 | % status | |
218 | % cat |
|
232 | % cat | |
219 | expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
233 | expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
220 | do not process $Id: |
|
234 | do not process $Id: | |
221 | xxx $ |
|
235 | xxx $ | |
222 | $Xinfo: User Name <user@example.com>: firstline $ |
|
236 | $Xinfo: User Name <user@example.com>: firstline $ | |
223 | expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
237 | expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
224 | do not process $Id: |
|
238 | do not process $Id: | |
225 | xxx $ |
|
239 | xxx $ | |
226 | $Xinfo: User Name <user@example.com>: firstline $ |
|
240 | $Xinfo: User Name <user@example.com>: firstline $ | |
227 | ignore $Id$ |
|
241 | ignore $Id$ | |
228 | % hg cat |
|
242 | % hg cat | |
229 | expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
243 | expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
230 | do not process $Id: |
|
244 | do not process $Id: | |
231 | xxx $ |
|
245 | xxx $ | |
232 | $Xinfo: User Name <user@example.com>: firstline $ |
|
246 | $Xinfo: User Name <user@example.com>: firstline $ | |
233 | ignore $Id$ |
|
247 | ignore $Id$ | |
234 | a |
|
248 | a | |
235 | % remove |
|
249 | % remove | |
236 | % status |
|
250 | % status | |
237 | % rollback |
|
251 | % rollback | |
238 | rolling back last transaction |
|
252 | rolling back last transaction | |
239 | % status |
|
253 | % status | |
240 | R a |
|
254 | R a | |
241 | % revert a |
|
255 | % revert a | |
242 | % cat a |
|
256 | % cat a | |
243 | expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
257 | expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
244 | do not process $Id: |
|
258 | do not process $Id: | |
245 | xxx $ |
|
259 | xxx $ | |
246 | $Xinfo: User Name <user@example.com>: firstline $ |
|
260 | $Xinfo: User Name <user@example.com>: firstline $ | |
247 | % clone to test incoming |
|
261 | % clone to test incoming | |
248 | requesting all changes |
|
262 | requesting all changes | |
249 | adding changesets |
|
263 | adding changesets | |
250 | adding manifests |
|
264 | adding manifests | |
251 | adding file changes |
|
265 | adding file changes | |
252 | added 1 changesets with 3 changes to 3 files |
|
266 | added 1 changesets with 3 changes to 3 files | |
253 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
267 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
254 | % incoming |
|
268 | % incoming | |
255 | comparing with test-keyword/Test-a/../Test |
|
269 | comparing with test-keyword/Test-a/../Test | |
256 | searching for changes |
|
270 | searching for changes | |
257 | changeset: 1:0729690beff6 |
|
271 | changeset: 1:0729690beff6 | |
258 | tag: tip |
|
272 | tag: tip | |
259 | user: User Name <user@example.com> |
|
273 | user: User Name <user@example.com> | |
260 | date: Thu Jan 01 00:00:02 1970 +0000 |
|
274 | date: Thu Jan 01 00:00:02 1970 +0000 | |
261 | summary: firstline |
|
275 | summary: firstline | |
262 |
|
276 | |||
263 | % commit rejecttest |
|
277 | % commit rejecttest | |
264 | a |
|
278 | a | |
265 | overwriting a expanding keywords |
|
279 | overwriting a expanding keywords | |
266 | % export |
|
280 | % export | |
267 | % import |
|
281 | % import | |
268 | applying ../rejecttest.diff |
|
282 | applying ../rejecttest.diff | |
269 | % cat |
|
283 | % cat | |
270 | expand $Id: a 82983f13f138 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest |
|
284 | expand $Id: a 82983f13f138 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest | |
271 | do not process $Id: rejecttest |
|
285 | do not process $Id: rejecttest | |
272 | xxx $ |
|
286 | xxx $ | |
273 | $Xinfo: User Name <user@example.com>: rejects? $ |
|
287 | $Xinfo: User Name <user@example.com>: rejects? $ | |
274 | expand $Id: a 82983f13f138 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest |
|
288 | expand $Id: a 82983f13f138 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest | |
275 | do not process $Id: rejecttest |
|
289 | do not process $Id: rejecttest | |
276 | xxx $ |
|
290 | xxx $ | |
277 | $Xinfo: User Name <user@example.com>: rejects? $ |
|
291 | $Xinfo: User Name <user@example.com>: rejects? $ | |
278 | ignore $Id$ |
|
292 | ignore $Id$ | |
279 |
|
293 | |||
280 | % rollback |
|
294 | % rollback | |
281 | rolling back last transaction |
|
295 | rolling back last transaction | |
282 | % clean update |
|
296 | % clean update | |
283 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
297 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
284 | % kwexpand/kwshrink on selected files |
|
298 | % kwexpand/kwshrink on selected files | |
285 | % copy a x/a |
|
299 | % copy a x/a | |
286 | % kwexpand a |
|
300 | % kwexpand a | |
287 | overwriting a expanding keywords |
|
301 | overwriting a expanding keywords | |
288 | % kwexpand x/a should abort |
|
302 | % kwexpand x/a should abort | |
289 | abort: outstanding uncommitted changes in given files |
|
303 | abort: outstanding uncommitted changes in given files | |
290 | x/a |
|
304 | x/a | |
291 | x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e |
|
305 | x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e | |
292 | overwriting x/a expanding keywords |
|
306 | overwriting x/a expanding keywords | |
293 | % cat a |
|
307 | % cat a | |
294 | expand $Id: x/a f27c134d2d9b Thu, 01 Jan 1970 00:00:03 +0000 user $ |
|
308 | expand $Id: x/a f27c134d2d9b Thu, 01 Jan 1970 00:00:03 +0000 user $ | |
295 | do not process $Id: |
|
309 | do not process $Id: | |
296 | xxx $ |
|
310 | xxx $ | |
297 | $Xinfo: User Name <user@example.com>: xa $ |
|
311 | $Xinfo: User Name <user@example.com>: xa $ | |
298 | % kwshrink a inside directory x |
|
312 | % kwshrink a inside directory x | |
299 | overwriting x/a shrinking keywords |
|
313 | overwriting x/a shrinking keywords | |
300 | % cat a |
|
314 | % cat a | |
301 | expand $Id$ |
|
315 | expand $Id$ | |
302 | do not process $Id: |
|
316 | do not process $Id: | |
303 | xxx $ |
|
317 | xxx $ | |
304 | $Xinfo$ |
|
318 | $Xinfo$ | |
305 | % kwexpand nonexistent |
|
319 | % kwexpand nonexistent | |
306 | nonexistent: No such file or directory |
|
320 | nonexistent: No such file or directory | |
307 | % switch off expansion |
|
321 | % switch off expansion | |
308 | % kwshrink with unknown file u |
|
322 | % kwshrink with unknown file u | |
309 | overwriting a shrinking keywords |
|
323 | overwriting a shrinking keywords | |
310 | overwriting x/a shrinking keywords |
|
324 | overwriting x/a shrinking keywords | |
311 | % cat |
|
325 | % cat | |
312 | expand $Id$ |
|
326 | expand $Id$ | |
313 | do not process $Id: |
|
327 | do not process $Id: | |
314 | xxx $ |
|
328 | xxx $ | |
315 | $Xinfo$ |
|
329 | $Xinfo$ | |
316 | expand $Id$ |
|
330 | expand $Id$ | |
317 | do not process $Id: |
|
331 | do not process $Id: | |
318 | xxx $ |
|
332 | xxx $ | |
319 | $Xinfo$ |
|
333 | $Xinfo$ | |
320 | ignore $Id$ |
|
334 | ignore $Id$ | |
321 | % hg cat |
|
335 | % hg cat | |
322 | expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
|
336 | expand $Id: a 0729690beff6 Thu, 01 Jan 1970 00:00:02 +0000 user $ | |
323 | do not process $Id: |
|
337 | do not process $Id: | |
324 | xxx $ |
|
338 | xxx $ | |
325 | $Xinfo: User Name <user@example.com>: firstline $ |
|
339 | $Xinfo: User Name <user@example.com>: firstline $ | |
326 | ignore $Id$ |
|
340 | ignore $Id$ | |
327 | a |
|
341 | a | |
328 | % cat |
|
342 | % cat | |
329 | expand $Id$ |
|
343 | expand $Id$ | |
330 | do not process $Id: |
|
344 | do not process $Id: | |
331 | xxx $ |
|
345 | xxx $ | |
332 | $Xinfo$ |
|
346 | $Xinfo$ | |
333 | expand $Id$ |
|
347 | expand $Id$ | |
334 | do not process $Id: |
|
348 | do not process $Id: | |
335 | xxx $ |
|
349 | xxx $ | |
336 | $Xinfo$ |
|
350 | $Xinfo$ | |
337 | ignore $Id$ |
|
351 | ignore $Id$ | |
338 | % hg cat |
|
352 | % hg cat | |
339 | expand $Id$ |
|
353 | expand $Id$ | |
340 | do not process $Id: |
|
354 | do not process $Id: | |
341 | xxx $ |
|
355 | xxx $ | |
342 | $Xinfo$ |
|
356 | $Xinfo$ | |
343 | ignore $Id$ |
|
357 | ignore $Id$ | |
344 | a |
|
358 | a |
General Comments 0
You need to be logged in to leave comments.
Login now