| 1 |
Run kwdemo outside a repo |
| 2 |
$ hg -q --config extensions.keyword= --config keywordmaps.Foo="{author|user}" kwdemo |
| 3 |
[extensions] |
| 4 |
keyword = |
| 5 |
[keyword] |
| 6 |
demo.txt = |
| 7 |
[keywordset] |
| 8 |
svn = False |
| 9 |
[keywordmaps] |
| 10 |
Foo = {author|user} |
| 11 |
$Foo: test $ |
| 12 |
|
| 13 |
$ cat <<EOF >> $HGRCPATH |
| 14 |
> [extensions] |
| 15 |
> keyword = |
| 16 |
> mq = |
| 17 |
> notify = |
| 18 |
> record = |
| 19 |
> transplant = |
| 20 |
> [ui] |
| 21 |
> interactive = true |
| 22 |
> EOF |
| 23 |
|
| 24 |
hide outer repo |
| 25 |
$ hg init |
| 26 |
|
| 27 |
Run kwdemo before [keyword] files are set up |
| 28 |
as it would succeed without uisetup otherwise |
| 29 |
|
| 30 |
$ hg --quiet kwdemo |
| 31 |
[extensions] |
| 32 |
keyword = |
| 33 |
[keyword] |
| 34 |
demo.txt = |
| 35 |
[keywordset] |
| 36 |
svn = False |
| 37 |
[keywordmaps] |
| 38 |
Author = {author|user} |
| 39 |
Date = {date|utcdate} |
| 40 |
Header = {root}/{file},v {node|short} {date|utcdate} {author|user} |
| 41 |
Id = {file|basename},v {node|short} {date|utcdate} {author|user} |
| 42 |
RCSFile = {file|basename},v |
| 43 |
RCSfile = {file|basename},v |
| 44 |
Revision = {node|short} |
| 45 |
Source = {root}/{file},v |
| 46 |
$Author: test $ |
| 47 |
$Date: ????/??/?? ??:??:?? $ (glob) |
| 48 |
$Header: */demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) |
| 49 |
$Id: demo.txt,v ???????????? ????/??/?? ??:??:?? test $ (glob) |
| 50 |
$RCSFile: demo.txt,v $ |
| 51 |
$RCSfile: demo.txt,v $ |
| 52 |
$Revision: ???????????? $ (glob) |
| 53 |
$Source: */demo.txt,v $ (glob) |
| 54 |
|
| 55 |
$ hg --quiet kwdemo "Branch = {branches}" |
| 56 |
[extensions] |
| 57 |
keyword = |
| 58 |
[keyword] |
| 59 |
demo.txt = |
| 60 |
[keywordset] |
| 61 |
svn = False |
| 62 |
[keywordmaps] |
| 63 |
Branch = {branches} |
| 64 |
$Branch: demobranch $ |
| 65 |
|
| 66 |
(test template filter svnisodate and svnutcdate) |
| 67 |
|
| 68 |
$ hg --quiet kwdemo --config keywordset.svn=True |
| 69 |
[extensions] |
| 70 |
keyword = |
| 71 |
[keyword] |
| 72 |
demo.txt = |
| 73 |
[keywordset] |
| 74 |
svn = True |
| 75 |
[keywordmaps] |
| 76 |
Author = {author|user} |
| 77 |
Date = {date|svnisodate} |
| 78 |
Id = {file|basename},v {node|short} {date|svnutcdate} {author|user} |
| 79 |
LastChangedBy = {author|user} |
| 80 |
LastChangedDate = {date|svnisodate} |
| 81 |
LastChangedRevision = {node|short} |
| 82 |
Revision = {node|short} |
| 83 |
$Author: test $ |
| 84 |
$Date: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob) |
| 85 |
$Id: demo.txt,v ???????????? ????-??-?? ??:??:??Z test $ (glob) |
| 86 |
$LastChangedBy: test $ |
| 87 |
$LastChangedDate: ????-??-?? ??:??:?? ????? (???, ?? ??? ????) $ (glob) |
| 88 |
$LastChangedRevision: ???????????? $ (glob) |
| 89 |
$Revision: ???????????? $ (glob) |
| 90 |
|
| 91 |
$ cat <<EOF >> $HGRCPATH |
| 92 |
> [keyword] |
| 93 |
> ** = |
| 94 |
> b = ignore |
| 95 |
> i = ignore |
| 96 |
> [hooks] |
| 97 |
> EOF |
| 98 |
$ cp $HGRCPATH $HGRCPATH.nohooks |
| 99 |
> cat <<EOF >> $HGRCPATH |
| 100 |
> commit= |
| 101 |
> commit.test=cp a hooktest |
| 102 |
> EOF |
| 103 |
|
| 104 |
$ hg init Test-bndl |
| 105 |
$ cd Test-bndl |
| 106 |
|
| 107 |
kwshrink should exit silently in empty/invalid repo |
| 108 |
|
| 109 |
$ hg kwshrink |
| 110 |
|
| 111 |
Symlinks cannot be created on Windows. |
| 112 |
A bundle to test this was made with: |
| 113 |
hg init t |
| 114 |
cd t |
| 115 |
echo a > a |
| 116 |
ln -s a sym |
| 117 |
hg add sym |
| 118 |
hg ci -m addsym -u mercurial |
| 119 |
hg bundle --base null ../test-keyword.hg |
| 120 |
|
| 121 |
$ hg unbundle "$TESTDIR"/bundles/test-keyword.hg |
| 122 |
adding changesets |
| 123 |
adding manifests |
| 124 |
adding file changes |
| 125 |
added 1 changesets with 1 changes to 1 files |
| 126 |
new changesets a2392c293916 (1 drafts) |
| 127 |
(run 'hg update' to get a working copy) |
| 128 |
$ hg up a2392c293916 |
| 129 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 130 |
|
| 131 |
$ echo 'expand $Id$' > a |
| 132 |
$ echo 'do not process $Id:' >> a |
| 133 |
$ echo 'xxx $' >> a |
| 134 |
$ echo 'ignore $Id$' > b |
| 135 |
|
| 136 |
Output files as they were created |
| 137 |
|
| 138 |
$ cat a b |
| 139 |
expand $Id$ |
| 140 |
do not process $Id: |
| 141 |
xxx $ |
| 142 |
ignore $Id$ |
| 143 |
|
| 144 |
no kwfiles |
| 145 |
|
| 146 |
$ hg kwfiles |
| 147 |
|
| 148 |
untracked candidates |
| 149 |
|
| 150 |
$ hg -v kwfiles --unknown |
| 151 |
k a |
| 152 |
|
| 153 |
Add files and check status |
| 154 |
|
| 155 |
$ hg addremove |
| 156 |
adding a |
| 157 |
adding b |
| 158 |
$ hg status |
| 159 |
A a |
| 160 |
A b |
| 161 |
|
| 162 |
|
| 163 |
Default keyword expansion including commit hook |
| 164 |
Interrupted commit should not change state or run commit hook |
| 165 |
|
| 166 |
$ hg --debug commit |
| 167 |
abort: empty commit message |
| 168 |
[10] |
| 169 |
$ hg status |
| 170 |
A a |
| 171 |
A b |
| 172 |
|
| 173 |
Commit with several checks |
| 174 |
|
| 175 |
$ hg --debug commit -mabsym -u 'User Name <[email protected]>' |
| 176 |
committing files: |
| 177 |
a |
| 178 |
b |
| 179 |
committing manifest |
| 180 |
committing changelog |
| 181 |
overwriting a expanding keywords |
| 182 |
updating the branch cache |
| 183 |
committed changeset 1:ef63ca68695bc9495032c6fda1350c71e6d256e9 |
| 184 |
running hook commit.test: cp a hooktest |
| 185 |
$ hg status |
| 186 |
? hooktest |
| 187 |
$ hg debugrebuildstate |
| 188 |
$ hg --quiet identify |
| 189 |
ef63ca68695b |
| 190 |
|
| 191 |
cat files in working directory with keywords expanded |
| 192 |
|
| 193 |
$ cat a b |
| 194 |
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
| 195 |
do not process $Id: |
| 196 |
xxx $ |
| 197 |
ignore $Id$ |
| 198 |
|
| 199 |
hg cat files and symlink, no expansion |
| 200 |
|
| 201 |
$ hg cat sym a b && echo |
| 202 |
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
| 203 |
do not process $Id: |
| 204 |
xxx $ |
| 205 |
ignore $Id$ |
| 206 |
a |
| 207 |
|
| 208 |
$ diff a hooktest |
| 209 |
|
| 210 |
$ cp $HGRCPATH.nohooks $HGRCPATH |
| 211 |
$ rm hooktest |
| 212 |
|
| 213 |
hg status of kw-ignored binary file starting with '\1\n' |
| 214 |
|
| 215 |
>>> open("i", "wb").write(b"\1\nfoo") and None |
| 216 |
$ hg -q commit -Am metasep i |
| 217 |
$ hg status |
| 218 |
>>> open("i", "wb").write(b"\1\nbar") and None |
| 219 |
$ hg status |
| 220 |
M i |
| 221 |
$ hg -q commit -m "modify metasep" i |
| 222 |
$ hg status --rev 2:3 |
| 223 |
M i |
| 224 |
$ touch empty |
| 225 |
$ hg -q commit -A -m "another file" |
| 226 |
$ hg status -A --rev 3:4 i |
| 227 |
C i |
| 228 |
|
| 229 |
$ hg -q strip --no-backup 2 |
| 230 |
|
| 231 |
Test hook execution |
| 232 |
|
| 233 |
bundle |
| 234 |
|
| 235 |
$ hg bundle --base null ../kw.hg |
| 236 |
2 changesets found |
| 237 |
$ cd .. |
| 238 |
$ hg init Test |
| 239 |
$ cd Test |
| 240 |
|
| 241 |
Notify on pull to check whether keywords stay as is in email |
| 242 |
ie. if patch.diff wrapper acts as it should |
| 243 |
|
| 244 |
$ cat <<EOF >> $HGRCPATH |
| 245 |
> [hooks] |
| 246 |
> incoming.notify = python:hgext.notify.hook |
| 247 |
> [notify] |
| 248 |
> sources = pull |
| 249 |
> diffstat = False |
| 250 |
> maxsubject = 15 |
| 251 |
> [reposubs] |
| 252 |
> * = Test |
| 253 |
> EOF |
| 254 |
|
| 255 |
Pull from bundle and trigger notify |
| 256 |
|
| 257 |
$ hg pull -u ../kw.hg | \ |
| 258 |
> "$PYTHON" $TESTDIR/unwrap-message-id.py |
| 259 |
pulling from ../kw.hg |
| 260 |
requesting all changes |
| 261 |
adding changesets |
| 262 |
adding manifests |
| 263 |
adding file changes |
| 264 |
added 2 changesets with 3 changes to 3 files |
| 265 |
new changesets a2392c293916:ef63ca68695b (2 drafts) |
| 266 |
3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 267 |
MIME-Version: 1.0 |
| 268 |
Content-Type: text/plain; charset="us-ascii" |
| 269 |
Content-Transfer-Encoding: 7bit |
| 270 |
Date: * (glob) |
| 271 |
Subject: changeset in... |
| 272 |
From: mercurial |
| 273 |
X-Hg-Notification: changeset a2392c293916 |
| 274 |
Message-Id: <hg.a2392c293916*> (glob) |
| 275 |
To: Test |
| 276 |
|
| 277 |
changeset a2392c293916 in $TESTTMP/Test |
| 278 |
details: $TESTTMP/Test?cmd=changeset;node=a2392c293916 |
| 279 |
description: |
| 280 |
addsym |
| 281 |
|
| 282 |
diffs (6 lines): |
| 283 |
|
| 284 |
diff -r 000000000000 -r a2392c293916 sym |
| 285 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
| 286 |
+++ b/sym Sat Feb 09 20:25:47 2008 +0100 |
| 287 |
@@ -0,0 +1,1 @@ |
| 288 |
+a |
| 289 |
\ No newline at end of file |
| 290 |
MIME-Version: 1.0 |
| 291 |
Content-Type: text/plain; charset="us-ascii" |
| 292 |
Content-Transfer-Encoding: 7bit |
| 293 |
Date:* (glob) |
| 294 |
Subject: changeset in... |
| 295 |
From: User Name <[email protected]> |
| 296 |
X-Hg-Notification: changeset ef63ca68695b |
| 297 |
Message-Id: <hg.ef63ca68695b*> (glob) |
| 298 |
To: Test |
| 299 |
|
| 300 |
changeset ef63ca68695b in $TESTTMP/Test |
| 301 |
details: $TESTTMP/Test?cmd=changeset;node=ef63ca68695b |
| 302 |
description: |
| 303 |
absym |
| 304 |
|
| 305 |
diffs (12 lines): |
| 306 |
|
| 307 |
diff -r a2392c293916 -r ef63ca68695b a |
| 308 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
| 309 |
+++ b/a Thu Jan 01 00:00:00 1970 +0000 |
| 310 |
@@ -0,0 +1,3 @@ |
| 311 |
+expand $Id$ |
| 312 |
+do not process $Id: |
| 313 |
+xxx $ |
| 314 |
diff -r a2392c293916 -r ef63ca68695b b |
| 315 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
| 316 |
+++ b/b Thu Jan 01 00:00:00 1970 +0000 |
| 317 |
@@ -0,0 +1,1 @@ |
| 318 |
+ignore $Id$ |
| 319 |
|
| 320 |
$ cp $HGRCPATH.nohooks $HGRCPATH |
| 321 |
|
| 322 |
Touch files and check with status |
| 323 |
|
| 324 |
$ touch a b |
| 325 |
$ hg status |
| 326 |
|
| 327 |
Update and expand |
| 328 |
|
| 329 |
$ rm sym a b |
| 330 |
$ hg update -C |
| 331 |
3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 332 |
$ cat a b |
| 333 |
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
| 334 |
do not process $Id: |
| 335 |
xxx $ |
| 336 |
ignore $Id$ |
| 337 |
|
| 338 |
Check whether expansion is filewise and file mode is preserved |
| 339 |
|
| 340 |
$ echo '$Id$' > c |
| 341 |
$ echo 'tests for different changenodes' >> c |
| 342 |
#if unix-permissions |
| 343 |
$ chmod 600 c |
| 344 |
$ ls -l c | cut -b 1-10 |
| 345 |
-rw------- |
| 346 |
#endif |
| 347 |
|
| 348 |
commit file c |
| 349 |
|
| 350 |
$ hg commit -A -mcndiff -d '1 0' -u 'User Name <[email protected]>' |
| 351 |
adding c |
| 352 |
#if unix-permissions |
| 353 |
$ ls -l c | cut -b 1-10 |
| 354 |
-rw------- |
| 355 |
#endif |
| 356 |
|
| 357 |
force expansion |
| 358 |
|
| 359 |
$ hg -v kwexpand |
| 360 |
overwriting a expanding keywords |
| 361 |
overwriting c expanding keywords |
| 362 |
|
| 363 |
compare changenodes in a and c |
| 364 |
|
| 365 |
$ cat a c |
| 366 |
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
| 367 |
do not process $Id: |
| 368 |
xxx $ |
| 369 |
$Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
| 370 |
tests for different changenodes |
| 371 |
|
| 372 |
record |
| 373 |
|
| 374 |
$ echo '$Id$' > r |
| 375 |
$ hg add r |
| 376 |
|
| 377 |
record chunk |
| 378 |
|
| 379 |
>>> lines = open('a', 'rb').readlines() |
| 380 |
>>> lines.insert(1, b'foo\n') |
| 381 |
>>> lines.append(b'bar\n') |
| 382 |
>>> open('a', 'wb').writelines(lines) |
| 383 |
$ hg record -d '10 1' -m rectest a<<EOF |
| 384 |
> y |
| 385 |
> n |
| 386 |
> EOF |
| 387 |
diff --git a/a b/a |
| 388 |
2 hunks, 2 lines changed |
| 389 |
@@ -1,3 +1,4 @@ |
| 390 |
expand $Id$ |
| 391 |
+foo |
| 392 |
do not process $Id: |
| 393 |
xxx $ |
| 394 |
record change 1/2 to 'a'? |
| 395 |
(enter ? for help) [Ynesfdaq?] y |
| 396 |
|
| 397 |
@@ -2,2 +3,3 @@ |
| 398 |
do not process $Id: |
| 399 |
xxx $ |
| 400 |
+bar |
| 401 |
record change 2/2 to 'a'? |
| 402 |
(enter ? for help) [Ynesfdaq?] n |
| 403 |
|
| 404 |
|
| 405 |
$ hg identify |
| 406 |
5f5eb23505c3+ tip |
| 407 |
$ hg status |
| 408 |
M a |
| 409 |
A r |
| 410 |
|
| 411 |
Cat modified file a |
| 412 |
|
| 413 |
$ cat a |
| 414 |
expand $Id: a,v 5f5eb23505c3 1970/01/01 00:00:10 test $ |
| 415 |
foo |
| 416 |
do not process $Id: |
| 417 |
xxx $ |
| 418 |
bar |
| 419 |
|
| 420 |
Diff remaining chunk |
| 421 |
|
| 422 |
$ hg diff a |
| 423 |
diff -r 5f5eb23505c3 a |
| 424 |
--- a/a Thu Jan 01 00:00:09 1970 -0000 |
| 425 |
+++ b/a * (glob) |
| 426 |
@@ -2,3 +2,4 @@ |
| 427 |
foo |
| 428 |
do not process $Id: |
| 429 |
xxx $ |
| 430 |
+bar |
| 431 |
|
| 432 |
$ hg rollback |
| 433 |
repository tip rolled back to revision 2 (undo commit) |
| 434 |
working directory now based on revision 2 |
| 435 |
|
| 436 |
Record all chunks in file a |
| 437 |
|
| 438 |
$ echo foo > msg |
| 439 |
|
| 440 |
- do not use "hg record -m" here! |
| 441 |
|
| 442 |
$ hg record -l msg -d '11 1' a<<EOF |
| 443 |
> y |
| 444 |
> y |
| 445 |
> y |
| 446 |
> EOF |
| 447 |
diff --git a/a b/a |
| 448 |
2 hunks, 2 lines changed |
| 449 |
@@ -1,3 +1,4 @@ |
| 450 |
expand $Id$ |
| 451 |
+foo |
| 452 |
do not process $Id: |
| 453 |
xxx $ |
| 454 |
record change 1/2 to 'a'? |
| 455 |
(enter ? for help) [Ynesfdaq?] y |
| 456 |
|
| 457 |
@@ -2,2 +3,3 @@ |
| 458 |
do not process $Id: |
| 459 |
xxx $ |
| 460 |
+bar |
| 461 |
record change 2/2 to 'a'? |
| 462 |
(enter ? for help) [Ynesfdaq?] y |
| 463 |
|
| 464 |
|
| 465 |
File a should be clean |
| 466 |
|
| 467 |
$ hg status -A a |
| 468 |
C a |
| 469 |
|
| 470 |
rollback and revert expansion |
| 471 |
|
| 472 |
$ cat a |
| 473 |
expand $Id: a,v 78e0a02d76aa 1970/01/01 00:00:11 test $ |
| 474 |
foo |
| 475 |
do not process $Id: |
| 476 |
xxx $ |
| 477 |
bar |
| 478 |
$ hg --verbose rollback |
| 479 |
repository tip rolled back to revision 2 (undo commit) |
| 480 |
working directory now based on revision 2 |
| 481 |
overwriting a expanding keywords |
| 482 |
$ hg status a |
| 483 |
M a |
| 484 |
$ cat a |
| 485 |
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
| 486 |
foo |
| 487 |
do not process $Id: |
| 488 |
xxx $ |
| 489 |
bar |
| 490 |
$ echo '$Id$' > y |
| 491 |
$ echo '$Id$' > z |
| 492 |
$ hg add y |
| 493 |
$ hg add z |
| 494 |
$ hg commit -m "rollback only" z |
| 495 |
$ cat z |
| 496 |
$Id: z,v 45a5d3adce53 1970/01/01 00:00:00 test $ |
| 497 |
$ hg --verbose rollback |
| 498 |
repository tip rolled back to revision 2 (undo commit) |
| 499 |
working directory now based on revision 2 |
| 500 |
overwriting z shrinking keywords |
| 501 |
|
| 502 |
Only z should be overwritten |
| 503 |
|
| 504 |
$ hg status a y z |
| 505 |
M a |
| 506 |
A y |
| 507 |
A z |
| 508 |
$ cat z |
| 509 |
$Id$ |
| 510 |
$ hg forget y z |
| 511 |
$ rm y z |
| 512 |
|
| 513 |
record added file alone |
| 514 |
|
| 515 |
$ hg -v record -l msg -d '12 2' r<<EOF |
| 516 |
> y |
| 517 |
> y |
| 518 |
> EOF |
| 519 |
diff --git a/r b/r |
| 520 |
new file mode 100644 |
| 521 |
@@ -0,0 +1,1 @@ |
| 522 |
+$Id$ |
| 523 |
record this change to 'r'? |
| 524 |
(enter ? for help) [Ynesfdaq?] y |
| 525 |
|
| 526 |
resolving manifests |
| 527 |
patching file r |
| 528 |
committing files: |
| 529 |
r |
| 530 |
committing manifest |
| 531 |
committing changelog |
| 532 |
committed changeset 3:82a2f715724d |
| 533 |
overwriting r expanding keywords |
| 534 |
$ hg status r |
| 535 |
$ hg --verbose rollback |
| 536 |
repository tip rolled back to revision 2 (undo commit) |
| 537 |
working directory now based on revision 2 |
| 538 |
overwriting r shrinking keywords |
| 539 |
$ hg forget r |
| 540 |
$ rm msg r |
| 541 |
$ hg update -C |
| 542 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 543 |
|
| 544 |
record added keyword ignored file |
| 545 |
|
| 546 |
$ echo '$Id$' > i |
| 547 |
$ hg add i |
| 548 |
$ hg --verbose record -d '13 1' -m recignored<<EOF |
| 549 |
> y |
| 550 |
> y |
| 551 |
> EOF |
| 552 |
diff --git a/i b/i |
| 553 |
new file mode 100644 |
| 554 |
examine changes to 'i'? |
| 555 |
(enter ? for help) [Ynesfdaq?] y |
| 556 |
|
| 557 |
@@ -0,0 +1,1 @@ |
| 558 |
+$Id$ |
| 559 |
record this change to 'i'? |
| 560 |
(enter ? for help) [Ynesfdaq?] y |
| 561 |
|
| 562 |
resolving manifests |
| 563 |
patching file i |
| 564 |
committing files: |
| 565 |
i |
| 566 |
committing manifest |
| 567 |
committing changelog |
| 568 |
committed changeset 3:9f40ceb5a072 |
| 569 |
$ cat i |
| 570 |
$Id$ |
| 571 |
$ hg -q rollback |
| 572 |
$ hg forget i |
| 573 |
$ rm i |
| 574 |
|
| 575 |
amend |
| 576 |
|
| 577 |
$ echo amend >> a |
| 578 |
$ echo amend >> b |
| 579 |
$ hg -q commit -d '14 1' -m 'prepare amend' |
| 580 |
|
| 581 |
$ hg --debug commit --amend -d '15 1' -m 'amend without changes' | grep keywords |
| 582 |
overwriting a expanding keywords |
| 583 |
$ hg -q id |
| 584 |
67d8c481a6be |
| 585 |
$ head -1 a |
| 586 |
expand $Id: a,v 67d8c481a6be 1970/01/01 00:00:15 test $ |
| 587 |
|
| 588 |
$ hg -q strip --no-backup tip |
| 589 |
|
| 590 |
Test patch queue repo |
| 591 |
|
| 592 |
$ hg init --mq |
| 593 |
$ hg qimport -r tip -n mqtest.diff |
| 594 |
$ hg commit --mq -m mqtest |
| 595 |
|
| 596 |
Keywords should not be expanded in patch |
| 597 |
|
| 598 |
$ cat .hg/patches/mqtest.diff |
| 599 |
# HG changeset patch |
| 600 |
# User User Name <[email protected]> |
| 601 |
# Date 1 0 |
| 602 |
# Thu Jan 01 00:00:01 1970 +0000 |
| 603 |
# Node ID 40a904bbbe4cd4ab0a1f28411e35db26341a40ad |
| 604 |
# Parent ef63ca68695bc9495032c6fda1350c71e6d256e9 |
| 605 |
cndiff |
| 606 |
|
| 607 |
diff -r ef63ca68695b -r 40a904bbbe4c c |
| 608 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
| 609 |
+++ b/c Thu Jan 01 00:00:01 1970 +0000 |
| 610 |
@@ -0,0 +1,2 @@ |
| 611 |
+$Id$ |
| 612 |
+tests for different changenodes |
| 613 |
|
| 614 |
$ hg qpop |
| 615 |
popping mqtest.diff |
| 616 |
patch queue now empty |
| 617 |
|
| 618 |
qgoto, implying qpush, should expand |
| 619 |
|
| 620 |
$ hg qgoto mqtest.diff |
| 621 |
applying mqtest.diff |
| 622 |
now at: mqtest.diff |
| 623 |
$ cat c |
| 624 |
$Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
| 625 |
tests for different changenodes |
| 626 |
$ hg cat c |
| 627 |
$Id: c,v 40a904bbbe4c 1970/01/01 00:00:01 user $ |
| 628 |
tests for different changenodes |
| 629 |
|
| 630 |
Keywords should not be expanded in filelog |
| 631 |
|
| 632 |
$ hg --config 'extensions.keyword=!' cat c |
| 633 |
$Id$ |
| 634 |
tests for different changenodes |
| 635 |
|
| 636 |
qpop and move on |
| 637 |
|
| 638 |
$ hg qpop |
| 639 |
popping mqtest.diff |
| 640 |
patch queue now empty |
| 641 |
|
| 642 |
Copy and show added kwfiles |
| 643 |
|
| 644 |
$ hg cp a c |
| 645 |
$ hg kwfiles |
| 646 |
a |
| 647 |
c |
| 648 |
|
| 649 |
Commit and show expansion in original and copy |
| 650 |
|
| 651 |
$ hg --debug commit -ma2c -d '1 0' -u 'User Name <[email protected]>' |
| 652 |
committing files: |
| 653 |
c |
| 654 |
c: copy a:0045e12f6c5791aac80ca6cbfd97709a88307292 |
| 655 |
committing manifest |
| 656 |
committing changelog |
| 657 |
overwriting c expanding keywords |
| 658 |
updating the branch cache |
| 659 |
committed changeset 2:25736cf2f5cbe41f6be4e6784ef6ecf9f3bbcc7d |
| 660 |
$ cat a c |
| 661 |
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
| 662 |
do not process $Id: |
| 663 |
xxx $ |
| 664 |
expand $Id: c,v 25736cf2f5cb 1970/01/01 00:00:01 user $ |
| 665 |
do not process $Id: |
| 666 |
xxx $ |
| 667 |
|
| 668 |
Touch copied c and check its status |
| 669 |
|
| 670 |
$ touch c |
| 671 |
$ hg status |
| 672 |
|
| 673 |
Copy kwfile to keyword ignored file unexpanding keywords |
| 674 |
|
| 675 |
$ hg --verbose copy a i |
| 676 |
copying a to i |
| 677 |
overwriting i shrinking keywords |
| 678 |
$ head -n 1 i |
| 679 |
expand $Id$ |
| 680 |
$ hg forget i |
| 681 |
$ rm i |
| 682 |
|
| 683 |
Copy ignored file to ignored file: no overwriting |
| 684 |
|
| 685 |
$ hg --verbose copy b i |
| 686 |
copying b to i |
| 687 |
$ hg forget i |
| 688 |
$ rm i |
| 689 |
|
| 690 |
cp symlink file; hg cp -A symlink file (part1) |
| 691 |
- copied symlink points to kwfile: overwrite |
| 692 |
|
| 693 |
#if symlink |
| 694 |
$ cp sym i |
| 695 |
$ ls -l i |
| 696 |
-rw-r--r--* (glob) |
| 697 |
$ head -1 i |
| 698 |
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
| 699 |
$ hg copy --after --verbose sym i |
| 700 |
copying sym to i |
| 701 |
overwriting i shrinking keywords |
| 702 |
$ head -1 i |
| 703 |
expand $Id$ |
| 704 |
$ hg forget i |
| 705 |
$ rm i |
| 706 |
#endif |
| 707 |
|
| 708 |
Test different options of hg kwfiles |
| 709 |
|
| 710 |
$ hg kwfiles |
| 711 |
a |
| 712 |
c |
| 713 |
$ hg -v kwfiles --ignore |
| 714 |
I b |
| 715 |
I sym |
| 716 |
$ hg kwfiles --all |
| 717 |
K a |
| 718 |
K c |
| 719 |
I b |
| 720 |
I sym |
| 721 |
|
| 722 |
Diff specific revision |
| 723 |
|
| 724 |
$ hg diff --rev 1 |
| 725 |
diff -r ef63ca68695b c |
| 726 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
| 727 |
+++ b/c * (glob) |
| 728 |
@@ -0,0 +1,3 @@ |
| 729 |
+expand $Id$ |
| 730 |
+do not process $Id: |
| 731 |
+xxx $ |
| 732 |
|
| 733 |
Status after rollback: |
| 734 |
|
| 735 |
$ hg rollback |
| 736 |
repository tip rolled back to revision 1 (undo commit) |
| 737 |
working directory now based on revision 1 |
| 738 |
$ hg status |
| 739 |
A c |
| 740 |
$ hg update --clean |
| 741 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 742 |
|
| 743 |
#if symlink |
| 744 |
|
| 745 |
cp symlink file; hg cp -A symlink file (part2) |
| 746 |
- copied symlink points to kw ignored file: do not overwrite |
| 747 |
|
| 748 |
$ cat a > i |
| 749 |
$ ln -s i symignored |
| 750 |
$ hg commit -Am 'fake expansion in ignored and symlink' i symignored |
| 751 |
$ cp symignored x |
| 752 |
$ hg copy --after --verbose symignored x |
| 753 |
copying symignored to x |
| 754 |
$ head -n 1 x |
| 755 |
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
| 756 |
$ hg forget x |
| 757 |
$ rm x |
| 758 |
|
| 759 |
$ hg rollback |
| 760 |
repository tip rolled back to revision 1 (undo commit) |
| 761 |
working directory now based on revision 1 |
| 762 |
$ hg update --clean |
| 763 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 764 |
$ rm i symignored |
| 765 |
|
| 766 |
#endif |
| 767 |
|
| 768 |
Custom keywordmaps as argument to kwdemo |
| 769 |
|
| 770 |
$ hg --quiet kwdemo "Xinfo = {author}: {desc}" |
| 771 |
[extensions] |
| 772 |
keyword = |
| 773 |
[keyword] |
| 774 |
** = |
| 775 |
b = ignore |
| 776 |
demo.txt = |
| 777 |
i = ignore |
| 778 |
[keywordset] |
| 779 |
svn = False |
| 780 |
[keywordmaps] |
| 781 |
Xinfo = {author}: {desc} |
| 782 |
$Xinfo: test: hg keyword configuration and expansion example $ |
| 783 |
|
| 784 |
Configure custom keywordmaps |
| 785 |
|
| 786 |
$ cat <<EOF >>$HGRCPATH |
| 787 |
> [keywordmaps] |
| 788 |
> Id = {file} {node|short} {date|rfc822date} {author|user} |
| 789 |
> Xinfo = {author}: {desc} |
| 790 |
> EOF |
| 791 |
|
| 792 |
Cat and hg cat files before custom expansion |
| 793 |
|
| 794 |
$ cat a b |
| 795 |
expand $Id: a,v ef63ca68695b 1970/01/01 00:00:00 user $ |
| 796 |
do not process $Id: |
| 797 |
xxx $ |
| 798 |
ignore $Id$ |
| 799 |
$ hg cat sym a b && echo |
| 800 |
expand $Id: a ef63ca68695b Thu, 01 Jan 1970 00:00:00 +0000 user $ |
| 801 |
do not process $Id: |
| 802 |
xxx $ |
| 803 |
ignore $Id$ |
| 804 |
a |
| 805 |
|
| 806 |
Write custom keyword and prepare multi-line commit message |
| 807 |
|
| 808 |
$ echo '$Xinfo$' >> a |
| 809 |
$ cat <<EOF >> log |
| 810 |
> firstline |
| 811 |
> secondline |
| 812 |
> EOF |
| 813 |
|
| 814 |
Interrupted commit should not change state |
| 815 |
|
| 816 |
$ hg commit |
| 817 |
abort: empty commit message |
| 818 |
[10] |
| 819 |
$ hg status |
| 820 |
M a |
| 821 |
? c |
| 822 |
? log |
| 823 |
|
| 824 |
Commit with multi-line message and custom expansion |
| 825 |
|
| 826 |
$ hg --debug commit -l log -d '2 0' -u 'User Name <[email protected]>' |
| 827 |
committing files: |
| 828 |
a |
| 829 |
committing manifest |
| 830 |
committing changelog |
| 831 |
overwriting a expanding keywords |
| 832 |
updating the branch cache |
| 833 |
committed changeset 2:bb948857c743469b22bbf51f7ec8112279ca5d83 |
| 834 |
$ rm log |
| 835 |
|
| 836 |
Stat, verify and show custom expansion (firstline) |
| 837 |
|
| 838 |
$ hg status |
| 839 |
? c |
| 840 |
$ hg verify -q |
| 841 |
$ cat a b |
| 842 |
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
| 843 |
do not process $Id: |
| 844 |
xxx $ |
| 845 |
$Xinfo: User Name <[email protected]>: firstline $ |
| 846 |
ignore $Id$ |
| 847 |
$ hg cat sym a b && echo |
| 848 |
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
| 849 |
do not process $Id: |
| 850 |
xxx $ |
| 851 |
$Xinfo: User Name <[email protected]>: firstline $ |
| 852 |
ignore $Id$ |
| 853 |
a |
| 854 |
|
| 855 |
annotate |
| 856 |
|
| 857 |
$ hg annotate a |
| 858 |
1: expand $Id$ |
| 859 |
1: do not process $Id: |
| 860 |
1: xxx $ |
| 861 |
2: $Xinfo$ |
| 862 |
|
| 863 |
remove with status checks |
| 864 |
|
| 865 |
$ hg debugrebuildstate |
| 866 |
$ hg remove a |
| 867 |
$ hg --debug commit -m rma |
| 868 |
committing files: |
| 869 |
committing manifest |
| 870 |
committing changelog |
| 871 |
updating the branch cache |
| 872 |
committed changeset 3:d14c712653769de926994cf7fbb06c8fbd68f012 |
| 873 |
$ hg status |
| 874 |
? c |
| 875 |
|
| 876 |
Rollback, revert, and check expansion |
| 877 |
|
| 878 |
$ hg rollback |
| 879 |
repository tip rolled back to revision 2 (undo commit) |
| 880 |
working directory now based on revision 2 |
| 881 |
$ hg status |
| 882 |
R a |
| 883 |
? c |
| 884 |
$ hg revert --no-backup --rev tip a |
| 885 |
$ cat a |
| 886 |
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
| 887 |
do not process $Id: |
| 888 |
xxx $ |
| 889 |
$Xinfo: User Name <[email protected]>: firstline $ |
| 890 |
|
| 891 |
Clone to test global and local configurations |
| 892 |
|
| 893 |
$ cd .. |
| 894 |
|
| 895 |
Expansion in destination with global configuration |
| 896 |
|
| 897 |
$ hg --quiet clone Test globalconf |
| 898 |
$ cat globalconf/a |
| 899 |
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
| 900 |
do not process $Id: |
| 901 |
xxx $ |
| 902 |
$Xinfo: User Name <[email protected]>: firstline $ |
| 903 |
|
| 904 |
No expansion in destination with local configuration in origin only |
| 905 |
|
| 906 |
$ hg --quiet --config 'keyword.**=ignore' clone Test localconf |
| 907 |
$ cat localconf/a |
| 908 |
expand $Id$ |
| 909 |
do not process $Id: |
| 910 |
xxx $ |
| 911 |
$Xinfo$ |
| 912 |
|
| 913 |
Clone to test incoming |
| 914 |
|
| 915 |
$ hg clone -r1 Test Test-a |
| 916 |
adding changesets |
| 917 |
adding manifests |
| 918 |
adding file changes |
| 919 |
added 2 changesets with 3 changes to 3 files |
| 920 |
new changesets a2392c293916:ef63ca68695b |
| 921 |
updating to branch default |
| 922 |
3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 923 |
$ cd Test-a |
| 924 |
$ cat <<EOF >> .hg/hgrc |
| 925 |
> [paths] |
| 926 |
> default = ../Test |
| 927 |
> EOF |
| 928 |
$ hg incoming |
| 929 |
comparing with $TESTTMP/Test |
| 930 |
searching for changes |
| 931 |
changeset: 2:bb948857c743 |
| 932 |
tag: tip |
| 933 |
user: User Name <[email protected]> |
| 934 |
date: Thu Jan 01 00:00:02 1970 +0000 |
| 935 |
summary: firstline |
| 936 |
|
| 937 |
Imported patch should not be rejected |
| 938 |
|
| 939 |
>>> import re |
| 940 |
>>> text = re.sub(br'(Id.*)', br'\1 rejecttest', open('a', 'rb').read()) |
| 941 |
>>> open('a', 'wb').write(text) and None |
| 942 |
$ hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <[email protected]>' |
| 943 |
committing files: |
| 944 |
a |
| 945 |
committing manifest |
| 946 |
committing changelog |
| 947 |
overwriting a expanding keywords |
| 948 |
updating the branch cache |
| 949 |
committed changeset 2:85e279d709ffc28c9fdd1b868570985fc3d87082 |
| 950 |
$ hg export -o ../rejecttest.diff tip |
| 951 |
$ cd ../Test |
| 952 |
$ hg import ../rejecttest.diff |
| 953 |
applying ../rejecttest.diff |
| 954 |
$ cat a b |
| 955 |
expand $Id: a 4e0994474d25 Thu, 01 Jan 1970 00:00:03 +0000 user $ rejecttest |
| 956 |
do not process $Id: rejecttest |
| 957 |
xxx $ |
| 958 |
$Xinfo: User Name <[email protected]>: rejects? $ |
| 959 |
ignore $Id$ |
| 960 |
|
| 961 |
$ hg rollback |
| 962 |
repository tip rolled back to revision 2 (undo import) |
| 963 |
working directory now based on revision 2 |
| 964 |
$ hg update --clean |
| 965 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 966 |
|
| 967 |
kwexpand/kwshrink on selected files |
| 968 |
|
| 969 |
$ mkdir x |
| 970 |
$ hg copy a x/a |
| 971 |
$ hg --verbose kwshrink a |
| 972 |
overwriting a shrinking keywords |
| 973 |
- sleep required for dirstate.normal() check |
| 974 |
$ sleep 1 |
| 975 |
$ hg status a |
| 976 |
$ hg --verbose kwexpand a |
| 977 |
overwriting a expanding keywords |
| 978 |
$ hg status a |
| 979 |
|
| 980 |
kwexpand x/a should abort |
| 981 |
|
| 982 |
$ hg --verbose kwexpand x/a |
| 983 |
abort: outstanding uncommitted changes |
| 984 |
[255] |
| 985 |
$ cd x |
| 986 |
$ hg --debug commit -m xa -d '3 0' -u 'User Name <[email protected]>' |
| 987 |
committing files: |
| 988 |
x/a |
| 989 |
x/a: copy a:779c764182ce5d43e2b1eb66ce06d7b47bfe342e |
| 990 |
committing manifest |
| 991 |
committing changelog |
| 992 |
overwriting x/a expanding keywords |
| 993 |
updating the branch cache |
| 994 |
committed changeset 3:b4560182a3f9a358179fd2d835c15e9da379c1e4 |
| 995 |
$ cat a |
| 996 |
expand $Id: x/a b4560182a3f9 Thu, 01 Jan 1970 00:00:03 +0000 user $ |
| 997 |
do not process $Id: |
| 998 |
xxx $ |
| 999 |
$Xinfo: User Name <[email protected]>: xa $ |
| 1000 |
|
| 1001 |
kwshrink a inside directory x |
| 1002 |
|
| 1003 |
$ hg --verbose kwshrink a |
| 1004 |
overwriting x/a shrinking keywords |
| 1005 |
$ cat a |
| 1006 |
expand $Id$ |
| 1007 |
do not process $Id: |
| 1008 |
xxx $ |
| 1009 |
$Xinfo$ |
| 1010 |
$ cd .. |
| 1011 |
|
| 1012 |
kwexpand nonexistent |
| 1013 |
|
| 1014 |
$ hg kwexpand nonexistent |
| 1015 |
nonexistent:* (glob) |
| 1016 |
|
| 1017 |
|
| 1018 |
#if serve |
| 1019 |
hg serve |
| 1020 |
- expand with hgweb file |
| 1021 |
- no expansion with hgweb annotate/changeset/filediff/comparison |
| 1022 |
- expand with hgweb file, again |
| 1023 |
- check errors |
| 1024 |
|
| 1025 |
$ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
| 1026 |
$ cat hg.pid >> $DAEMON_PIDS |
| 1027 |
$ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw' |
| 1028 |
200 Script output follows |
| 1029 |
|
| 1030 |
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
| 1031 |
do not process $Id: |
| 1032 |
xxx $ |
| 1033 |
$Xinfo: User Name <[email protected]>: firstline $ |
| 1034 |
$ get-with-headers.py localhost:$HGPORT 'annotate/tip/a/?style=raw' |
| 1035 |
200 Script output follows |
| 1036 |
|
| 1037 |
|
| 1038 |
user@1: expand $Id$ |
| 1039 |
user@1: do not process $Id: |
| 1040 |
user@1: xxx $ |
| 1041 |
user@2: $Xinfo$ |
| 1042 |
|
| 1043 |
|
| 1044 |
|
| 1045 |
|
| 1046 |
$ get-with-headers.py localhost:$HGPORT 'rev/tip/?style=raw' |
| 1047 |
200 Script output follows |
| 1048 |
|
| 1049 |
|
| 1050 |
# HG changeset patch |
| 1051 |
# User User Name <[email protected]> |
| 1052 |
# Date 3 0 |
| 1053 |
# Node ID b4560182a3f9a358179fd2d835c15e9da379c1e4 |
| 1054 |
# Parent bb948857c743469b22bbf51f7ec8112279ca5d83 |
| 1055 |
xa |
| 1056 |
|
| 1057 |
diff -r bb948857c743 -r b4560182a3f9 x/a |
| 1058 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
| 1059 |
+++ b/x/a Thu Jan 01 00:00:03 1970 +0000 |
| 1060 |
@@ -0,0 +1,4 @@ |
| 1061 |
+expand $Id$ |
| 1062 |
+do not process $Id: |
| 1063 |
+xxx $ |
| 1064 |
+$Xinfo$ |
| 1065 |
|
| 1066 |
$ get-with-headers.py localhost:$HGPORT 'diff/bb948857c743/a?style=raw' |
| 1067 |
200 Script output follows |
| 1068 |
|
| 1069 |
|
| 1070 |
diff -r ef63ca68695b -r bb948857c743 a |
| 1071 |
--- a/a Thu Jan 01 00:00:00 1970 +0000 |
| 1072 |
+++ b/a Thu Jan 01 00:00:02 1970 +0000 |
| 1073 |
@@ -1,3 +1,4 @@ |
| 1074 |
expand $Id$ |
| 1075 |
do not process $Id: |
| 1076 |
xxx $ |
| 1077 |
+$Xinfo$ |
| 1078 |
|
| 1079 |
|
| 1080 |
|
| 1081 |
|
| 1082 |
$ get-with-headers.py localhost:$HGPORT 'comparison/bb948857c743/a' | grep '\$[a-zA-Z]' |
| 1083 |
<td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td> |
| 1084 |
<td class="source equal"><a href="#l1r1"> 1</a> expand $Id$</td> |
| 1085 |
<td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td> |
| 1086 |
<td class="source equal"><a href="#l2r2"> 2</a> do not process $Id:</td> |
| 1087 |
<td class="source insert"><a href="#r4"> 4</a> $Xinfo$</td> |
| 1088 |
|
| 1089 |
(check "kwweb_skip"-ed webcommand doesn't suppress expanding keywords |
| 1090 |
at subsequent webcommands) |
| 1091 |
|
| 1092 |
$ get-with-headers.py localhost:$HGPORT 'file/tip/a/?style=raw' |
| 1093 |
200 Script output follows |
| 1094 |
|
| 1095 |
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
| 1096 |
do not process $Id: |
| 1097 |
xxx $ |
| 1098 |
$Xinfo: User Name <[email protected]>: firstline $ |
| 1099 |
|
| 1100 |
$ killdaemons.py |
| 1101 |
$ cat errors.log |
| 1102 |
#endif |
| 1103 |
|
| 1104 |
Prepare merge and resolve tests |
| 1105 |
|
| 1106 |
$ echo '$Id$' > m |
| 1107 |
$ hg add m |
| 1108 |
$ hg commit -m 4kw |
| 1109 |
$ echo foo >> m |
| 1110 |
$ hg commit -m 5foo |
| 1111 |
|
| 1112 |
simplemerge |
| 1113 |
|
| 1114 |
$ hg update 4 |
| 1115 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 1116 |
$ echo foo >> m |
| 1117 |
$ hg commit -m 6foo |
| 1118 |
created new head |
| 1119 |
$ hg merge |
| 1120 |
0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 1121 |
(branch merge, don't forget to commit) |
| 1122 |
$ hg commit -m simplemerge |
| 1123 |
$ cat m |
| 1124 |
$Id: m 27d48ee14f67 Thu, 01 Jan 1970 00:00:00 +0000 test $ |
| 1125 |
foo |
| 1126 |
|
| 1127 |
conflict: keyword should stay outside conflict zone |
| 1128 |
|
| 1129 |
$ hg update 4 |
| 1130 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 1131 |
$ echo bar >> m |
| 1132 |
$ hg commit -m 8bar |
| 1133 |
created new head |
| 1134 |
$ hg merge |
| 1135 |
merging m |
| 1136 |
warning: conflicts while merging m! (edit, then use 'hg resolve --mark') |
| 1137 |
0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
| 1138 |
use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
| 1139 |
[1] |
| 1140 |
$ cat m |
| 1141 |
$Id$ |
| 1142 |
<<<<<<< working copy: 88a80c8d172e - test: 8bar |
| 1143 |
bar |
| 1144 |
======= |
| 1145 |
foo |
| 1146 |
>>>>>>> merge rev: 85d2d2d732a5 - test: simplemerge |
| 1147 |
|
| 1148 |
resolve to local, m must contain hash of last change (local parent) |
| 1149 |
|
| 1150 |
$ hg resolve -t internal:local -a |
| 1151 |
(no more unresolved files) |
| 1152 |
$ hg commit -m localresolve |
| 1153 |
$ cat m |
| 1154 |
$Id: m 88a80c8d172e Thu, 01 Jan 1970 00:00:00 +0000 test $ |
| 1155 |
bar |
| 1156 |
|
| 1157 |
Test restricted mode with transplant -b |
| 1158 |
|
| 1159 |
$ hg update 6 |
| 1160 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 1161 |
$ hg branch foo |
| 1162 |
marked working directory as branch foo |
| 1163 |
(branches are permanent and global, did you want a bookmark?) |
| 1164 |
$ mv a a.bak |
| 1165 |
$ echo foobranch > a |
| 1166 |
$ cat a.bak >> a |
| 1167 |
$ rm a.bak |
| 1168 |
$ hg commit -m 9foobranch |
| 1169 |
$ hg update default |
| 1170 |
2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 1171 |
$ hg -y transplant -b foo tip |
| 1172 |
applying 4aa30d025d50 |
| 1173 |
4aa30d025d50 transplanted to e00abbf63521 |
| 1174 |
|
| 1175 |
Expansion in changeset but not in file |
| 1176 |
|
| 1177 |
$ hg tip -p |
| 1178 |
changeset: 11:e00abbf63521 |
| 1179 |
tag: tip |
| 1180 |
parent: 9:800511b3a22d |
| 1181 |
user: test |
| 1182 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 1183 |
summary: 9foobranch |
| 1184 |
|
| 1185 |
diff -r 800511b3a22d -r e00abbf63521 a |
| 1186 |
--- a/a Thu Jan 01 00:00:00 1970 +0000 |
| 1187 |
+++ b/a Thu Jan 01 00:00:00 1970 +0000 |
| 1188 |
@@ -1,3 +1,4 @@ |
| 1189 |
+foobranch |
| 1190 |
expand $Id$ |
| 1191 |
do not process $Id: |
| 1192 |
xxx $ |
| 1193 |
|
| 1194 |
$ head -n 2 a |
| 1195 |
foobranch |
| 1196 |
expand $Id: a e00abbf63521 Thu, 01 Jan 1970 00:00:00 +0000 test $ |
| 1197 |
|
| 1198 |
Turn off expansion |
| 1199 |
|
| 1200 |
$ hg -q rollback |
| 1201 |
$ hg -q update -C |
| 1202 |
|
| 1203 |
kwshrink with unknown file u |
| 1204 |
|
| 1205 |
$ cp a u |
| 1206 |
$ hg --verbose kwshrink |
| 1207 |
overwriting a shrinking keywords |
| 1208 |
overwriting m shrinking keywords |
| 1209 |
overwriting x/a shrinking keywords |
| 1210 |
|
| 1211 |
Keywords shrunk in working directory, but not yet disabled |
| 1212 |
- cat shows unexpanded keywords |
| 1213 |
- hg cat shows expanded keywords |
| 1214 |
|
| 1215 |
$ cat a b |
| 1216 |
expand $Id$ |
| 1217 |
do not process $Id: |
| 1218 |
xxx $ |
| 1219 |
$Xinfo$ |
| 1220 |
ignore $Id$ |
| 1221 |
$ hg cat sym a b && echo |
| 1222 |
expand $Id: a bb948857c743 Thu, 01 Jan 1970 00:00:02 +0000 user $ |
| 1223 |
do not process $Id: |
| 1224 |
xxx $ |
| 1225 |
$Xinfo: User Name <[email protected]>: firstline $ |
| 1226 |
ignore $Id$ |
| 1227 |
a |
| 1228 |
|
| 1229 |
Now disable keyword expansion |
| 1230 |
|
| 1231 |
$ cp $HGRCPATH $HGRCPATH.backup |
| 1232 |
$ rm "$HGRCPATH" |
| 1233 |
$ cat a b |
| 1234 |
expand $Id$ |
| 1235 |
do not process $Id: |
| 1236 |
xxx $ |
| 1237 |
$Xinfo$ |
| 1238 |
ignore $Id$ |
| 1239 |
$ hg cat sym a b && echo |
| 1240 |
expand $Id$ |
| 1241 |
do not process $Id: |
| 1242 |
xxx $ |
| 1243 |
$Xinfo$ |
| 1244 |
ignore $Id$ |
| 1245 |
a |
| 1246 |
|
| 1247 |
enable keyword expansion again |
| 1248 |
|
| 1249 |
$ cat $HGRCPATH.backup >> $HGRCPATH |
| 1250 |
|
| 1251 |
Test restricted mode with unshelve |
| 1252 |
|
| 1253 |
$ echo xxxx >> a |
| 1254 |
$ hg diff |
| 1255 |
diff -r 800511b3a22d a |
| 1256 |
--- a/a Thu Jan 01 00:00:00 1970 +0000 |
| 1257 |
+++ b/a * (glob) |
| 1258 |
@@ -2,3 +2,4 @@ |
| 1259 |
do not process $Id: |
| 1260 |
xxx $ |
| 1261 |
$Xinfo$ |
| 1262 |
+xxxx |
| 1263 |
$ hg shelve -q --name tmp |
| 1264 |
$ hg shelve --list --patch |
| 1265 |
tmp (*)* changes to: localresolve (glob) |
| 1266 |
|
| 1267 |
diff --git a/a b/a |
| 1268 |
--- a/a |
| 1269 |
+++ b/a |
| 1270 |
@@ -2,3 +2,4 @@ |
| 1271 |
do not process $Id: |
| 1272 |
xxx $ |
| 1273 |
$Xinfo$ |
| 1274 |
+xxxx |
| 1275 |
|
| 1276 |
$ hg update -q -C 10 |
| 1277 |
$ hg unshelve -q tmp |
| 1278 |
$ hg diff |
| 1279 |
diff -r 4aa30d025d50 a |
| 1280 |
--- a/a Thu Jan 01 00:00:00 1970 +0000 |
| 1281 |
+++ b/a * (glob) |
| 1282 |
@@ -3,3 +3,4 @@ |
| 1283 |
do not process $Id: |
| 1284 |
xxx $ |
| 1285 |
$Xinfo$ |
| 1286 |
+xxxx |
| 1287 |
|
| 1288 |
Test restricted mode with rebase |
| 1289 |
|
| 1290 |
$ cat <<EOF >> $HGRCPATH |
| 1291 |
> [extensions] |
| 1292 |
> rebase = |
| 1293 |
> EOF |
| 1294 |
|
| 1295 |
$ hg update -q -C 9 |
| 1296 |
|
| 1297 |
$ echo xxxx >> a |
| 1298 |
$ hg commit -m '#11' |
| 1299 |
$ hg diff -c 11 |
| 1300 |
diff -r 800511b3a22d -r b07670694489 a |
| 1301 |
--- a/a Thu Jan 01 00:00:00 1970 +0000 |
| 1302 |
+++ b/a Thu Jan 01 00:00:00 1970 +0000 |
| 1303 |
@@ -2,3 +2,4 @@ |
| 1304 |
do not process $Id: |
| 1305 |
xxx $ |
| 1306 |
$Xinfo$ |
| 1307 |
+xxxx |
| 1308 |
|
| 1309 |
$ hg diff -c 10 |
| 1310 |
diff -r 27d48ee14f67 -r 4aa30d025d50 a |
| 1311 |
--- a/a Thu Jan 01 00:00:00 1970 +0000 |
| 1312 |
+++ b/a Thu Jan 01 00:00:00 1970 +0000 |
| 1313 |
@@ -1,3 +1,4 @@ |
| 1314 |
+foobranch |
| 1315 |
expand $Id$ |
| 1316 |
do not process $Id: |
| 1317 |
xxx $ |
| 1318 |
|
| 1319 |
$ hg rebase -q -s 10 -d 11 --keep |
| 1320 |
$ hg diff -r 9 -r 12 a |
| 1321 |
diff -r 800511b3a22d -r 1939b927726c a |
| 1322 |
--- a/a Thu Jan 01 00:00:00 1970 +0000 |
| 1323 |
+++ b/a Thu Jan 01 00:00:00 1970 +0000 |
| 1324 |
@@ -1,4 +1,6 @@ |
| 1325 |
+foobranch |
| 1326 |
expand $Id$ |
| 1327 |
do not process $Id: |
| 1328 |
xxx $ |
| 1329 |
$Xinfo$ |
| 1330 |
+xxxx |
| 1331 |
|
| 1332 |
Test restricted mode with graft |
| 1333 |
|
| 1334 |
$ hg graft -q 10 |
| 1335 |
$ hg diff -r 9 -r 13 a |
| 1336 |
diff -r 800511b3a22d -r 01a68de1003a a |
| 1337 |
--- a/a Thu Jan 01 00:00:00 1970 +0000 |
| 1338 |
+++ b/a Thu Jan 01 00:00:00 1970 +0000 |
| 1339 |
@@ -1,4 +1,6 @@ |
| 1340 |
+foobranch |
| 1341 |
expand $Id$ |
| 1342 |
do not process $Id: |
| 1343 |
xxx $ |
| 1344 |
$Xinfo$ |
| 1345 |
+xxxx |
| 1346 |
|
| 1347 |
Test restricted mode with backout |
| 1348 |
|
| 1349 |
$ hg backout -q 11 --no-commit |
| 1350 |
$ hg diff a |
| 1351 |
diff -r 01a68de1003a a |
| 1352 |
--- a/a Thu Jan 01 00:00:00 1970 +0000 |
| 1353 |
+++ b/a * (glob) |
| 1354 |
@@ -3,4 +3,3 @@ |
| 1355 |
do not process $Id: |
| 1356 |
xxx $ |
| 1357 |
$Xinfo$ |
| 1358 |
-xxxx |
| 1359 |
|
| 1360 |
Test restricted mode with histedit |
| 1361 |
|
| 1362 |
$ cat <<EOF >> $HGRCPATH |
| 1363 |
> [extensions] |
| 1364 |
> histedit = |
| 1365 |
> EOF |
| 1366 |
|
| 1367 |
$ hg commit -m 'backout #11' |
| 1368 |
$ hg histedit -q --command - 13 <<EOF |
| 1369 |
> pick 49f5f2d940c3 14 backout #11 |
| 1370 |
> pick 01a68de1003a 13 9foobranch |
| 1371 |
> EOF |
| 1372 |
|
| 1373 |
Test restricted mode with fetch (with merge) |
| 1374 |
|
| 1375 |
$ cat <<EOF >> $HGRCPATH |
| 1376 |
> [extensions] |
| 1377 |
> fetch = |
| 1378 |
> EOF |
| 1379 |
|
| 1380 |
$ hg clone -q -r 9 . ../fetch-merge |
| 1381 |
$ cd ../fetch-merge |
| 1382 |
$ hg -R ../Test export 10 | hg import -q - |
| 1383 |
$ hg fetch -q -r 11 |
| 1384 |
$ hg diff -r 9 a |
| 1385 |
diff -r 800511b3a22d a |
| 1386 |
--- a/a Thu Jan 01 00:00:00 1970 +0000 |
| 1387 |
+++ b/a * (glob) |
| 1388 |
@@ -1,4 +1,6 @@ |
| 1389 |
+foobranch |
| 1390 |
expand $Id$ |
| 1391 |
do not process $Id: |
| 1392 |
xxx $ |
| 1393 |
$Xinfo$ |
| 1394 |
+xxxx |
| 1395 |
|
| 1396 |
Test that patch.diff(), which is implied by "hg diff" or so, doesn't |
| 1397 |
suppress expanding keywords at subsequent commands |
| 1398 |
|
| 1399 |
#if windows |
| 1400 |
$ PYTHONPATH="$TESTDIR/../contrib;$PYTHONPATH" |
| 1401 |
#else |
| 1402 |
$ PYTHONPATH="$TESTDIR/../contrib:$PYTHONPATH" |
| 1403 |
#endif |
| 1404 |
$ export PYTHONPATH |
| 1405 |
|
| 1406 |
$ grep -v '^promptecho ' < $HGRCPATH >> $HGRCPATH.new |
| 1407 |
$ mv $HGRCPATH.new $HGRCPATH |
| 1408 |
|
| 1409 |
>>> from hgclient import check, readchannel, runcommand |
| 1410 |
>>> @check |
| 1411 |
... def check(server): |
| 1412 |
... # hello block |
| 1413 |
... readchannel(server) |
| 1414 |
... |
| 1415 |
... runcommand(server, [b'cat', b'm']) |
| 1416 |
... runcommand(server, [b'diff', b'-c', b'.', b'm']) |
| 1417 |
... runcommand(server, [b'cat', b'm']) |
| 1418 |
*** runcommand cat m |
| 1419 |
$Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ |
| 1420 |
bar |
| 1421 |
*** runcommand diff -c . m |
| 1422 |
*** runcommand cat m |
| 1423 |
$Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ |
| 1424 |
bar |
| 1425 |
|
| 1426 |
$ cd .. |
| 1427 |
|
| 1428 |
#if serve |
| 1429 |
|
| 1430 |
Test that keywords are expanded only in repositories, which enable |
| 1431 |
keyword extension, even if multiple repositories are served in a |
| 1432 |
process |
| 1433 |
|
| 1434 |
$ cat >> fetch-merge/.hg/hgrc <<EOF |
| 1435 |
> [extensions] |
| 1436 |
> keyword = ! |
| 1437 |
> EOF |
| 1438 |
|
| 1439 |
$ cat > paths.conf <<EOF |
| 1440 |
> [paths] |
| 1441 |
> enabled=Test |
| 1442 |
> disabled=fetch-merge |
| 1443 |
> EOF |
| 1444 |
|
| 1445 |
$ hg serve -p $HGPORT -d --pid-file=hg.pid -A access.log -E error.log --webdir-conf paths.conf |
| 1446 |
$ cat hg.pid >> $DAEMON_PIDS |
| 1447 |
|
| 1448 |
$ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw' |
| 1449 |
200 Script output follows |
| 1450 |
|
| 1451 |
$Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ |
| 1452 |
bar |
| 1453 |
|
| 1454 |
$ get-with-headers.py localhost:$HGPORT 'disabled/file/tip/m/?style=raw' |
| 1455 |
200 Script output follows |
| 1456 |
|
| 1457 |
$Id$ |
| 1458 |
bar |
| 1459 |
|
| 1460 |
(check expansion again, for safety) |
| 1461 |
|
| 1462 |
$ get-with-headers.py localhost:$HGPORT 'enabled/file/tip/m/?style=raw' |
| 1463 |
200 Script output follows |
| 1464 |
|
| 1465 |
$Id: m 800511b3a22d Thu, 01 Jan 1970 00:00:00 +0000 test $ |
| 1466 |
bar |
| 1467 |
|
| 1468 |
$ killdaemons.py |
| 1469 |
#endif |