# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1596459780 -19800 # Node ID 9320f66854f61623ded2385484f2d95b38922096 # Parent 72b8c082676bb04a69a519e4342a27bfff392160 sparse: replace merge action values with mergestate.ACTION_* constants Having bytestrings like `b'r'` makes it hard to understand for people who don't know the code much or looking at it for the first time. Differential Revision: https://phab.mercurial-scm.org/D8881 diff -r 72b8c082676b -r 9320f66854f6 mercurial/sparse.py --- a/mercurial/sparse.py Mon Aug 03 17:58:18 2020 +0530 +++ b/mercurial/sparse.py Mon Aug 03 18:33:00 2020 +0530 @@ -275,7 +275,7 @@ for file in tempincludes: if file in dirstate and not sparsematch(file): message = _(b'dropping temporarily included sparse files') - mresult.addfile(file, b'r', None, message) + mresult.addfile(file, mergestatemod.ACTION_REMOVE, None, message) dropped.append(file) mergemod.applyupdates( @@ -516,17 +516,19 @@ if (new and not old) or (old and new and not file in dirstate): fl = mf.flags(file) if repo.wvfs.exists(file): - mresult.addfile(file, b'e', (fl,), b'') + mresult.addfile(file, mergestatemod.ACTION_EXEC, (fl,), b'') lookup.append(file) else: - mresult.addfile(file, b'g', (fl, False), b'') + mresult.addfile( + file, mergestatemod.ACTION_GET, (fl, False), b'' + ) added.append(file) # Drop files that are newly excluded, or that still exist in # the dirstate. elif (old and not new) or (not old and not new and file in dirstate): dropped.append(file) if file not in pending: - mresult.addfile(file, b'r', [], b'') + mresult.addfile(file, mergestatemod.ACTION_REMOVE, [], b'') # Verify there are no pending changes in newly included files abort = False