revlog: raise error.WdirUnsupported from revlog.node() if wdirrev is passed
When we try to run, 'hg debugrevspec 'branch(wdir())'', it throws an index error
and blows up. Lets raise the WdirUnsupported if wdir() is passed so that we can
catch that later.
--- a/mercurial/revlog.py Tue May 23 01:22:33 2017 +0530
+++ b/mercurial/revlog.py Tue May 23 01:30:36 2017 +0530
@@ -490,7 +490,12 @@
raise
def node(self, rev):
- return self.index[rev][7]
+ try:
+ return self.index[rev][7]
+ except IndexError:
+ if rev == wdirrev:
+ raise error.WdirUnsupported
+ raise
# Derived from index values.