Bug 4396 - revset: rev(tip+1) appears wrongly (default branch)
Summary: revset: rev(tip+1) appears wrongly (default branch)
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: Mercurial (show other bugs)
Version: unspecified
Hardware: PC Linux
: urgent bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-30 09:02 UTC by Yuya Nishihara
Modified: 2014-10-23 09:57 UTC (History)
2 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuya Nishihara 2014-09-30 09:02 UTC
Bisect says the first bad revision is

changeset:   22544:bbf4f3dfd700
user:        Pierre-Yves David <pierre-yves.david@fb.com>
date:        Wed Sep 17 11:00:09 2014 -0700
summary:     revset: use `subset &` in `rev`

but actually this problem seems to be caused by fullreposet.__and__.
fullreposet.__and__ does not filter out invalid revision.

Step to reproduce:

% hg init repo
% cd repo 
% touch foo
% hg ci -Am foo
% hg debugrevspec 'rev(1)'
1
% hg log -r 'rev(1)'
changeset:   1:000000000000
parent:      -1:000000000000
user:        
date:        Thu Jan 01 00:00:00 1970 +0000
summary:
Comment 1 Pierre-Yves David 2014-09-30 11:43 UTC
Raised to "urgent" as this is a regression.
Comment 2 HG Bot 2014-10-22 19:31 UTC
Fixed by http://selenic.com/repo/hg/rev/ba89f7b542c9
Yuya Nishihara <yuya@tcha.org>
revset: have rev() drop out-of-range or filtered rev explicitly (issue4396)

The recent optimization of "and" operation relies on the assumption that
the rhs set does not contain invalid revisions.  So rev() has to remove
invalid revisions.

This is still faster than using `.filter(lambda r: r == l)`.

revset #0: rev(25)
0) wall 0.026341 comb 0.020000 user 0.020000 sys 0.000000 (best of 113)
1) wall 0.000038 comb 0.000000 user 0.000000 sys 0.000000 (best of 66567)
2) wall 0.000062 comb 0.000000 user 0.000000 sys 0.000000 (best of 43699)
(0: bbf4f3dfd700^, 1: 3.2-rc, 2: this patch)

(please test the fix)
Comment 3 Yuya Nishihara 2014-10-23 09:57 UTC
python-hglib tests passed.