Mercurial > hg
comparison mercurial/copies.py @ 45942:89a2afe31e82
formating: upgrade to black 20.8b1
This required a couple of small tweaks to un-confuse black, but now it
works. Big formatting changes come from:
* Dramatically improved collection-splitting logic upstream
* Black having a strong (correct IMO) opinion that """ is better than '''
Differential Revision: https://phab.mercurial-scm.org/D9430
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Fri, 27 Nov 2020 17:03:29 -0500 |
parents | 06b64fabf91c |
children | a66568f20ddc |
comparison
equal
deleted
inserted
replaced
45941:346af7687c6f | 45942:89a2afe31e82 |
---|---|
700 else: | 700 else: |
701 return _fullcopytracing(repo, c1, c2, base) | 701 return _fullcopytracing(repo, c1, c2, base) |
702 | 702 |
703 | 703 |
704 def _isfullcopytraceable(repo, c1, base): | 704 def _isfullcopytraceable(repo, c1, base): |
705 """ Checks that if base, source and destination are all no-public branches, | 705 """Checks that if base, source and destination are all no-public branches, |
706 if yes let's use the full copytrace algorithm for increased capabilities | 706 if yes let's use the full copytrace algorithm for increased capabilities |
707 since it will be fast enough. | 707 since it will be fast enough. |
708 | 708 |
709 `experimental.copytrace.sourcecommitlimit` can be used to set a limit for | 709 `experimental.copytrace.sourcecommitlimit` can be used to set a limit for |
710 number of changesets from c1 to base such that if number of changesets are | 710 number of changesets from c1 to base such that if number of changesets are |
768 self.renamedelete = {} if renamedelete is None else renamedelete | 768 self.renamedelete = {} if renamedelete is None else renamedelete |
769 self.dirmove = {} if dirmove is None else dirmove | 769 self.dirmove = {} if dirmove is None else dirmove |
770 self.movewithdir = {} if movewithdir is None else movewithdir | 770 self.movewithdir = {} if movewithdir is None else movewithdir |
771 | 771 |
772 def __repr__(self): | 772 def __repr__(self): |
773 return ( | 773 return '<branch_copies\n copy=%r\n renamedelete=%r\n dirmove=%r\n movewithdir=%r\n>' % ( |
774 '<branch_copies\n copy=%r\n renamedelete=%r\n dirmove=%r\n movewithdir=%r\n>' | 774 self.copy, |
775 % (self.copy, self.renamedelete, self.dirmove, self.movewithdir,) | 775 self.renamedelete, |
776 self.dirmove, | |
777 self.movewithdir, | |
776 ) | 778 ) |
777 | 779 |
778 | 780 |
779 def _fullcopytracing(repo, c1, c2, base): | 781 def _fullcopytracing(repo, c1, c2, base): |
780 """ The full copytracing algorithm which finds all the new files that were | 782 """The full copytracing algorithm which finds all the new files that were |
781 added from merge base up to the top commit and for each file it checks if | 783 added from merge base up to the top commit and for each file it checks if |
782 this file was copied from another file. | 784 this file was copied from another file. |
783 | 785 |
784 This is pretty slow when a lot of changesets are involved but will track all | 786 This is pretty slow when a lot of changesets are involved but will track all |
785 the copies. | 787 the copies. |
965 | 967 |
966 return dirmove, movewithdir | 968 return dirmove, movewithdir |
967 | 969 |
968 | 970 |
969 def _heuristicscopytracing(repo, c1, c2, base): | 971 def _heuristicscopytracing(repo, c1, c2, base): |
970 """ Fast copytracing using filename heuristics | 972 """Fast copytracing using filename heuristics |
971 | 973 |
972 Assumes that moves or renames are of following two types: | 974 Assumes that moves or renames are of following two types: |
973 | 975 |
974 1) Inside a directory only (same directory name but different filenames) | 976 1) Inside a directory only (same directory name but different filenames) |
975 2) Move from one directory to another | 977 2) Move from one directory to another |