Mercurial > public > mercurial-scm > hg
comparison mercurial/sparse.py @ 45295:6a8eafaeff3b
sparse: add comment for an if condition which I tried to refactor
I tried to refactor this if condition and make it part of the if-else above but
tests failed. I decided to add a comment about the check we are doing and why
it's a separate if.
Differential Revision: https://phab.mercurial-scm.org/D8833
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Fri, 24 Jul 2020 23:49:08 +0530 |
parents | 30f3e278c5d7 |
children | b9b055f15035 |
comparison
equal
deleted
inserted
replaced
45294:30f3e278c5d7 | 45295:6a8eafaeff3b |
---|---|
405 elif type == mergestatemod.ACTION_FORGET: | 405 elif type == mergestatemod.ACTION_FORGET: |
406 prunedactions[file] = action | 406 prunedactions[file] = action |
407 elif file in wctx: | 407 elif file in wctx: |
408 prunedactions[file] = (mergestatemod.ACTION_REMOVE, args, msg) | 408 prunedactions[file] = (mergestatemod.ACTION_REMOVE, args, msg) |
409 | 409 |
410 # in case or rename on one side, it is possible that f1 might not | |
411 # be present in sparse checkout we should include it | |
412 # TODO: should we do the same for f2? | |
413 # exists as a separate check because file can be in sparse and hence | |
414 # if we try to club this condition in above `elif type == ACTION_MERGE` | |
415 # it won't be triggered | |
410 if branchmerge and type == mergestatemod.ACTION_MERGE: | 416 if branchmerge and type == mergestatemod.ACTION_MERGE: |
411 f1, f2, fa, move, anc = args | 417 f1, f2, fa, move, anc = args |
412 if not sparsematch(f1): | 418 if not sparsematch(f1): |
413 temporaryfiles.append(f1) | 419 temporaryfiles.append(f1) |
414 | 420 |