Patchwork D12203: scmutil: revert c7e675848027 / scmutil: obsrevs is already a frozenset

login
register
mail settings
Submitter phabricator
Date Feb. 20, 2022, 12:58 a.m.
Message ID <differential-rev-PHID-DREV-5p53jtxxrd6zcrbl266y-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50540/
State New
Headers show

Comments

phabricator - Feb. 20, 2022, 12:58 a.m.
indygreg created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The reverted change breaks nearly every command for me when I'm using
  obsolescence. Specifically, I get `TypeError: unhashable type: 'set'`
  on the changed line. The deleted comment actual draws attention to this
  issue.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D12203

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -366,7 +366,9 @@ 
         obsrevs = obsolete.getrevs(repo, b'obsolete')
         if not cl.filteredrevs and not obsrevs:
             return None
-        key = (maxrev, hash(cl.filteredrevs), hash(obsrevs))
+        # TODO: obsrevs should be a frozenset, but right now obsolete.getrevs()
+        # may return a set, which is not a hashable type.
+        key = (maxrev, hash(cl.filteredrevs), hash(frozenset(obsrevs)))
     else:
         if not cl.filteredrevs:
             return None