comparison mercurial/bundle2.py @ 46780:6266d19556ad

node: introduce nodeconstants class In preparing for moving from SHA1 hashes to a modern hash function, place nullid and other constant magic vules in a class. Provide the active set of constants in the repository and push it down. Provide nullid directly in strategic places like the repository as it is accessed very often. This changeset introduces the API change, but not the mechanical replacement of the node.py attributes itself. Differential Revision: https://phab.mercurial-scm.org/D9750
author Joerg Sonnenberger <joerg@bec.de>
date Wed, 13 Jan 2021 16:14:58 +0100
parents bc2519513ae0
children ffd3e823a7e5
comparison
equal deleted inserted replaced
46779:49fd21f32695 46780:6266d19556ad
2144 2144
2145 This part is to be used to detect push race regarding bookmark, it 2145 This part is to be used to detect push race regarding bookmark, it
2146 contains binary encoded (bookmark, node) tuple. If the local state does 2146 contains binary encoded (bookmark, node) tuple. If the local state does
2147 not marks the one in the part, a PushRaced exception is raised 2147 not marks the one in the part, a PushRaced exception is raised
2148 """ 2148 """
2149 bookdata = bookmarks.binarydecode(inpart) 2149 bookdata = bookmarks.binarydecode(op.repo, inpart)
2150 2150
2151 msgstandard = ( 2151 msgstandard = (
2152 b'remote repository changed while pushing - please try again ' 2152 b'remote repository changed while pushing - please try again '
2153 b'(bookmark "%s" move from %s to %s)' 2153 b'(bookmark "%s" move from %s to %s)'
2154 ) 2154 )
2374 suitable for pushing. 2374 suitable for pushing.
2375 2375
2376 When mode is 'records', the information is recorded into the 'bookmarks' 2376 When mode is 'records', the information is recorded into the 'bookmarks'
2377 records of the bundle operation. This behavior is suitable for pulling. 2377 records of the bundle operation. This behavior is suitable for pulling.
2378 """ 2378 """
2379 changes = bookmarks.binarydecode(inpart) 2379 changes = bookmarks.binarydecode(op.repo, inpart)
2380 2380
2381 pushkeycompat = op.repo.ui.configbool( 2381 pushkeycompat = op.repo.ui.configbool(
2382 b'server', b'bookmarks-pushkey-compat' 2382 b'server', b'bookmarks-pushkey-compat'
2383 ) 2383 )
2384 bookmarksmode = op.modes.get(b'bookmarks', b'apply') 2384 bookmarksmode = op.modes.get(b'bookmarks', b'apply')