Comments
Patch
@@ -835,12 +835,13 @@ def filelog(repo, subset, x):
# and be in the other 'else' clause,
# - all versions of the revision are hidden.
if lowesthead is None:
lowesthead = {}
for h in repo.heads():
- fnode = repo[h].manifest()[f]
- lowesthead[fl.rev(fnode)] = h
+ fnode = repo[h].manifest().get(f)
+ if fnode is not None:
+ lowesthead[fl.rev(fnode)] = h
headrev = lowesthead.get(fr)
if headrev is None:
# content is nowhere unfiltered
continue
rev = repo[headrev][f].introrev()
@@ -1742,5 +1742,61 @@ Even when a head revision is linkrev-sha
date: Thu Jan 01 00:00:00 1970 +0000
summary: content1
$ cd ..
+
+Even when the file revision is missing from some head:
+
+ $ hg init issue4490
+ $ cd issue4490
+ $ echo '[experimental]' >> .hg/hgrc
+ $ echo 'evolution=createmarkers' >> .hg/hgrc
+ $ echo a > a
+ $ hg ci -Am0
+ adding a
+ $ echo b > b
+ $ hg ci -Am1
+ adding b
+ $ echo B > b
+ $ hg ci --amend -m 1
+ $ hg up 0
+ 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ echo c > c
+ $ hg ci -Am2
+ adding c
+ created new head
+ $ hg up 'head() and not .'
+ 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
+ $ hg log -G
+ o changeset: 4:db815d6d32e6
+ | tag: tip
+ | parent: 0:f7b1eb17ad24
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | summary: 2
+ |
+ | @ changeset: 3:9bc8ce7f9356
+ |/ parent: 0:f7b1eb17ad24
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | summary: 1
+ |
+ o changeset: 0:f7b1eb17ad24
+ user: test
+ date: Thu Jan 01 00:00:00 1970 +0000
+ summary: 0
+
+ $ hg log -f -G b
+ @ changeset: 3:9bc8ce7f9356
+ | parent: 0:f7b1eb17ad24
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | summary: 1
+ |
+ $ hg log -G b
+ @ changeset: 3:9bc8ce7f9356
+ | parent: 0:f7b1eb17ad24
+ | user: test
+ | date: Thu Jan 01 00:00:00 1970 +0000
+ | summary: 1
+ |