diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -3122,7 +3122,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() @@ -3218,10 +3222,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