mirror of
https://github.com/lilydjwg/archrepo2.git
synced 2025-03-10 12:02:43 +00:00
multiple actions to same package, let's do latter
That is, existing + add + remove = removed
This commit is contained in:
parent
7fea77f5ae
commit
36623c805e
1 changed files with 4 additions and 6 deletions
|
@ -198,16 +198,14 @@ class RepoMan:
|
||||||
actiondict[act.name] = act
|
actiondict[act.name] = act
|
||||||
else:
|
else:
|
||||||
oldact = actiondict[act.name]
|
oldact = actiondict[act.name]
|
||||||
if oldact == act and oldact.action != act.action:
|
if oldact != act:
|
||||||
# same package, opposite actions, do nothing
|
# different packages, do the latter, but record the former
|
||||||
del actiondict[act.name]
|
|
||||||
else:
|
|
||||||
# take the later action, but record the former
|
|
||||||
try:
|
try:
|
||||||
actiondict[act.name].callback(state=0)
|
actiondict[act.name].callback(state=0)
|
||||||
except:
|
except:
|
||||||
logger.exception('failed to run action %r.', actiondict[act.name])
|
logger.exception('failed to run action %r.', actiondict[act.name])
|
||||||
actiondict[act.name] = act
|
# same package, do the latter, and discard the forter
|
||||||
|
actiondict[act.name] = act
|
||||||
toadd = [(x.path, x.callback) for x in actiondict.values() if x.action == 'add']
|
toadd = [(x.path, x.callback) for x in actiondict.values() if x.action == 'add']
|
||||||
toremove = [(x.name, x.callback) for x in actiondict.values() if x.action == 'remove']
|
toremove = [(x.name, x.callback) for x in actiondict.values() if x.action == 'remove']
|
||||||
self._do_add(toadd)
|
self._do_add(toadd)
|
||||||
|
|
Loading…
Add table
Reference in a new issue