Mercurial > hg
comparison mercurial/scmutil.py @ 44452: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 | 85c4cd73996b |
children | 13da36d77a3f |
comparison
equal
deleted
inserted
replaced
44449:ff72bd52d56a | 44452:9d2b2df2c2ba |
---|---|
1455 ds.remove(f) | 1455 ds.remove(f) |
1456 | 1456 |
1457 # Merge old parent and old working dir copies | 1457 # Merge old parent and old working dir copies |
1458 oldcopies = copiesmod.pathcopies(newctx, oldctx, match) | 1458 oldcopies = copiesmod.pathcopies(newctx, oldctx, match) |
1459 oldcopies.update(copies) | 1459 oldcopies.update(copies) |
1460 copies = dict( | 1460 copies = { |
1461 (dst, oldcopies.get(src, src)) | 1461 dst: oldcopies.get(src, src) |
1462 for dst, src in pycompat.iteritems(oldcopies) | 1462 for dst, src in pycompat.iteritems(oldcopies) |
1463 ) | 1463 } |
1464 # Adjust the dirstate copies | 1464 # Adjust the dirstate copies |
1465 for dst, src in pycompat.iteritems(copies): | 1465 for dst, src in pycompat.iteritems(copies): |
1466 if src not in newctx or dst in newctx or ds[dst] != b'a': | 1466 if src not in newctx or dst in newctx or ds[dst] != b'a': |
1467 src = None | 1467 src = None |
1468 ds.copy(src, dst) | 1468 ds.copy(src, dst) |