Mercurial > hg
comparison mercurial/dirstatemap.py @ 47904:822c67420c77
dirstatemap: use the default code to handle "merged" case
This simplify the conditionnal a bit since most of it is handled by the common
code.
Differential Revision: https://phab.mercurial-scm.org/D11329
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 16 Jul 2021 17:32:40 +0200 |
parents | 6816ae362ddd |
children | c0d6a59a7704 |
comparison
equal
deleted
inserted
replaced
47903:6816ae362ddd | 47904:822c67420c77 |
---|---|
258 self.dropfile(filename) | 258 self.dropfile(filename) |
259 return | 259 return |
260 elif merged: | 260 elif merged: |
261 # XXX might be merged and removed ? | 261 # XXX might be merged and removed ? |
262 entry = self.get(filename) | 262 entry = self.get(filename) |
263 if entry is not None and entry.tracked: | 263 if entry is None or not entry.tracked: |
264 # XXX mostly replicate dirstate.other parent. We should get | 264 # XXX mostly replicate dirstate.other parent. We should get |
265 # the higher layer to pass us more reliable data where `merged` | 265 # the higher layer to pass us more reliable data where `merged` |
266 # actually mean merged. Dropping the else clause will show | 266 # actually mean merged. Dropping this clause will show failure |
267 # failure in `test-graft.t` | 267 # in `test-graft.t` |
268 self.addfile(filename, merged=True) | 268 merged = False |
269 return | 269 clean_p2 = True |
270 else: | |
271 self.addfile(filename, from_p2=True) | |
272 return | |
273 elif not (p1_tracked or p2_tracked) and wc_tracked: | 270 elif not (p1_tracked or p2_tracked) and wc_tracked: |
274 pass # file is added, nothing special to adjust | 271 pass # file is added, nothing special to adjust |
275 elif (p1_tracked or p2_tracked) and not wc_tracked: | 272 elif (p1_tracked or p2_tracked) and not wc_tracked: |
276 pass | 273 pass |
277 elif clean_p2 and wc_tracked: | 274 elif clean_p2 and wc_tracked: |