Mercurial > public > mercurial-scm > hg
comparison mercurial/copies.py @ 42228:df7ad90edbd4
copies: delete a redundant cleanup step in _chain()
The check is redundant since d5edb5d3a337 (copies: filter out copies
when target is not in destination manifest, 2019-02-14). To test that
hypothesis, I made this change in the commit that commit, but all
tests still passed. I think the case was necessary before then, we
just didn't have tests for it.
Differential Revision: https://phab.mercurial-scm.org/D6275
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 18 Apr 2019 00:05:05 -0700 |
parents | d1c2688eda80 |
children | 5a3979529740 |
comparison
equal
deleted
inserted
replaced
42227:d1c2688eda80 | 42228:df7ad90edbd4 |
---|---|
132 if v in t: | 132 if v in t: |
133 # found a chain, i.e. cases 3 & 4. | 133 # found a chain, i.e. cases 3 & 4. |
134 if t[v] != k: | 134 if t[v] != k: |
135 # file wasn't renamed back to itself (i.e. case 4, not 3) | 135 # file wasn't renamed back to itself (i.e. case 4, not 3) |
136 t[k] = t[v] | 136 t[k] = t[v] |
137 if v not in dst: | |
138 # chain was a rename, not a copy | |
139 # this deletes the copy for 'y' in case 4 | |
140 del t[v] | |
141 if v in src: | 137 if v in src: |
142 # file is a copy of an existing file, i.e. case 6. | 138 # file is a copy of an existing file, i.e. case 6. |
143 t[k] = v | 139 t[k] = v |
144 | 140 |
145 for k, v in list(t.items()): | 141 for k, v in list(t.items()): |