Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/merge.py @ 44470:9d2b2df2c2ba
cleanup: run pyupgrade on our source tree to clean up varying things
Built with:
hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/**' | xargs pyupgrade --keep-percent-format --keep-extraneous-parens
and then blackened. pyupgrade comes from
https://github.com/asottile/pyupgrade with a patch to let me preserve
extraneous parens (which we use for marking strings that shouldn't be
translated), and lets us clean up a bunch of idioms that have cruftily
accumulated over the years.
# skip-blame no-op automated code cleanups
Differential Revision: https://phab.mercurial-scm.org/D8255
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 06 Mar 2020 13:27:41 -0500 |
parents | a45ffad9ae98 |
children | 1b8fd4af3318 |
comparison
equal
deleted
inserted
replaced
44469:ff72bd52d56a | 44470:9d2b2df2c2ba |
---|---|
1794 ) | 1794 ) |
1795 | 1795 |
1796 | 1796 |
1797 def emptyactions(): | 1797 def emptyactions(): |
1798 """create an actions dict, to be populated and passed to applyupdates()""" | 1798 """create an actions dict, to be populated and passed to applyupdates()""" |
1799 return dict( | 1799 return { |
1800 (m, []) | 1800 m: [] |
1801 for m in ( | 1801 for m in ( |
1802 ACTION_ADD, | 1802 ACTION_ADD, |
1803 ACTION_ADD_MODIFIED, | 1803 ACTION_ADD_MODIFIED, |
1804 ACTION_FORGET, | 1804 ACTION_FORGET, |
1805 ACTION_GET, | 1805 ACTION_GET, |
1812 ACTION_EXEC, | 1812 ACTION_EXEC, |
1813 ACTION_KEEP, | 1813 ACTION_KEEP, |
1814 ACTION_PATH_CONFLICT, | 1814 ACTION_PATH_CONFLICT, |
1815 ACTION_PATH_CONFLICT_RESOLVE, | 1815 ACTION_PATH_CONFLICT_RESOLVE, |
1816 ) | 1816 ) |
1817 ) | 1817 } |
1818 | 1818 |
1819 | 1819 |
1820 def applyupdates( | 1820 def applyupdates( |
1821 repo, actions, wctx, mctx, overwrite, wantfiledata, labels=None | 1821 repo, actions, wctx, mctx, overwrite, wantfiledata, labels=None |
1822 ): | 1822 ): |
2068 merged += msmerged | 2068 merged += msmerged |
2069 removed += msremoved | 2069 removed += msremoved |
2070 | 2070 |
2071 extraactions = ms.actions() | 2071 extraactions = ms.actions() |
2072 if extraactions: | 2072 if extraactions: |
2073 mfiles = set(a[0] for a in actions[ACTION_MERGE]) | 2073 mfiles = {a[0] for a in actions[ACTION_MERGE]} |
2074 for k, acts in pycompat.iteritems(extraactions): | 2074 for k, acts in pycompat.iteritems(extraactions): |
2075 actions[k].extend(acts) | 2075 actions[k].extend(acts) |
2076 if k == ACTION_GET and wantfiledata: | 2076 if k == ACTION_GET and wantfiledata: |
2077 # no filedata until mergestate is updated to provide it | 2077 # no filedata until mergestate is updated to provide it |
2078 for a in acts: | 2078 for a in acts: |