Test "hg diff --rev", update _getcmd comment (backwards compatibility)
authorChristian Ebert <blacktrash@gmx.net>
Sat, 11 Aug 2007 14:43:04 +0200
changeset 224 fd98a9bffcbe
parent 223 65a01675a944
child 225 2a0ac51bfd24
Test "hg diff --rev", update _getcmd comment (backwards compatibility)
hgkw/keyword.py
tests/test-keyword
tests/test-keyword.out
--- a/hgkw/keyword.py	Thu Aug 09 15:54:27 2007 +0200
+++ b/hgkw/keyword.py	Sat Aug 11 14:43:04 2007 +0200
@@ -397,7 +397,8 @@
                     'remove', 'rename', 'rollback']
 
     def _getcmd():
-        # cmdutil.parse(ui, sys.argv[1:])[0] doesn't work for "hg diff -r"
+        # commands or cmdutil.parse(ui, sys.argv[1:])[0]
+        # results in no output from "hg diff --rev" with older hg versions
         args = fancyopts.fancyopts(sys.argv[1:], commands.globalopts, {})
         if args:
             cmd = args[0]
--- a/tests/test-keyword	Thu Aug 09 15:54:27 2007 +0200
+++ b/tests/test-keyword	Sat Aug 11 14:43:04 2007 +0200
@@ -69,6 +69,9 @@
 echo % status
 hg status
 
+echo % diff --rev
+hg diff --rev 0 | grep -F -v 'b/c'
+
 echo % rollback
 hg rollback
 echo % status
--- a/tests/test-keyword.out	Thu Aug 09 15:54:27 2007 +0200
+++ b/tests/test-keyword.out	Sat Aug 11 14:43:04 2007 +0200
@@ -114,6 +114,13 @@
 xxx $
 % touch copied c
 % status
+% diff --rev
+diff -r 7f0665a496fd c
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+@@ -0,0 +1,3 @@
++expand $Id: c,v 6a127771f5db 1970/01/01 00:00:01 user $
++do not process $Id:
++xxx $
 % rollback
 rolling back last transaction
 % status