mercurial/localrepo.py
changeset 45193 e64c35dfc6cb
parent 45192 509f5b6c0b7e
child 45194 6979a20ff004
--- a/mercurial/localrepo.py	Mon Jul 06 19:35:53 2020 +0200
+++ b/mercurial/localrepo.py	Mon Jul 06 20:03:30 2020 +0200
@@ -3120,6 +3120,7 @@
 
                 # check in files
                 added = []
+                filesadded = []
                 changed = []
                 removed = list(ctx.removed())
                 linkrev = len(self)
@@ -3138,6 +3139,8 @@
                             )
                             if is_touched:
                                 changed.append(f)
+                                if writechangesetcopy and is_touched == 'added':
+                                    filesadded.append(f)
                             m.setflag(f, fctx.flags())
                     except OSError:
                         self.ui.warn(
@@ -3193,9 +3196,6 @@
                     )
 
                     if writechangesetcopy:
-                        filesadded = [
-                            f for f in changed if not (f in m1 or f in m2)
-                        ]
                         filesremoved = removed
                 else:
                     self.ui.debug(