From patchwork Wed Apr 28 15:08:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D10527: git: consistently use str for parents when rebuilding the index database From: phabricator X-Patchwork-Id: 48844 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 28 Apr 2021 15:08:28 +0000 mharbison72 created this revision. Herald added a reviewer: durin42. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. pulkit accepted this revision. This revision is now accepted and ready to land. REVISION SUMMARY The tests show no changes, but when these values are overwritten shortly after when a git commit object is available, that uses str. It seems better to use that for consistency. It does materially affect the database though, because the old value stored was `X'3030..3030'` and is now '00..00' when the changelog table is dumped in sqlite3. There is one query that specifies the parents, but it passes the non null hashes as str, so it worked as expected. That likely explains the lack of test changes. REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL https://phab.mercurial-scm.org/D10527 AFFECTED FILES hgext/git/index.py CHANGE DETAILS To: mharbison72, durin42, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/hgext/git/index.py b/hgext/git/index.py --- a/hgext/git/index.py +++ b/hgext/git/index.py @@ -6,7 +6,6 @@ from mercurial.i18n import _ from mercurial.node import ( - nullhex, nullid, ) @@ -281,7 +280,7 @@ for pos, commit in enumerate(walker): if prog is not None: prog.update(pos) - p1 = p2 = nullhex + p1 = p2 = gitutil.nullgit if len(commit.parents) > 2: raise error.ProgrammingError( (