[PATCH 1 of 2] tests: include modified/added/removed files in "log -r wdir()" output

Yuya Nishihara yuya at tcha.org
Wed Mar 16 15:54:51 UTC 2016


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1457878905 -32400
#      Sun Mar 13 23:21:45 2016 +0900
# Node ID 732c1c6b8c835f8cafe40c20730d8bb2eb7ea81a
# Parent  dfd5a6830ea7cd56909b6667c78ae122cc3a5aa1
tests: include modified/added/removed files in "log -r wdir()" output

This patch prepares for the test of "hg log -r wdir() -p".

diff --git a/tests/test-log.t b/tests/test-log.t
--- a/tests/test-log.t
+++ b/tests/test-log.t
@@ -1777,6 +1777,29 @@ issue3772: hg log -r :null showing revis
   
 working-directory revision requires special treatment
 
+clean:
+
+  $ hg log -r 'wdir()' --debug
+  changeset:   2147483647:ffffffffffffffffffffffffffffffffffffffff
+  phase:       draft
+  parent:      0:65624cd9070a035fa7191a54f2b8af39f16b0c08
+  parent:      -1:0000000000000000000000000000000000000000
+  user:        test
+  date:        [A-Za-z0-9:+ ]+ (re)
+  extra:       branch=default
+  
+
+dirty:
+
+  $ echo 2 >> d1/f1
+  $ echo 2 > d1/f2
+  $ hg add d1/f2
+  $ hg remove .d6/f1
+  $ hg status
+  M d1/f1
+  A d1/f2
+  R .d6/f1
+
   $ hg log -r 'wdir()'
   changeset:   2147483647:ffffffffffff
   parent:      0:65624cd9070a
@@ -1793,6 +1816,9 @@ working-directory revision requires spec
   parent:      -1:0000000000000000000000000000000000000000
   user:        test
   date:        [A-Za-z0-9:+ ]+ (re)
+  files:       d1/f1
+  files+:      d1/f2
+  files-:      .d6/f1
   extra:       branch=default
   
   $ hg log -r 'wdir()' -Tjson
@@ -1834,12 +1860,14 @@ working-directory revision requires spec
     "parents": ["65624cd9070a035fa7191a54f2b8af39f16b0c08"],
     "manifest": null,
     "extra": {"branch": "default"},
-    "modified": [],
-    "added": [],
-    "removed": []
+    "modified": ["d1/f1"],
+    "added": ["d1/f2"],
+    "removed": [".d6/f1"]
    }
   ]
 
+  $ hg revert -aqC
+
 Check that adding an arbitrary name shows up in log automatically
 
   $ cat > ../names.py <<EOF


More information about the Mercurial-devel mailing list