comparison mercurial/cmdutil.py @ 51304:f15cb5111a1e

pytype: move some type comment to proper annotation We support direct type annotations now, while pytype is starting to complains about them.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 19 Dec 2023 21:29:34 +0100
parents 9d3721552b6c
children a151fd01e98c
comparison
equal deleted inserted replaced
51303:81224afd938d 51304:f15cb5111a1e
4116 ui.status(_(b"working directory is now at %s\n") % startctx.hex()[:12]) 4116 ui.status(_(b"working directory is now at %s\n") % startctx.hex()[:12])
4117 graftstate.delete() 4117 graftstate.delete()
4118 return 0 4118 return 0
4119 4119
4120 4120
4121 def readgraftstate(repo, graftstate): 4121 def readgraftstate(
4122 # type: (Any, statemod.cmdstate) -> Dict[bytes, Any] 4122 repo: Any,
4123 graftstate: statemod.cmdstate,
4124 ) -> Dict[bytes, Any]:
4123 """read the graft state file and return a dict of the data stored in it""" 4125 """read the graft state file and return a dict of the data stored in it"""
4124 try: 4126 try:
4125 return graftstate.read() 4127 return graftstate.read()
4126 except error.CorruptedState: 4128 except error.CorruptedState:
4127 nodes = repo.vfs.read(b'graftstate').splitlines() 4129 nodes = repo.vfs.read(b'graftstate').splitlines()