Mercurial > hg-stable
changeset 51293: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 | c4cbb515b006 |
children | bec6e9c108fd |
files | hgext/git/dirstate.py mercurial/dirstate.py mercurial/interfaces/dirstate.py |
diffstat | 3 files changed, 3 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/git/dirstate.py Wed Dec 20 14:59:31 2023 +0100 +++ b/hgext/git/dirstate.py Tue Dec 12 17:08:45 2023 +0100 @@ -389,7 +389,7 @@ # TODO: should this be added to the dirstate interface? self._plchangecallbacks[category] = callback - def setbranch(self, branch, transaction=None): + def setbranch(self, branch, transaction): raise error.Abort( b'git repos do not support branches. try using bookmarks' )
--- 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(