diff hgext/git/gitlog.py @ 52658: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
line wrap: on
line diff
--- a/hgext/git/gitlog.py	Sat Jan 04 09:38:51 2025 -0500
+++ b/hgext/git/gitlog.py	Sat Jan 04 10:38:02 2025 -0500
@@ -171,7 +171,7 @@
     def hasnode(self, n):
         t = self._db.execute(
             'SELECT node FROM changelog WHERE node = ?',
-            (pycompat.sysstr(n),),
+            (gitutil.togitnode(n),),
         ).fetchone()
         return t is not None