D6409: convert: don't include file in "files" list if it's added in p2

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Fri May 17 14:49:41 EDT 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6409

AFFECTED FILES
  mercurial/localrepo.py
  tests/test-convert-hg-sink.t

CHANGE DETAILS

diff --git a/tests/test-convert-hg-sink.t b/tests/test-convert-hg-sink.t
--- a/tests/test-convert-hg-sink.t
+++ b/tests/test-convert-hg-sink.t
@@ -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
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -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
 



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list