Mercurial > hg
changeset 32403:a28c76e1cea9
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.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 19 May 2017 19:12:06 +0530 |
parents | c8e10565a113 |
children | e8c043375b53 |
files | mercurial/revlog.py |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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]