Mercurial > hg
comparison mercurial/copies.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 | d7d08337b3f6 |
children | 3a3806fe3ddf |
comparison
equal
deleted
inserted
replaced
24183:932de135041f | 24184:cd66080ef6d4 |
---|---|
147 def _computeforwardmissing(a, b): | 147 def _computeforwardmissing(a, b): |
148 """Computes which files are in b but not a. | 148 """Computes which files are in b but not a. |
149 This is its own function so extensions can easily wrap this call to see what | 149 This is its own function so extensions can easily wrap this call to see what |
150 files _forwardcopies is about to process. | 150 files _forwardcopies is about to process. |
151 """ | 151 """ |
152 missing = set(b.manifest().iterkeys()) | 152 return b.manifest().filesnotin(a.manifest()) |
153 missing.difference_update(a.manifest().iterkeys()) | |
154 return missing | |
155 | 153 |
156 def _forwardcopies(a, b): | 154 def _forwardcopies(a, b): |
157 '''find {dst@b: src@a} copy mapping where a is an ancestor of b''' | 155 '''find {dst@b: src@a} copy mapping where a is an ancestor of b''' |
158 | 156 |
159 # check for working copy | 157 # check for working copy |