comparison hgext/narrow/narrowcommands.py @ 41039:54c3b4bd01f2

merge: extract helper for creating empty "actions" dict Replicating the set of actions in multiple places is bad. Differential Revision: https://phab.mercurial-scm.org/D5472
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 21 Dec 2018 09:48:30 -0800
parents 095a0a63ad88
children ce0bc2952e2a
comparison
equal deleted inserted replaced
41038:3913223417ea 41039:54c3b4bd01f2
314 tgetter = lambda: tr 314 tgetter = lambda: tr
315 bundle2.processbundle(repo, bundle, 315 bundle2.processbundle(repo, bundle,
316 transactiongetter=tgetter) 316 transactiongetter=tgetter)
317 317
318 repo.setnewnarrowpats() 318 repo.setnewnarrowpats()
319 actions = {k: [] for k in 'a am f g cd dc r dm dg m e k p pr'.split()} 319 actions = merge.emptyactions()
320 addgaction = actions['g'].append 320 addgaction = actions['g'].append
321 321
322 mf = repo['.'].manifest().matches(newmatch) 322 mf = repo['.'].manifest().matches(newmatch)
323 for f, fn in mf.iteritems(): 323 for f, fn in mf.iteritems():
324 if f not in repo.dirstate: 324 if f not in repo.dirstate: