# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1495201326 -19800 # Node ID a28c76e1cea98c3f7ac227dbd9853844132e6165 # Parent c8e10565a113f994271c2d0d18355340f7db5ef6 revlog: raise WdirUnsupported when wdirrev is passed revlog.parentrevs() is called while evaluating ^ operator in revsets. When wdir is passed, it raises IndexError. This patch raises WdirUnsupported if wdir is passed in the function. The error will be caugth in future patches. diff -r c8e10565a113 -r a28c76e1cea9 mercurial/revlog.py --- a/mercurial/revlog.py Fri May 19 19:10:37 2017 +0530 +++ b/mercurial/revlog.py Fri May 19 19:12:06 2017 +0530 @@ -26,6 +26,7 @@ hex, nullid, nullrev, + wdirrev, ) from .i18n import _ from . import ( @@ -481,7 +482,12 @@ return self.index[rev][4] def parentrevs(self, rev): - return self.index[rev][5:7] + try: + return self.index[rev][5:7] + except IndexError: + if rev == wdirrev: + raise error.WdirUnsupported + raise def node(self, rev): return self.index[rev][7]