mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
revset: make hg log -r 'wdir()^'
work (issue4905)
This patch catches the WdirUnsupported exception to support wdir()^.
This commit is contained in:
parent
26a5b62b59
commit
6b98477968
@ -1408,7 +1408,10 @@ def p1(repo, subset, x):
|
||||
ps = set()
|
||||
cl = repo.changelog
|
||||
for r in getset(repo, fullreposet(repo), x):
|
||||
ps.add(cl.parentrevs(r)[0])
|
||||
try:
|
||||
ps.add(cl.parentrevs(r)[0])
|
||||
except error.WdirUnsupported:
|
||||
ps.add(repo[r].parents()[0].rev())
|
||||
ps -= {node.nullrev}
|
||||
# XXX we should turn this into a baseset instead of a set, smartset may do
|
||||
# some optimizations from the fact this is a baseset.
|
||||
|
@ -1221,6 +1221,15 @@ BROKEN: should be '-1'
|
||||
Test working-directory revision
|
||||
$ hg debugrevspec 'wdir()'
|
||||
2147483647
|
||||
$ hg debugrevspec 'wdir()^'
|
||||
9
|
||||
$ hg up 7
|
||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
||||
$ hg debugrevspec 'wdir()^'
|
||||
7
|
||||
For tests consistency
|
||||
$ hg up 9
|
||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
||||
$ hg debugrevspec 'tip or wdir()'
|
||||
9
|
||||
2147483647
|
||||
|
Loading…
Reference in New Issue
Block a user