diff -r c068e355cd71 -r 55464c0b3a89 mercurial/localrepo.py --- a/mercurial/localrepo.py Mon Jul 06 22:37:53 2020 +0200 +++ b/mercurial/localrepo.py Mon Jul 06 22:46:49 2020 +0200 @@ -3109,7 +3109,11 @@ if writechangesetcopy: filesadded = ctx.filesadded() filesremoved = ctx.filesremoved() - elif ctx.files(): + elif not ctx.files(): + self.ui.debug(b'reusing manifest from p1 (no file change)\n') + mn = p1.manifestnode() + files = [] + else: m1ctx = p1.manifestctx() m2ctx = p2.manifestctx() mctx = m1ctx.copy() @@ -3205,10 +3209,6 @@ b'actually unchanged)\n' ) mn = p1.manifestnode() - else: - self.ui.debug(b'reusing manifest from p1 (no file change)\n') - mn = p1.manifestnode() - files = [] if writecopiesto == b'changeset-only': # If writing only to changeset extras, use None to indicate that