tests/test-command-template.t
branchstable
changeset 24853 6518880de1b3
parent 24852 515cd710df95
child 24886 10a13da8840d
equal deleted inserted replaced
24852:515cd710df95 24853:6518880de1b3
    99 
    99 
   100   $ echo c >> c
   100   $ echo c >> c
   101   $ hg add c
   101   $ hg add c
   102   $ hg commit -qm ' '
   102   $ hg commit -qm ' '
   103 
   103 
   104 Default style is like normal output.
   104 Default style is like normal output. Phases style should be the same
       
   105 as default style, except for extra phase lines.
   105 
   106 
   106   $ hg log > log.out
   107   $ hg log > log.out
   107   $ hg log --style default > style.out
   108   $ hg log --style default > style.out
   108   $ cmp log.out style.out || diff -u log.out style.out
   109   $ cmp log.out style.out || diff -u log.out style.out
       
   110   $ hg log -T phases > phases.out
       
   111   $ diff -u log.out phases.out | grep "phase:"
       
   112   +phase:       draft
       
   113   +phase:       draft
       
   114   +phase:       draft
       
   115   +phase:       draft
       
   116   +phase:       draft
       
   117   +phase:       draft
       
   118   +phase:       draft
       
   119   +phase:       draft
       
   120   +phase:       draft
       
   121   +phase:       draft
   109 
   122 
   110   $ hg log -v > log.out
   123   $ hg log -v > log.out
   111   $ hg log -v --style default > style.out
   124   $ hg log -v --style default > style.out
   112   $ cmp log.out style.out || diff -u log.out style.out
   125   $ cmp log.out style.out || diff -u log.out style.out
       
   126   $ hg log -v -T phases > phases.out
       
   127   $ diff -u log.out phases.out | grep phase:
       
   128   +phase:       draft
       
   129   +phase:       draft
       
   130   +phase:       draft
       
   131   +phase:       draft
       
   132   +phase:       draft
       
   133   +phase:       draft
       
   134   +phase:       draft
       
   135   +phase:       draft
       
   136   +phase:       draft
       
   137   +phase:       draft
   113 
   138 
   114   $ hg log -q > log.out
   139   $ hg log -q > log.out
   115   $ hg log -q --style default > style.out
   140   $ hg log -q --style default > style.out
   116   $ cmp log.out style.out || diff -u log.out style.out
   141   $ cmp log.out style.out || diff -u log.out style.out
       
   142   $ hg log -q -T phases > phases.out
       
   143   $ cmp log.out phases.out || diff -u log.out phases.out
   117 
   144 
   118   $ hg log --debug > log.out
   145   $ hg log --debug > log.out
   119   $ hg log --debug --style default > style.out
   146   $ hg log --debug --style default > style.out
   120   $ cmp log.out style.out || diff -u log.out style.out
   147   $ cmp log.out style.out || diff -u log.out style.out
       
   148   $ hg log --debug -T phases > phases.out
       
   149   $ cmp log.out phases.out || diff -u log.out phases.out
   121 
   150 
   122 Default style should also preserve color information (issue2866):
   151 Default style should also preserve color information (issue2866):
   123 
   152 
   124   $ cp $HGRCPATH $HGRCPATH-bak
   153   $ cp $HGRCPATH $HGRCPATH-bak
   125   $ cat <<EOF >> $HGRCPATH
   154   $ cat <<EOF >> $HGRCPATH
   128   > EOF
   157   > EOF
   129 
   158 
   130   $ hg --color=debug log > log.out
   159   $ hg --color=debug log > log.out
   131   $ hg --color=debug log --style default > style.out
   160   $ hg --color=debug log --style default > style.out
   132   $ cmp log.out style.out || diff -u log.out style.out
   161   $ cmp log.out style.out || diff -u log.out style.out
       
   162   $ hg --color=debug log -T phases > phases.out
       
   163   $ diff -u log.out phases.out | grep phase:
       
   164   +[log.phase|phase:       draft]
       
   165   +[log.phase|phase:       draft]
       
   166   +[log.phase|phase:       draft]
       
   167   +[log.phase|phase:       draft]
       
   168   +[log.phase|phase:       draft]
       
   169   +[log.phase|phase:       draft]
       
   170   +[log.phase|phase:       draft]
       
   171   +[log.phase|phase:       draft]
       
   172   +[log.phase|phase:       draft]
       
   173   +[log.phase|phase:       draft]
       
   174 
   133   $ hg --color=debug -v log > log.out
   175   $ hg --color=debug -v log > log.out
   134   $ hg --color=debug -v log --style default > style.out
   176   $ hg --color=debug -v log --style default > style.out
   135   $ cmp log.out style.out || diff -u log.out style.out
   177   $ cmp log.out style.out || diff -u log.out style.out
       
   178   $ hg --color=debug -v log -T phases > phases.out
       
   179   $ diff -u log.out phases.out | grep phase:
       
   180   +[log.phase|phase:       draft]
       
   181   +[log.phase|phase:       draft]
       
   182   +[log.phase|phase:       draft]
       
   183   +[log.phase|phase:       draft]
       
   184   +[log.phase|phase:       draft]
       
   185   +[log.phase|phase:       draft]
       
   186   +[log.phase|phase:       draft]
       
   187   +[log.phase|phase:       draft]
       
   188   +[log.phase|phase:       draft]
       
   189   +[log.phase|phase:       draft]
       
   190 
   136   $ hg --color=debug -q log > log.out
   191   $ hg --color=debug -q log > log.out
   137   $ hg --color=debug -q log --style default > style.out
   192   $ hg --color=debug -q log --style default > style.out
   138   $ cmp log.out style.out || diff -u log.out style.out
   193   $ cmp log.out style.out || diff -u log.out style.out
       
   194   $ hg --color=debug -q log -T phases > phases.out
       
   195   $ cmp log.out phases.out || diff -u log.out phases.out
       
   196 
   139   $ hg --color=debug --debug log > log.out
   197   $ hg --color=debug --debug log > log.out
   140   $ hg --color=debug --debug log --style default > style.out
   198   $ hg --color=debug --debug log --style default > style.out
   141   $ cmp log.out style.out || diff -u log.out style.out
   199   $ cmp log.out style.out || diff -u log.out style.out
       
   200   $ hg --color=debug --debug log -T phases > phases.out
       
   201   $ cmp log.out phases.out || diff -u log.out phases.out
   142 
   202 
   143   $ mv $HGRCPATH-bak $HGRCPATH
   203   $ mv $HGRCPATH-bak $HGRCPATH
   144 
   204 
   145 Remove commit with empty commit message, so as to not pollute further
   205 Remove commit with empty commit message, so as to not pollute further
   146 tests.
   206 tests.