# HG changeset patch # User Pierre-Yves David # Date 1595686058 -7200 # Node ID 99614011892beda1beafdf9ddf5a98ab7837ebba # Parent c6eea580455185eb06416cc9475eb7b680441d7e commitctx: directly gather p1 and p2 copies in `files` The only thing we do with the p1copies and p2copies is to pass them around, we we can gather them later and directly stored them in the `ChangingFiles` object. diff -r c6eea5804551 -r 99614011892b mercurial/commit.py --- a/mercurial/commit.py Sat Jul 25 16:02:26 2020 +0200 +++ b/mercurial/commit.py Sat Jul 25 16:07:38 2020 +0200 @@ -115,10 +115,6 @@ writechangesetcopy, writefilecopymeta = _write_copy_meta(repo) - p1copies, p2copies = None, None - if writechangesetcopy: - p1copies = ctx.p1copies() - p2copies = ctx.p2copies() filesadded, filesremoved = None, None if ctx.manifestnode(): # reuse an existing manifest revision @@ -144,10 +140,9 @@ files = metadata.ChangingFiles() if touched: files.update_touched(touched) - if p1copies: - files.update_copies_from_p1(p1copies) - if p2copies: - files.update_copies_from_p2(p2copies) + if writechangesetcopy: + files.update_copies_from_p1(ctx.p1copies()) + files.update_copies_from_p2(ctx.p2copies()) if filesadded: files.update_added(filesadded) if filesremoved: