Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commit.py @ 45615:094a91a183f1
changing-files: record merged files at commit time
The data is easy to gather at commit time, and we need it for changeset centric
copy tracing. Right now, it is not persisted so we cannot use it. However we
will fix this part very soon, gathering something to persist was necessary
first.
Differential Revision: https://phab.mercurial-scm.org/D9088
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 25 Sep 2020 02:01:32 +0200 |
parents | 479cce8c9882 |
children | 64a4b85c4a00 |
comparison
equal
deleted
inserted
replaced
45614:e5578dbe36cb | 45615:094a91a183f1 |
---|---|
179 repo, fctx, m1, m2, linkrev, tr, writefilecopymeta, ms | 179 repo, fctx, m1, m2, linkrev, tr, writefilecopymeta, ms |
180 ) | 180 ) |
181 if is_touched: | 181 if is_touched: |
182 if is_touched == 'added': | 182 if is_touched == 'added': |
183 files.mark_added(f) | 183 files.mark_added(f) |
184 elif is_touched == 'merged': | |
185 files.mark_merged(f) | |
184 else: | 186 else: |
185 files.mark_touched(f) | 187 files.mark_touched(f) |
186 m.setflag(f, fctx.flags()) | 188 m.setflag(f, fctx.flags()) |
187 except OSError: | 189 except OSError: |
188 repo.ui.warn(_(b"trouble committing %s!\n") % uipathfn(f)) | 190 repo.ui.warn(_(b"trouble committing %s!\n") % uipathfn(f)) |
345 force_new_node = True | 347 force_new_node = True |
346 # is the file changed? | 348 # is the file changed? |
347 text = fctx.data() | 349 text = fctx.data() |
348 if fparent2 != nullid or meta or flog.cmp(fparent1, text) or force_new_node: | 350 if fparent2 != nullid or meta or flog.cmp(fparent1, text) or force_new_node: |
349 if touched is None: # do not overwrite added | 351 if touched is None: # do not overwrite added |
350 touched = 'modified' | 352 if fparent2 == nullid: |
353 touched = 'modified' | |
354 else: | |
355 touched = 'merged' | |
351 fnode = flog.add(text, meta, tr, linkrev, fparent1, fparent2) | 356 fnode = flog.add(text, meta, tr, linkrev, fparent1, fparent2) |
352 # are just the flags changed during merge? | 357 # are just the flags changed during merge? |
353 elif fname in manifest1 and manifest1.flags(fname) != fctx.flags(): | 358 elif fname in manifest1 and manifest1.flags(fname) != fctx.flags(): |
354 touched = 'modified' | 359 touched = 'modified' |
355 fnode = fparent1 | 360 fnode = fparent1 |