Mercurial > public > mercurial-scm > hg
diff mercurial/dirstate.py @ 51270:79cd29d598af
dirstate: make the `transaction` argument of `setbranch` mandatory
This is deprecated since 6.4. We should drop it now.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 12 Dec 2023 17:08:45 +0100 |
parents | 88ef80210d67 |
children | 865efc020c33 eb11153c1698 |
line wrap: on
line diff
--- a/mercurial/dirstate.py Wed Dec 20 14:59:31 2023 +0100 +++ b/mercurial/dirstate.py Tue Dec 12 17:08:45 2023 +0100 @@ -42,9 +42,6 @@ parsers = policy.importmod('parsers') rustmod = policy.importrust('dirstate') -# use to detect lack of a parameter -SENTINEL = object() - HAS_FAST_DIRSTATE_V2 = rustmod is not None propertycache = util.propertycache @@ -660,12 +657,8 @@ fold_p2 = oldp2 != nullid and p2 == nullid return self._map.setparents(p1, p2, fold_p2=fold_p2) - def setbranch(self, branch, transaction=SENTINEL): + def setbranch(self, branch, transaction): self.__class__._branch.set(self, encoding.fromlocal(branch)) - if transaction is SENTINEL: - msg = b"setbranch needs a `transaction` argument" - self._ui.deprecwarn(msg, b'6.5') - transaction = None if transaction is not None: self._setup_tr_abort(transaction) transaction.addfilegenerator(