##// END OF EJS Templates
dirstate: deprecate calling `setbranch` without a transaction parameter...
marmoute -
r51161:307c155e default
parent child Browse files
Show More
@@ -43,6 +43,9 b' from .interfaces import ('
43 43 parsers = policy.importmod('parsers')
44 44 rustmod = policy.importrust('dirstate')
45 45
46 # use to detect lack of a parameter
47 SENTINEL = object()
48
46 49 HAS_FAST_DIRSTATE_V2 = rustmod is not None
47 50
48 51 propertycache = util.propertycache
@@ -621,8 +624,12 b' class dirstate:'
621 624 fold_p2 = oldp2 != nullid and p2 == nullid
622 625 return self._map.setparents(p1, p2, fold_p2=fold_p2)
623 626
624 def setbranch(self, branch, transaction=None):
627 def setbranch(self, branch, transaction=SENTINEL):
625 628 self.__class__._branch.set(self, encoding.fromlocal(branch))
629 if transaction is SENTINEL:
630 msg = b"setbranch needs a `transaction` argument"
631 self._ui.deprecwarn(msg, b'6.5')
632 transaction = None
626 633 if transaction is not None:
627 634 self._setup_tr_abort(transaction)
628 635 transaction.addfilegenerator(
General Comments 0
You need to be logged in to leave comments. Login now