Mercurial > hg-stable
comparison tests/test-context.py @ 23709:33e5431684c0
context: make unknown/ignored/clean of cached status empty for equivalence
Before this patch, "workingctx.status" caches the result of
"dirstate.status" directly into "self._status".
But "dirstate.status" is invoked with False "list*" arguments in
normal "self._status" accessing route, and this makes
"unknown"/"ignored"/"clean" of status empty.
This may cause unexpected result of code paths internally accessing to
them (accessors for external usage are already removed by previous patch).
This patch makes "unknown"/"ignored"/"clean" of cached status empty
for equivalence. Making them empty is executed only when at least one
of "unknown", "ignored" or "clean" has files, for efficiency.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Wed, 31 Dec 2014 17:55:43 +0900 |
parents | a4958cdb2202 |
children | 1e6fb8db666e |
comparison
equal
deleted
inserted
replaced
23708:a9f826c3eaf9 | 23709:33e5431684c0 |
---|---|
81 print '== checking workingctx.status:' | 81 print '== checking workingctx.status:' |
82 | 82 |
83 wctx = repo[None] | 83 wctx = repo[None] |
84 print 'wctx._status=%s' % (str(wctx._status)) | 84 print 'wctx._status=%s' % (str(wctx._status)) |
85 | 85 |
86 print '=== with "pattern match":' | |
86 print actx1.status(other=wctx, | 87 print actx1.status(other=wctx, |
87 match=scmutil.matchfiles(repo, ['bar-m', 'foo'])) | 88 match=scmutil.matchfiles(repo, ['bar-m', 'foo'])) |
88 print 'wctx._status=%s' % (str(wctx._status)) | 89 print 'wctx._status=%s' % (str(wctx._status)) |
89 print actx2.status(other=wctx, | 90 print actx2.status(other=wctx, |
90 match=scmutil.matchfiles(repo, ['bar-m', 'foo'])) | 91 match=scmutil.matchfiles(repo, ['bar-m', 'foo'])) |
91 print 'wctx._status=%s' % (str(wctx._status)) | 92 print 'wctx._status=%s' % (str(wctx._status)) |
93 | |
94 print '=== with "always match" and "listclean=True":' | |
95 print actx1.status(other=wctx, listclean=True) | |
96 print 'wctx._status=%s' % (str(wctx._status)) | |
97 print actx2.status(other=wctx, listclean=True) | |
98 print 'wctx._status=%s' % (str(wctx._status)) |