Mercurial > hg
comparison hgext/largefiles/overrides.py @ 45348:490607efc992
merge: remove emptyactions() and use collections.defaultdict(list) instead
emptyactions() used to return a dict which was populated and passed into
applyupdates(). However, with recent changes, we no longer pass a plain dict,
instead we pass the mergeresult object.
There was only one usage of emptyactions and that too inside mergeresult object.
That usage is replaced with collections.defaultdict(list) instead.
Not sure why we were not using collections.defaultdict(list) from the beginning.
Differential Revision: https://phab.mercurial-scm.org/D8903
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Thu, 06 Aug 2020 13:27:38 +0530 |
parents | e5b4061f32be |
children | 8c466bcb0879 |
comparison
equal
deleted
inserted
replaced
45347:1aef38d973e8 | 45348:490607efc992 |
---|---|
493 dirstate = lfutil.openlfdirstate(ui, repo) | 493 dirstate = lfutil.openlfdirstate(ui, repo) |
494 | 494 |
495 orig(ui, fakerepo, *pats, **opts) | 495 orig(ui, fakerepo, *pats, **opts) |
496 else: | 496 else: |
497 orig(ui, repo, *pats, **opts) | 497 orig(ui, repo, *pats, **opts) |
498 | |
499 | |
500 # Register the MERGE_ACTION_LARGEFILE_MARK_REMOVED in emptyactions() return type | |
501 @eh.wrapfunction(merge, b'emptyactions') | |
502 def overrideemptyactions(origfn): | |
503 ret = origfn() | |
504 ret[MERGE_ACTION_LARGEFILE_MARK_REMOVED] = [] | |
505 return ret | |
506 | 498 |
507 | 499 |
508 # Before starting the manifest merge, merge.updates will call | 500 # Before starting the manifest merge, merge.updates will call |
509 # _checkunknownfile to check if there are any files in the merged-in | 501 # _checkunknownfile to check if there are any files in the merged-in |
510 # changeset that collide with unknown files in the working copy. | 502 # changeset that collide with unknown files in the working copy. |