tests: add test for "log -r wdir() -p" (issue4871)
authorYuya Nishihara <yuya@tcha.org>
Sun, 13 Mar 2016 23:27:27 +0900
changeset 28566 34f798bec3dc
parent 28565 bfc7f20c76c7
child 28567 ca52512ac709
tests: add test for "log -r wdir() -p" (issue4871) The issue has been fixed by 93bcc73df8d5, "cmdutil.changeset_printer: pass context into showpatch()". This patch adds test to prevent future regression.
tests/test-log.t
--- a/tests/test-log.t	Sun Mar 13 23:21:45 2016 +0900
+++ b/tests/test-log.t	Sun Mar 13 23:27:27 2016 +0900
@@ -1788,6 +1788,14 @@
   date:        [A-Za-z0-9:+ ]+ (re)
   extra:       branch=default
   
+  $ hg log -r 'wdir()' -p --stat
+  changeset:   2147483647:ffffffffffff
+  parent:      0:65624cd9070a
+  user:        test
+  date:        [A-Za-z0-9:+ ]+ (re)
+  
+  
+  
 
 dirty:
 
@@ -1821,6 +1829,36 @@
   files-:      .d6/f1
   extra:       branch=default
   
+  $ hg log -r 'wdir()' -p --stat --git
+  changeset:   2147483647:ffffffffffff
+  parent:      0:65624cd9070a
+  user:        test
+  date:        [A-Za-z0-9:+ ]+ (re)
+  
+   .d6/f1 |  1 -
+   d1/f1  |  1 +
+   d1/f2  |  1 +
+   3 files changed, 2 insertions(+), 1 deletions(-)
+  
+  diff --git a/.d6/f1 b/.d6/f1
+  deleted file mode 100644
+  --- a/.d6/f1
+  +++ /dev/null
+  @@ -1,1 +0,0 @@
+  -1
+  diff --git a/d1/f1 b/d1/f1
+  --- a/d1/f1
+  +++ b/d1/f1
+  @@ -1,1 +1,2 @@
+   1
+  +2
+  diff --git a/d1/f2 b/d1/f2
+  new file mode 100644
+  --- /dev/null
+  +++ b/d1/f2
+  @@ -0,0 +1,1 @@
+  +2
+  
   $ hg log -r 'wdir()' -Tjson
   [
    {