--- a/mercurial/sparse.py Mon Dec 03 22:22:23 2018 -0800
+++ b/mercurial/sparse.py Fri Dec 21 09:48:30 2018 -0800
@@ -7,7 +7,6 @@
from __future__ import absolute_import
-import collections
import hashlib
import os
@@ -247,7 +246,7 @@
actions.append((file, None, message))
dropped.append(file)
- typeactions = collections.defaultdict(list)
+ typeactions = mergemod.emptyactions()
typeactions['r'] = actions
mergemod.applyupdates(repo, typeactions, repo[None], repo['.'], False)
@@ -380,7 +379,7 @@
fctx = repo[None][file]
actions.append((file, (fctx.flags(), False), message))
- typeactions = collections.defaultdict(list)
+ typeactions = mergemod.emptyactions()
typeactions['g'] = actions
mergemod.applyupdates(repo, typeactions, repo[None], repo['.'],
False)
@@ -483,11 +482,8 @@
dropped.append(file)
# Apply changes to disk
- typeactions = dict((m, [])
- for m in 'a f g am cd dc r dm dg m e k p pr'.split())
+ typeactions = mergemod.emptyactions()
for f, (m, args, msg) in actions.iteritems():
- if m not in typeactions:
- typeactions[m] = []
typeactions[m].append((f, args, msg))
mergemod.applyupdates(repo, typeactions, repo[None], repo['.'], False)