# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2020-08-03 13:03:00 # 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 --git a/mercurial/sparse.py b/mercurial/sparse.py --- a/mercurial/sparse.py +++ b/mercurial/sparse.py @@ -275,7 +275,7 @@ def prunetemporaryincludes(repo): 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 @@ def refreshwdir(repo, origstatus, origsp 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