comparison hgext3rd/topic/__init__.py @ 4646:7b986968700b

compat: adjust `wrapadd` for upstream Mercurial core updated the API in f385ba70e4af.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 04 Jun 2019 10:07:08 +0200
parents c4097632a1a3
children 228caeb8b7af
comparison
equal deleted inserted replaced
4644:b228672b0ff9 4646:7b986968700b
567 else: 567 else:
568 # Empty key will be dropped from extra by another hack at the changegroup level 568 # Empty key will be dropped from extra by another hack at the changegroup level
569 self._extra[constants.extrakey] = '' 569 self._extra[constants.extrakey] = ''
570 570
571 def wrapadd(orig, cl, manifest, files, desc, transaction, p1, p2, user, 571 def wrapadd(orig, cl, manifest, files, desc, transaction, p1, p2, user,
572 date=None, extra=None, p1copies=None, p2copies=None): 572 date=None, extra=None, p1copies=None, p2copies=None,
573 filesadded=None, filesremoved=None):
573 if constants.extrakey in extra and not extra[constants.extrakey]: 574 if constants.extrakey in extra and not extra[constants.extrakey]:
574 extra = extra.copy() 575 extra = extra.copy()
575 del extra[constants.extrakey] 576 del extra[constants.extrakey]
576 # hg <= 4.9 (0e41f40b01cc) 577 # hg <= 4.9 (0e41f40b01cc)
577 kwargs = {} 578 kwargs = {}
578 if p1copies is not None: 579 if p1copies is not None:
579 kwargs['p1copies'] = p1copies 580 kwargs['p1copies'] = p1copies
580 if p2copies is not None: 581 if p2copies is not None:
581 kwargs['p2copies'] = p2copies 582 kwargs['p2copies'] = p2copies
583 # hg <= 5.0 (f385ba70e4af)
584 if filesadded is not None:
585 kwargs['filesadded'] = filesadded
586 if filesremoved is not None:
587 kwargs['filesremoved'] = filesremoved
582 return orig(cl, manifest, files, desc, transaction, p1, p2, user, 588 return orig(cl, manifest, files, desc, transaction, p1, p2, user,
583 date=date, extra=extra, **kwargs) 589 date=date, extra=extra, **kwargs)
584 590
585 # revset predicates are automatically registered at loading via this symbol 591 # revset predicates are automatically registered at loading via this symbol
586 revsetpredicate = topicrevset.revsetpredicate 592 revsetpredicate = topicrevset.revsetpredicate