changeset 42361:c0e1ea0c4cee

convert: don't include file in "files" list if it's added in p2 If the file is from p2, we should clearly compare the flags to what they were in p2. Also note that manifest.flags('non-existent') unfortunately returns '' instead of erroring out. Differential Revision: https://phab.mercurial-scm.org/D6409
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 17 May 2019 00:57:57 -0700
parents 78530404d00b
children 7ada598941d2
files mercurial/localrepo.py tests/test-convert-hg-sink.t
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Fri May 17 11:32:48 2019 -0700
+++ b/mercurial/localrepo.py	Fri May 17 00:57:57 2019 -0700
@@ -2367,7 +2367,10 @@
             node = fctx.filenode()
             if node in [fparent1, fparent2]:
                 self.ui.debug('reusing %s filelog entry\n' % fname)
-                if manifest1.flags(fname) != fctx.flags():
+                if ((fparent1 != nullid and
+                     manifest1.flags(fname) != fctx.flags()) or
+                    (fparent2 != nullid and
+                     manifest2.flags(fname) != fctx.flags())):
                     changelist.append(fname)
                 return node
 
--- a/tests/test-convert-hg-sink.t	Fri May 17 11:32:48 2019 -0700
+++ b/tests/test-convert-hg-sink.t	Fri May 17 00:57:57 2019 -0700
@@ -616,8 +616,9 @@
   |/
   o  0 add 0
   
-BROKEN: now 'a' appears changed
+
+# Still no files
   $ hg log -r 3 -T '{files}\n'
-  a
+  
 
 #endif