comparison mercurial/commit.py @ 45326:99614011892b

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.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 25 Jul 2020 16:07:38 +0200
parents 6c56277317c2
children 6de4c5647db3
comparison
equal deleted inserted replaced
45325:c6eea5804551 45326:99614011892b
113 repo = ctx.repo() 113 repo = ctx.repo()
114 p1 = ctx.p1() 114 p1 = ctx.p1()
115 115
116 writechangesetcopy, writefilecopymeta = _write_copy_meta(repo) 116 writechangesetcopy, writefilecopymeta = _write_copy_meta(repo)
117 117
118 p1copies, p2copies = None, None
119 if writechangesetcopy:
120 p1copies = ctx.p1copies()
121 p2copies = ctx.p2copies()
122 filesadded, filesremoved = None, None 118 filesadded, filesremoved = None, None
123 if ctx.manifestnode(): 119 if ctx.manifestnode():
124 # reuse an existing manifest revision 120 # reuse an existing manifest revision
125 repo.ui.debug(b'reusing known manifest\n') 121 repo.ui.debug(b'reusing known manifest\n')
126 mn = ctx.manifestnode() 122 mn = ctx.manifestnode()
142 touched = origctx.files() 138 touched = origctx.files()
143 139
144 files = metadata.ChangingFiles() 140 files = metadata.ChangingFiles()
145 if touched: 141 if touched:
146 files.update_touched(touched) 142 files.update_touched(touched)
147 if p1copies: 143 if writechangesetcopy:
148 files.update_copies_from_p1(p1copies) 144 files.update_copies_from_p1(ctx.p1copies())
149 if p2copies: 145 files.update_copies_from_p2(ctx.p2copies())
150 files.update_copies_from_p2(p2copies)
151 if filesadded: 146 if filesadded:
152 files.update_added(filesadded) 147 files.update_added(filesadded)
153 if filesremoved: 148 if filesremoved:
154 files.update_removed(filesremoved) 149 files.update_removed(filesremoved)
155 150