Mercurial > hg
comparison hgext/largefiles/overrides.py @ 46047:4b89cf08d8dc
upgrade: split definition and management of the actions from the main code
This is a second step to clarify and clean up this code. The code responsible
for definition which action exist, are possible and their compatibility if moved
into a sub module.
This clarify the main code and prepare further cleanup.
Differential Revision: https://phab.mercurial-scm.org/D9477
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 01 Dec 2020 15:11:06 +0100 |
parents | 89a2afe31e82 |
children | bb3a5c0df06b 32da58916fd0 |
comparison
equal
deleted
inserted
replaced
46046:f105c49e89cd | 46047:4b89cf08d8dc |
---|---|
35 pathutil, | 35 pathutil, |
36 pycompat, | 36 pycompat, |
37 scmutil, | 37 scmutil, |
38 smartset, | 38 smartset, |
39 subrepo, | 39 subrepo, |
40 upgrade, | |
41 url as urlmod, | 40 url as urlmod, |
42 util, | 41 util, |
42 ) | |
43 | |
44 from mercurial.upgrade_utils import ( | |
45 actions as upgrade_actions, | |
43 ) | 46 ) |
44 | 47 |
45 from . import ( | 48 from . import ( |
46 lfcommands, | 49 lfcommands, |
47 lfutil, | 50 lfutil, |
1835 ) | 1838 ) |
1836 | 1839 |
1837 return result | 1840 return result |
1838 | 1841 |
1839 | 1842 |
1840 @eh.wrapfunction(upgrade, b'preservedrequirements') | 1843 @eh.wrapfunction(upgrade_actions, b'preservedrequirements') |
1841 @eh.wrapfunction(upgrade, b'supporteddestrequirements') | 1844 @eh.wrapfunction(upgrade_actions, b'supporteddestrequirements') |
1842 def upgraderequirements(orig, repo): | 1845 def upgraderequirements(orig, repo): |
1843 reqs = orig(repo) | 1846 reqs = orig(repo) |
1844 if b'largefiles' in repo.requirements: | 1847 if b'largefiles' in repo.requirements: |
1845 reqs.add(b'largefiles') | 1848 reqs.add(b'largefiles') |
1846 return reqs | 1849 return reqs |