##// END OF EJS Templates
manifest: make copy logic local to copy()...
Martin von Zweigbergk -
r24146:dd8c891d default
parent child Browse files
Show More
@@ -10,13 +10,8 b' import mdiff, parsers, error, revlog, ut'
10 import array, struct
10 import array, struct
11
11
12 class manifestdict(dict):
12 class manifestdict(dict):
13 def __init__(self, mapping=None, flags=None):
13 def __init__(self):
14 if mapping is None:
14 self._flags = {}
15 mapping = {}
16 if flags is None:
17 flags = {}
18 dict.__init__(self, mapping)
19 self._flags = flags
20 def __setitem__(self, k, v):
15 def __setitem__(self, k, v):
21 assert v is not None
16 assert v is not None
22 dict.__setitem__(self, k, v)
17 dict.__setitem__(self, k, v)
@@ -26,7 +21,10 b' class manifestdict(dict):'
26 """Set the flags (symlink, executable) for path f."""
21 """Set the flags (symlink, executable) for path f."""
27 self._flags[f] = flags
22 self._flags[f] = flags
28 def copy(self):
23 def copy(self):
29 return manifestdict(self, dict.copy(self._flags))
24 copy = manifestdict()
25 dict.__init__(copy, self)
26 copy._flags = dict.copy(self._flags)
27 return copy
30 def intersectfiles(self, files):
28 def intersectfiles(self, files):
31 '''make a new manifestdict with the intersection of self with files
29 '''make a new manifestdict with the intersection of self with files
32
30
General Comments 0
You need to be logged in to leave comments. Login now