view tests/test-diff-color.t @ 12796:bc69ba99e34b stable

mercurial.el: fix hg-outgoing path when 'default-push' is not defined hg-outgoing path is set as 'default-push' which prevents it from working in repos which only have 'default' defined. Fix provided by Kyujin Shim at http://alexott.net/en/writings/emacs-vcs/EmacsMercurial.html
author Azhagu Selvan SP <tamizhgeek@gmail.com>
date Wed, 20 Oct 2010 18:15:47 +0530
parents 1ff3fc4b6a66
children 05fffd665170
line wrap: on
line source

Setup

  $ echo "[extensions]" >> $HGRCPATH
  $ echo "color=" >> $HGRCPATH
  $ hg init repo
  $ cd repo
  $ cat > a <<EOF
  > c
  > c
  > a
  > a
  > b
  > a
  > a
  > c
  > c
  > EOF
  $ hg ci -Am adda
  adding a
  $ cat > a <<EOF
  > c
  > c
  > a
  > a
  > dd
  > a
  > a
  > c
  > c
  > EOF

default context

  $ hg diff --nodates --color=always
  diff -r cf9f4ba66af2 a
  --- a/a
  +++ b/a
  @@ -2,7 +2,7 @@
   c
   a
   a
  -b
  +dd
   a
   a
   c

--unified=2

  $ hg diff --nodates -U 2  --color=always
  diff -r cf9f4ba66af2 a
  --- a/a
  +++ b/a
  @@ -3,5 +3,5 @@
   a
   a
  -b
  +dd
   a
   a

diffstat

  $ hg diff --stat --color=always
   a |  2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)
  $ echo "record=" >> $HGRCPATH
  $ echo "[ui]" >> $HGRCPATH
  $ echo "interactive=true" >> $HGRCPATH
  $ echo "[diff]" >> $HGRCPATH
  $ echo "git=True" >> $HGRCPATH

record

  $ chmod 0755 a
  $ hg record --color=always -m moda a <<EOF
  > y
  > y
  > EOF
  diff --git a/a b/a
  old mode 100644
  new mode 100755
  1 hunks, 1 lines changed
  examine changes to 'a'? [Ynsfdaq?] 
  @@ -2,7 +2,7 @@
   c
   a
   a
  -b
  +dd
   a
   a
   c
  record this change to 'a'? [Ynsfdaq?] 
  $ echo
  
  $ echo "[extensions]" >> $HGRCPATH
  $ echo "mq=" >> $HGRCPATH
  $ hg rollback
  rolling back to revision 0 (undo commit)

qrecord

  $ hg qrecord --color=always -m moda patch <<EOF
  > y
  > y
  > EOF
  diff --git a/a b/a
  old mode 100644
  new mode 100755
  1 hunks, 1 lines changed
  examine changes to 'a'? [Ynsfdaq?] 
  @@ -2,7 +2,7 @@
   c
   a
   a
  -b
  +dd
   a
   a
   c
  record this change to 'a'? [Ynsfdaq?] 
  $ echo