comparison mercurial/revset.py @ 32404:e8c043375b53

revset: make `hg log -r 'wdir()^'` work (issue4905) This patch catches the WdirUnsupported exception to support wdir()^.
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 19 May 2017 20:06:45 +0530
parents bd872f64a8ba
children bb5dc19484b8
comparison
equal deleted inserted replaced
32403:a28c76e1cea9 32404:e8c043375b53
1406 return baseset() 1406 return baseset()
1407 1407
1408 ps = set() 1408 ps = set()
1409 cl = repo.changelog 1409 cl = repo.changelog
1410 for r in getset(repo, fullreposet(repo), x): 1410 for r in getset(repo, fullreposet(repo), x):
1411 ps.add(cl.parentrevs(r)[0]) 1411 try:
1412 ps.add(cl.parentrevs(r)[0])
1413 except error.WdirUnsupported:
1414 ps.add(repo[r].parents()[0].rev())
1412 ps -= {node.nullrev} 1415 ps -= {node.nullrev}
1413 # XXX we should turn this into a baseset instead of a set, smartset may do 1416 # XXX we should turn this into a baseset instead of a set, smartset may do
1414 # some optimizations from the fact this is a baseset. 1417 # some optimizations from the fact this is a baseset.
1415 return subset & ps 1418 return subset & ps
1416 1419