Mercurial > hg
diff hgeditor @ 33555:6755b719048c
sparse: consolidate common code for writing sparse config
In 3 functions we were writing the sparse config and updating the
working directory. In two of them we had a transaction-like process
for restoring the sparse config in case of wdir update fail.
Because the pattern is common, we've already made mistakes, and the
complexity will increase in the near future, let's consolidate the
code into a reusable function.
As part of this refactor, we end up reading the "sparse" file twice
when updating it. This is a bit sub-optimal. But I don't think it
is worth the code complexity to pass around the variables to avoid
the redundancy.
Differential Revision: https://phab.mercurial-scm.org/D109
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 17 Jul 2017 11:21:23 -0700 |
parents | 1aee2ab0f902 |
children |