comparison tests/test-context.py @ 23712:bfce25d25c96

context: override _dirstatestatus in workingcommitctx for correct matching Before this patch, the result of "status()" on "workingcommitctx" may incorrectly contain files other than ones to be committed, because "workingctx._dirstatestatus()" returns the result of "dirstate.status()" directly. For correct matching, this patch overrides "_dirstatestatus" in "workingcommitctx" and makes it return matched files only in "self._status". This patch uses empty list for "deleted", "unknown" and "ignored" of status, because status between "changectx"s also makes them empty.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 31 Dec 2014 17:55:43 +0900
parents 1e6fb8db666e
children d8e0c591781c
comparison
equal deleted inserted replaced
23711:1e6fb8db666e 23712:bfce25d25c96
106 [], [], [], []), 106 [], [], [], []),
107 text='', date='0 0') 107 text='', date='0 0')
108 print 'wcctx._status=%s' % (str(wcctx._status)) 108 print 'wcctx._status=%s' % (str(wcctx._status))
109 109
110 print '=== with "always match":' 110 print '=== with "always match":'
111 actx1.status(other=wcctx) 111 print actx1.status(other=wcctx)
112 print 'wcctx._status=%s' % (str(wcctx._status)) 112 print 'wcctx._status=%s' % (str(wcctx._status))
113 actx2.status(other=wcctx) 113 print actx2.status(other=wcctx)
114 print 'wcctx._status=%s' % (str(wcctx._status)) 114 print 'wcctx._status=%s' % (str(wcctx._status))
115 115
116 print '=== with "always match" and "listclean=True":' 116 print '=== with "always match" and "listclean=True":'
117 actx1.status(other=wcctx, listclean=True) 117 print actx1.status(other=wcctx, listclean=True)
118 print 'wcctx._status=%s' % (str(wcctx._status)) 118 print 'wcctx._status=%s' % (str(wcctx._status))
119 actx2.status(other=wcctx, listclean=True) 119 print actx2.status(other=wcctx, listclean=True)
120 print 'wcctx._status=%s' % (str(wcctx._status)) 120 print 'wcctx._status=%s' % (str(wcctx._status))
121
122 print '=== with "pattern match":'
123 print actx1.status(other=wcctx,
124 match=scmutil.matchfiles(repo, ['bar-m', 'foo']))
125 print 'wcctx._status=%s' % (str(wcctx._status))
126 print actx2.status(other=wcctx,
127 match=scmutil.matchfiles(repo, ['bar-m', 'foo']))
128 print 'wcctx._status=%s' % (str(wcctx._status))
129
130 print '=== with "pattern match" and "listclean=True":'
131 print actx1.status(other=wcctx,
132 match=scmutil.matchfiles(repo, ['bar-r', 'foo']),
133 listclean=True)
134 print 'wcctx._status=%s' % (str(wcctx._status))
135 print actx2.status(other=wcctx,
136 match=scmutil.matchfiles(repo, ['bar-r', 'foo']),
137 listclean=True)
138 print 'wcctx._status=%s' % (str(wcctx._status))