tests/test-commit.t
changeset 25014 7e5d5160073b
parent 23749 a387b0390082
child 25018 93e015a3d1ea
equal deleted inserted replaced
25013:277aba2c151a 25014:7e5d5160073b
   300 
   300 
   301   $ hg init commitmsg
   301   $ hg init commitmsg
   302   $ cd commitmsg
   302   $ cd commitmsg
   303   $ echo changed > changed
   303   $ echo changed > changed
   304   $ echo removed > removed
   304   $ echo removed > removed
   305   $ hg book currentbookmark
   305   $ hg book activebookmark
   306   $ hg ci -qAm init
   306   $ hg ci -qAm init
   307 
   307 
   308   $ hg rm removed
   308   $ hg rm removed
   309   $ echo changed >> changed
   309   $ echo changed >> changed
   310   $ echo added > added
   310   $ echo added > added
   315   HG: Enter commit message.  Lines beginning with 'HG:' are removed.
   315   HG: Enter commit message.  Lines beginning with 'HG:' are removed.
   316   HG: Leave message empty to abort commit.
   316   HG: Leave message empty to abort commit.
   317   HG: --
   317   HG: --
   318   HG: user: test
   318   HG: user: test
   319   HG: branch 'default'
   319   HG: branch 'default'
   320   HG: bookmark 'currentbookmark'
   320   HG: bookmark 'activebookmark'
   321   HG: added added
   321   HG: added added
   322   HG: changed changed
   322   HG: changed changed
   323   HG: removed removed
   323   HG: removed removed
   324   abort: empty commit message
   324   abort: empty commit message
   325   [255]
   325   [255]
   352   HG: Enter commit message.  Lines beginning with 'HG:' are removed.
   352   HG: Enter commit message.  Lines beginning with 'HG:' are removed.
   353   HG: Leave message empty to abort commit.
   353   HG: Leave message empty to abort commit.
   354   HG: --
   354   HG: --
   355   HG: user: test
   355   HG: user: test
   356   HG: branch 'default'
   356   HG: branch 'default'
   357   HG: bookmark 'currentbookmark'
   357   HG: bookmark 'activebookmark'
   358   HG: subrepo sub
   358   HG: subrepo sub
   359   HG: added .hgsub
   359   HG: added .hgsub
   360   HG: added added
   360   HG: added added
   361   HG: changed .hgsubstate
   361   HG: changed .hgsubstate
   362   HG: changed changed
   362   HG: changed changed
   374 
   374 
   375   $ cat >> .hg/hgrc <<EOF
   375   $ cat >> .hg/hgrc <<EOF
   376   > [committemplate]
   376   > [committemplate]
   377   > changeset.commit.normal = HG: this is "commit.normal" template
   377   > changeset.commit.normal = HG: this is "commit.normal" template
   378   >     HG: {extramsg}
   378   >     HG: {extramsg}
   379   >     {if(currentbookmark,
   379   >     {if(activebookmark,
   380   >    "HG: bookmark '{currentbookmark}' is activated\n",
   380   >    "HG: bookmark '{activebookmark}' is activated\n",
   381   >    "HG: no bookmark is activated\n")}{subrepos %
   381   >    "HG: no bookmark is activated\n")}{subrepos %
   382   >    "HG: subrepo '{subrepo}' is changed\n"}
   382   >    "HG: subrepo '{subrepo}' is changed\n"}
   383   > 
   383   > 
   384   > changeset.commit = HG: this is "commit" template
   384   > changeset.commit = HG: this is "commit" template
   385   >     HG: {extramsg}
   385   >     HG: {extramsg}
   386   >     {if(currentbookmark,
   386   >     {if(activebookmark,
   387   >    "HG: bookmark '{currentbookmark}' is activated\n",
   387   >    "HG: bookmark '{activebookmark}' is activated\n",
   388   >    "HG: no bookmark is activated\n")}{subrepos %
   388   >    "HG: no bookmark is activated\n")}{subrepos %
   389   >    "HG: subrepo '{subrepo}' is changed\n"}
   389   >    "HG: subrepo '{subrepo}' is changed\n"}
   390   > 
   390   > 
   391   > changeset = HG: this is customized commit template
   391   > changeset = HG: this is customized commit template
   392   >     HG: {extramsg}
   392   >     HG: {extramsg}
   393   >     {if(currentbookmark,
   393   >     {if(activebookmark,
   394   >    "HG: bookmark '{currentbookmark}' is activated\n",
   394   >    "HG: bookmark '{activebookmark}' is activated\n",
   395   >    "HG: no bookmark is activated\n")}{subrepos %
   395   >    "HG: no bookmark is activated\n")}{subrepos %
   396   >    "HG: subrepo '{subrepo}' is changed\n"}
   396   >    "HG: subrepo '{subrepo}' is changed\n"}
   397   > EOF
   397   > EOF
   398 
   398 
   399   $ hg init sub2
   399   $ hg init sub2
   402   $ echo 'sub2 = sub2' >> .hgsub
   402   $ echo 'sub2 = sub2' >> .hgsub
   403 
   403 
   404   $ HGEDITOR=cat hg commit -S -q
   404   $ HGEDITOR=cat hg commit -S -q
   405   HG: this is "commit.normal" template
   405   HG: this is "commit.normal" template
   406   HG: Leave message empty to abort commit.
   406   HG: Leave message empty to abort commit.
   407   HG: bookmark 'currentbookmark' is activated
   407   HG: bookmark 'activebookmark' is activated
   408   HG: subrepo 'sub' is changed
   408   HG: subrepo 'sub' is changed
   409   HG: subrepo 'sub2' is changed
   409   HG: subrepo 'sub2' is changed
   410   abort: empty commit message
   410   abort: empty commit message
   411   [255]
   411   [255]
   412 
   412 
   414   > [committemplate]
   414   > [committemplate]
   415   > changeset.commit.normal =
   415   > changeset.commit.normal =
   416   > # now, "changeset.commit" should be chosen for "hg commit"
   416   > # now, "changeset.commit" should be chosen for "hg commit"
   417   > EOF
   417   > EOF
   418 
   418 
   419   $ hg bookmark --inactive currentbookmark
   419   $ hg bookmark --inactive activebookmark
   420   $ hg forget .hgsub
   420   $ hg forget .hgsub
   421   $ HGEDITOR=cat hg commit -q
   421   $ HGEDITOR=cat hg commit -q
   422   HG: this is "commit" template
   422   HG: this is "commit" template
   423   HG: Leave message empty to abort commit.
   423   HG: Leave message empty to abort commit.
   424   HG: no bookmark is activated
   424   HG: no bookmark is activated