mercurial/changelog.py
changeset 45671 2d6aea053153
parent 45636 053c9014fd39
child 45672 f877b3628015
--- a/mercurial/changelog.py	Wed Sep 16 21:00:02 2020 +0200
+++ b/mercurial/changelog.py	Thu Oct 01 09:29:49 2020 +0200
@@ -26,6 +26,7 @@
     dateutil,
     stringutil,
 )
+from .revlogutils import flagutil
 
 _defaultextra = {b'branch': b'default'}
 
@@ -579,8 +580,17 @@
                     _(b'the name \'%s\' is reserved') % branch
                 )
         sortedfiles = sorted(files.touched)
+        flags = 0
         sidedata = None
         if self._copiesstorage == b'changeset-sidedata':
+            if (
+                files.removed
+                or files.merged
+                or files.salvaged
+                or files.copied_from_p1
+                or files.copied_from_p2
+            ):
+                flags |= flagutil.REVIDX_HASCOPIESINFO
             sidedata = metadata.encode_files_sidedata(files)
 
         if extra: