diff -r 6cfaebb625d3 -r 2ecbc4ec87d8 mercurial/context.py --- a/mercurial/context.py Thu Jan 09 15:41:40 2020 -0800 +++ b/mercurial/context.py Fri Jan 10 17:03:23 2020 -0800 @@ -2445,6 +2445,9 @@ # necessary for memctx to register a deletion. return None + if branch is None: + branch = self._wrappedctx.branch() + return memctx( self._repo, parents,