diff tests/test-log.t @ 45471:a03fde1077ce

log: reorganize if-else and for loop in logcmdutil._makematcher() The test conditions are branchy depending on --follow and --rev options, so it should be better to switch first by --follow --rev. Note that revs is not empty so "if follow and startctxs" can be replaced with "if follow and opts.get(b'rev')".
author Yuya Nishihara <yuya@tcha.org>
date Fri, 11 Sep 2020 15:08:58 +0900
parents 4ebc5f325bed
children 07324227f6b7
line wrap: on
line diff
--- a/tests/test-log.t	Wed Aug 26 16:37:23 2020 +0530
+++ b/tests/test-log.t	Fri Sep 11 15:08:58 2020 +0900
@@ -2308,6 +2308,20 @@
   $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat notfound
   notfound: $ENOENT$
 
+follow added/removed files from wdir parent
+
+  $ hg log -T '{rev}\n' -f d1/f2
+  abort: cannot follow nonexistent file: "d1/f2"
+  [255]
+
+  $ hg log -T '{rev}\n' -f f1-copy
+  abort: cannot follow nonexistent file: "f1-copy"
+  [255]
+
+  $ hg log -T '{rev}\n' -f .d6/f1
+  abort: cannot follow file not in parent revision: ".d6/f1"
+  [255]
+
   $ hg revert -aqC
 
 Check that adding an arbitrary name shows up in log automatically