Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 12972:7916a84c0758 stable
log: fix log -rREV FILE when REV isnt the last filerev (issue2492)
Regression from 99cafcae25d9. That previous commit is not supposed
to affect log calls without --follow, so we step out of this
codepath if follow is not True, and it's enough to fix the
regression.
When --follow is given, we fix the issue by taking into account
changesets that have a rev > maxrev to build the filegraph: even if
those files are not included in the final result, it's still needed
to walk correctly the graph from the end of the filelog to minrev, to
track accurately renames.
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Thu, 11 Nov 2010 02:10:37 +0900 |
parents | 15390d1a3cfc |
children | 6e0a9f9227bd |
comparison
equal
deleted
inserted
replaced
12971:15390d1a3cfc | 12972:7916a84c0758 |
---|---|
1178 # keep track of all ancestors of the file | 1178 # keep track of all ancestors of the file |
1179 ancestors = set([filelog.linkrev(last)]) | 1179 ancestors = set([filelog.linkrev(last)]) |
1180 | 1180 |
1181 # iterate from latest to oldest revision | 1181 # iterate from latest to oldest revision |
1182 for rev, flparentlinkrevs, copied in filerevgen(filelog, last): | 1182 for rev, flparentlinkrevs, copied in filerevgen(filelog, last): |
1183 if rev > maxrev or rev not in ancestors: | 1183 if not follow: |
1184 continue | 1184 if rev > maxrev: |
1185 # XXX insert 1327 fix here | 1185 continue |
1186 if flparentlinkrevs: | 1186 else: |
1187 ancestors.update(flparentlinkrevs) | 1187 # Note that last might not be the first interesting |
1188 # rev to us: | |
1189 # if the file has been changed after maxrev, we'll | |
1190 # have linkrev(last) > maxrev, and we still need | |
1191 # to explore the file graph | |
1192 if rev not in ancestors: | |
1193 continue | |
1194 # XXX insert 1327 fix here | |
1195 if flparentlinkrevs: | |
1196 ancestors.update(flparentlinkrevs) | |
1188 | 1197 |
1189 fncache.setdefault(rev, []).append(file_) | 1198 fncache.setdefault(rev, []).append(file_) |
1190 wanted.add(rev) | 1199 wanted.add(rev) |
1191 if copied: | 1200 if copied: |
1192 copies.append(copied) | 1201 copies.append(copied) |