changeset 35996:de0666564bde

merge with stable
author Yuya Nishihara <yuya@tcha.org>
date Sat, 10 Feb 2018 21:14:41 +0900
parents b7e2cf114e85 (current diff) 7b2b82f891bf (diff)
children 24f05489377b
files
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/fileset.py	Fri Feb 09 22:49:20 2018 +0100
+++ b/mercurial/fileset.py	Sat Feb 10 21:14:41 2018 +0900
@@ -464,9 +464,10 @@
     getargs(x, 0, 0, _("copied takes no arguments"))
     s = []
     for f in mctx.subset:
-        p = mctx.ctx[f].parents()
-        if p and p[0].path() != f:
-            s.append(f)
+        if f in mctx.ctx:
+            p = mctx.ctx[f].parents()
+            if p and p[0].path() != f:
+                s.append(f)
     return s
 
 @predicate('revs(revs, pattern)')
--- a/tests/test-fileset.t	Fri Feb 09 22:49:20 2018 +0100
+++ b/tests/test-fileset.t	Sat Feb 10 21:14:41 2018 +0900
@@ -249,6 +249,8 @@
 Test merge states
 
   $ hg ci -m manychanges
+  $ hg file -r . 'set:copied() & modified()'
+  [1]
   $ hg up -C 0
   * files updated, 0 files merged, * files removed, 0 files unresolved (glob)
   $ echo c >> b2