comparison hgext/git/gitlog.py @ 52633:86920d1f7632

git: hexdump node when passing it to sqlite in baselog.hasnode This change makes `hg heads` work. Prior to this change, the error was: $ hg heads ** unknown exception encountered, please report by visiting ** https://mercurial-scm.org/wiki/BugTracker ** Python 3.11.10 (main, Oct 31 2024, 01:10:40) [Clang 18.1.5 (https://github.com/llvm/llvm-project.git llvmorg-18.1.5-0-g617a15 ** Mercurial Distributed SCM (version 6.9.post1.dev337+hg.72af9fa34832) ** Extensions loaded: absorb, churn, git (pygit2 1.14.1), githelp, gpg, hgk, histedit, patchbomb, rebase Traceback (most recent call last): File "/home/jeffpc/src/oss/hg-gitext-test/../hg-gitext/hg", line 61, in <module> dispatch.run() ... File "/usr/home/jeffpc/src/oss/hg-gitext/mercurial/commands.py", line 3462, in heads heads += repo.branchheads(branch, start, opts.get('closed')) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/home/jeffpc/src/oss/hg-gitext/mercurial/localrepo.py", line 3469, in branchheads if not branches.hasbranch(branch): ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/home/jeffpc/src/oss/hg-gitext/mercurial/branchmap.py", line 701, in hasbranch self._verifybranch(label) File "/usr/home/jeffpc/src/oss/hg-gitext/mercurial/branchmap.py", line 670, in _verifybranch _unknownnode(n) File "/usr/home/jeffpc/src/oss/hg-gitext/mercurial/branchmap.py", line 186, in _unknownnode raise ValueError('node %s does not exist' % node.hex()) ValueError: node f2f80ac809875855ac843f9e5e7480604b5cbff5 does not exist
author Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
date Sat, 04 Jan 2025 10:38:02 -0500
parents d7368933f4b0
children 5cc8deb96b48
comparison
equal deleted inserted replaced
52632:d7368933f4b0 52633:86920d1f7632
169 return bin(t[0]) 169 return bin(t[0])
170 170
171 def hasnode(self, n): 171 def hasnode(self, n):
172 t = self._db.execute( 172 t = self._db.execute(
173 'SELECT node FROM changelog WHERE node = ?', 173 'SELECT node FROM changelog WHERE node = ?',
174 (pycompat.sysstr(n),), 174 (gitutil.togitnode(n),),
175 ).fetchone() 175 ).fetchone()
176 return t is not None 176 return t is not None
177 177
178 178
179 class baselogindex: 179 class baselogindex: