357 test that '[committemplate] changeset' definition and commit log |
357 test that '[committemplate] changeset' definition and commit log |
358 specific template keywords work well |
358 specific template keywords work well |
359 |
359 |
360 $ cat >> .hg/hgrc <<EOF |
360 $ cat >> .hg/hgrc <<EOF |
361 > [committemplate] |
361 > [committemplate] |
|
362 > changeset.commit.normal = HG: this is "commit.normal" template |
|
363 > HG: {extramsg} |
|
364 > {if(currentbookmark, |
|
365 > "HG: bookmark '{currentbookmark}' is activated\n", |
|
366 > "HG: no bookmark is activated\n")}{subrepos % |
|
367 > "HG: subrepo '{subrepo}' is changed\n"} |
|
368 > |
|
369 > changeset.commit = HG: this is "commit" template |
|
370 > HG: {extramsg} |
|
371 > {if(currentbookmark, |
|
372 > "HG: bookmark '{currentbookmark}' is activated\n", |
|
373 > "HG: no bookmark is activated\n")}{subrepos % |
|
374 > "HG: subrepo '{subrepo}' is changed\n"} |
|
375 > |
362 > changeset = HG: this is customized commit template |
376 > changeset = HG: this is customized commit template |
363 > HG: {extramsg} |
377 > HG: {extramsg} |
364 > {if(currentbookmark, |
378 > {if(currentbookmark, |
365 > "HG: bookmark '{currentbookmark}' is activated\n", |
379 > "HG: bookmark '{currentbookmark}' is activated\n", |
366 > "HG: no bookmark is activated\n")}{subrepos % |
380 > "HG: no bookmark is activated\n")}{subrepos % |
371 $ echo a > sub2/a |
385 $ echo a > sub2/a |
372 $ hg -R sub2 add sub2/a |
386 $ hg -R sub2 add sub2/a |
373 $ echo 'sub2 = sub2' >> .hgsub |
387 $ echo 'sub2 = sub2' >> .hgsub |
374 |
388 |
375 $ HGEDITOR=cat hg commit -S -q |
389 $ HGEDITOR=cat hg commit -S -q |
376 HG: this is customized commit template |
390 HG: this is "commit.normal" template |
377 HG: Leave message empty to abort commit. |
391 HG: Leave message empty to abort commit. |
378 HG: bookmark 'currentbookmark' is activated |
392 HG: bookmark 'currentbookmark' is activated |
379 HG: subrepo 'sub' is changed |
393 HG: subrepo 'sub' is changed |
380 HG: subrepo 'sub2' is changed |
394 HG: subrepo 'sub2' is changed |
381 abort: empty commit message |
395 abort: empty commit message |
382 [255] |
396 [255] |
383 |
397 |
|
398 $ cat >> .hg/hgrc <<EOF |
|
399 > [committemplate] |
|
400 > changeset.commit.normal = |
|
401 > # now, "changeset.commit" should be chosen for "hg commit" |
|
402 > EOF |
|
403 |
384 $ hg bookmark --inactive currentbookmark |
404 $ hg bookmark --inactive currentbookmark |
385 $ hg forget .hgsub |
405 $ hg forget .hgsub |
|
406 $ HGEDITOR=cat hg commit -q |
|
407 HG: this is "commit" template |
|
408 HG: Leave message empty to abort commit. |
|
409 HG: no bookmark is activated |
|
410 abort: empty commit message |
|
411 [255] |
|
412 |
|
413 $ cat >> .hg/hgrc <<EOF |
|
414 > [committemplate] |
|
415 > changeset.commit = |
|
416 > # now, "changeset" should be chosen for "hg commit" |
|
417 > EOF |
|
418 |
386 $ HGEDITOR=cat hg commit -q |
419 $ HGEDITOR=cat hg commit -q |
387 HG: this is customized commit template |
420 HG: this is customized commit template |
388 HG: Leave message empty to abort commit. |
421 HG: Leave message empty to abort commit. |
389 HG: no bookmark is activated |
422 HG: no bookmark is activated |
390 abort: empty commit message |
423 abort: empty commit message |