[PATCH 2 of 2] tests: add test of "log -r wdir() -p" (issue4871)

Yuya Nishihara yuya at tcha.org
Wed Mar 16 11:54:52 EDT 2016


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1457879247 -32400
#      Sun Mar 13 23:27:27 2016 +0900
# Node ID 3f6072e4ba4e052d30c3fa636a67318d5400ed5c
# Parent  732c1c6b8c835f8cafe40c20730d8bb2eb7ea81a
tests: add test of "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.

diff --git a/tests/test-log.t b/tests/test-log.t
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -1788,6 +1788,14 @@ clean:
   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 @@ dirty:
   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
   [
    {


More information about the Mercurial-devel mailing list