comparison hgext/convert/subversion.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 c1ccefb513e4
children 8e8fd938ca07 4888adfb6235
comparison
equal deleted inserted replaced
44449:ff72bd52d56a 44452:9d2b2df2c2ba
708 # /tags/tag.1 (from /trunk:10) 708 # /tags/tag.1 (from /trunk:10)
709 # /tags/tag.1/foo (from /branches/foo:12) 709 # /tags/tag.1/foo (from /branches/foo:12)
710 # Here/tags/tag.1 discarded as well as its children. 710 # Here/tags/tag.1 discarded as well as its children.
711 # It happens with tools like cvs2svn. Such tags cannot 711 # It happens with tools like cvs2svn. Such tags cannot
712 # be represented in mercurial. 712 # be represented in mercurial.
713 addeds = dict( 713 addeds = {
714 (p, e.copyfrom_path) 714 p: e.copyfrom_path
715 for p, e in pycompat.iteritems(origpaths) 715 for p, e in pycompat.iteritems(origpaths)
716 if e.action == b'A' and e.copyfrom_path 716 if e.action == b'A' and e.copyfrom_path
717 ) 717 }
718 badroots = set() 718 badroots = set()
719 for destroot in addeds: 719 for destroot in addeds:
720 for source, sourcerev, dest in pendings: 720 for source, sourcerev, dest in pendings:
721 if not dest.startswith( 721 if not dest.startswith(
722 destroot + b'/' 722 destroot + b'/'