##// END OF EJS Templates
dirstate: move nonnormalentries to dirstatemap...
Durham Goode -
r34334:4ac04418 default
parent child Browse files
Show More
@@ -54,20 +54,6 b' def _getfsnow(vfs):'
54 os.close(tmpfd)
54 os.close(tmpfd)
55 vfs.unlink(tmpname)
55 vfs.unlink(tmpname)
56
56
57 def nonnormalentries(dmap):
58 '''Compute the nonnormal dirstate entries from the dmap'''
59 try:
60 return parsers.nonnormalotherparententries(dmap._map)
61 except AttributeError:
62 nonnorm = set()
63 otherparent = set()
64 for fname, e in dmap.iteritems():
65 if e[0] != 'n' or e[3] == -1:
66 nonnorm.add(fname)
67 if e[0] == 'n' and e[2] == -2:
68 otherparent.add(fname)
69 return nonnorm, otherparent
70
71 class dirstate(object):
57 class dirstate(object):
72
58
73 def __init__(self, opener, ui, root, validate, sparsematchfn):
59 def __init__(self, opener, ui, root, validate, sparsematchfn):
@@ -162,13 +148,13 b' class dirstate(object):'
162
148
163 @propertycache
149 @propertycache
164 def _nonnormalset(self):
150 def _nonnormalset(self):
165 nonnorm, otherparents = nonnormalentries(self._map)
151 nonnorm, otherparents = self._map.nonnormalentries()
166 self._otherparentset = otherparents
152 self._otherparentset = otherparents
167 return nonnorm
153 return nonnorm
168
154
169 @propertycache
155 @propertycache
170 def _otherparentset(self):
156 def _otherparentset(self):
171 nonnorm, otherparents = nonnormalentries(self._map)
157 nonnorm, otherparents = self._map.nonnormalentries()
172 self._nonnormalset = nonnorm
158 self._nonnormalset = nonnorm
173 return otherparents
159 return otherparents
174
160
@@ -843,7 +829,7 b' class dirstate(object):'
843
829
844 st.write(parsers.pack_dirstate(self._map._map, self._copymap, self._pl,
830 st.write(parsers.pack_dirstate(self._map._map, self._copymap, self._pl,
845 now))
831 now))
846 self._nonnormalset, self._otherparentset = nonnormalentries(self._map)
832 self._nonnormalset, self._otherparentset = self._map.nonnormalentries()
847 st.close()
833 st.close()
848 self._lastnormaltime = 0
834 self._lastnormaltime = 0
849 self._dirty = self._dirtypl = False
835 self._dirty = self._dirtypl = False
@@ -1369,3 +1355,18 b' class dirstatemap(object):'
1369
1355
1370 def keys(self):
1356 def keys(self):
1371 return self._map.keys()
1357 return self._map.keys()
1358
1359 def nonnormalentries(self):
1360 '''Compute the nonnormal dirstate entries from the dmap'''
1361 try:
1362 return parsers.nonnormalotherparententries(self._map)
1363 except AttributeError:
1364 nonnorm = set()
1365 otherparent = set()
1366 for fname, e in self._map.iteritems():
1367 if e[0] != 'n' or e[3] == -1:
1368 nonnorm.add(fname)
1369 if e[0] == 'n' and e[2] == -2:
1370 otherparent.add(fname)
1371 return nonnorm, otherparent
1372
General Comments 0
You need to be logged in to leave comments. Login now