Mercurial > public > mercurial-scm > hg
comparison mercurial/manifest.py @ 24184:cd66080ef6d4
copies: move code into new manifestdict.filesnotin() method
copies._computeforwardmissing() finds files in one context that is not
in the other. Let's move this code into a new method on manifestdict,
so m1.filesnotin(m2) can be optimized for various types of manifests
(we expect more types of manifests soon).
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 27 Feb 2015 13:57:37 -0800 |
parents | ba4fcd80079d |
children | feddc5284724 |
comparison
equal
deleted
inserted
replaced
24183:932de135041f | 24184:cd66080ef6d4 |
---|---|
35 ret[fn] = self[fn] | 35 ret[fn] = self[fn] |
36 flags = self._flags.get(fn, None) | 36 flags = self._flags.get(fn, None) |
37 if flags: | 37 if flags: |
38 ret._flags[fn] = flags | 38 ret._flags[fn] = flags |
39 return ret | 39 return ret |
40 | |
41 def filesnotin(self, m2): | |
42 '''Set of files in this manifest that are not in the other''' | |
43 files = set(self.iterkeys()) | |
44 files.difference_update(m2.iterkeys()) | |
45 return files | |
40 | 46 |
41 def matches(self, match): | 47 def matches(self, match): |
42 '''generate a new manifest filtered by the match argument''' | 48 '''generate a new manifest filtered by the match argument''' |
43 if match.always(): | 49 if match.always(): |
44 return self.copy() | 50 return self.copy() |