Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commit.py @ 45957: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 | 330c258fe7ca |
children | d6fa9fbd375d 72f5280e33b6 |
comparison
equal
deleted
inserted
replaced
45956:346af7687c6f | 45957:89a2afe31e82 |
---|---|
96 ctx.date(), | 96 ctx.date(), |
97 extra, | 97 extra, |
98 ) | 98 ) |
99 xp1, xp2 = p1.hex(), p2 and p2.hex() or b'' | 99 xp1, xp2 = p1.hex(), p2 and p2.hex() or b'' |
100 repo.hook( | 100 repo.hook( |
101 b'pretxncommit', throw=True, node=hex(n), parent1=xp1, parent2=xp2, | 101 b'pretxncommit', |
102 throw=True, | |
103 node=hex(n), | |
104 parent1=xp1, | |
105 parent2=xp2, | |
102 ) | 106 ) |
103 # set the new commit is proper phase | 107 # set the new commit is proper phase |
104 targetphase = subrepoutil.newcommitphase(repo.ui, ctx) | 108 targetphase = subrepoutil.newcommitphase(repo.ui, ctx) |
105 | 109 |
106 # prevent unmarking changesets as public on recommit | 110 # prevent unmarking changesets as public on recommit |
152 | 156 |
153 return mn, files | 157 return mn, files |
154 | 158 |
155 | 159 |
156 def _get_salvaged(repo, ms, ctx): | 160 def _get_salvaged(repo, ms, ctx): |
157 """ returns a list of salvaged files | 161 """returns a list of salvaged files |
158 | 162 |
159 returns empty list if config option which process salvaged files are | 163 returns empty list if config option which process salvaged files are |
160 not enabled """ | 164 not enabled""" |
161 salvaged = [] | 165 salvaged = [] |
162 copy_sd = repo.filecopiesmode == b'changeset-sidedata' | 166 copy_sd = repo.filecopiesmode == b'changeset-sidedata' |
163 if copy_sd and len(ctx.parents()) > 1: | 167 if copy_sd and len(ctx.parents()) > 1: |
164 if ms.active(): | 168 if ms.active(): |
165 for fname in sorted(ms.allextras().keys()): | 169 for fname in sorted(ms.allextras().keys()): |
236 | 240 |
237 return mn | 241 return mn |
238 | 242 |
239 | 243 |
240 def _filecommit( | 244 def _filecommit( |
241 repo, fctx, manifest1, manifest2, linkrev, tr, includecopymeta, ms, | 245 repo, |
246 fctx, | |
247 manifest1, | |
248 manifest2, | |
249 linkrev, | |
250 tr, | |
251 includecopymeta, | |
252 ms, | |
242 ): | 253 ): |
243 """ | 254 """ |
244 commit an individual file as part of a larger transaction | 255 commit an individual file as part of a larger transaction |
245 | 256 |
246 input: | 257 input: |