D4828: repo: move unfiltered-repo optimization to workingctx
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Tue Oct 2 08:47:10 EDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG3c4d9edfb777: repo: move unfiltered-repo optimization to workingctx (authored by martinvonz, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D4828?vs=11538&id=11558
REVISION DETAIL
https://phab.mercurial-scm.org/D4828
AFFECTED FILES
mercurial/context.py
mercurial/localrepo.py
tests/test-histedit-obsolete.t
tests/test-single-head.t
CHANGE DETAILS
diff --git a/tests/test-single-head.t b/tests/test-single-head.t
--- a/tests/test-single-head.t
+++ b/tests/test-single-head.t
@@ -200,5 +200,4 @@
$ hg strip --config extensions.strip= --rev 'desc("c_dH0")'
saved backup bundle to $TESTTMP/client/.hg/strip-backup/fe47ea669cea-a41bf5a9-backup.hg
- warning: ignoring unknown working parent 49003e504178!
diff --git a/tests/test-histedit-obsolete.t b/tests/test-histedit-obsolete.t
--- a/tests/test-histedit-obsolete.t
+++ b/tests/test-histedit-obsolete.t
@@ -71,7 +71,6 @@
$ hg commit --amend -X . -m XXXXXX
$ hg commit --amend -X . -m b2
$ hg --hidden --config extensions.strip= strip 'desc(XXXXXX)' --no-backup
- warning: ignoring unknown working parent aba7da937030!
$ hg histedit --continue
$ hg log -G
@ 8:273c1f3b8626 c
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1228,8 +1228,7 @@
node = self.changelog.tip()
rev = self.changelog.rev(node)
return context.changectx(self, rev, node)
- elif (changeid == '.'
- or self.local() and changeid == self.dirstate.p1()):
+ elif changeid == '.':
# this is a hack to delay/avoid loading obsmarkers
# when we know that '.' won't be hidden
node = self.dirstate.p1()
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1241,7 +1241,9 @@
p = self._repo.dirstate.parents()
if p[1] == nullid:
p = p[:-1]
- return [self._repo[x] for x in p]
+ # use unfiltered repo to delay/avoid loading obsmarkers
+ unfi = self._repo.unfiltered()
+ return [changectx(self._repo, unfi.changelog.rev(n), n) for n in p]
def _fileinfo(self, path):
# populate __dict__['_manifest'] as workingctx has no _manifestdelta
To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list